]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix overlapping CUs in gdb.dwarf2/dw2-entry-points.exp
authorTom de Vries <tdevries@suse.de>
Fri, 29 Aug 2025 15:31:58 +0000 (17:31 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 29 Aug 2025 15:31:58 +0000 (17:31 +0200)
When running test-case gdb.dwarf2/dw2-entry-points.exp with target board
cc-with-gdb-index, I get:
...
(gdb) file dw2-entry-points^M
Reading symbols from dw2-entry-points...^M
warning: .gdb_index address table has a range (0x40066c - 0x4006e4) that \
  overlaps with an earlier range, ignoring .gdb_index^M
(gdb) delete breakpoints^M
...

Fix this by copying function bar_helper to barso_helper, and using it where
appropriate.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/33315
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33315

gdb/testsuite/gdb.dwarf2/dw2-entry-points.c
gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp

index ccfb150e207fdf56631cee9899ac521c41ac2787..258ebfaa175ab9cd9eba5d4844e4694f31f37020 100644 (file)
@@ -33,11 +33,28 @@ bar_helper (void)
   asm ("foobar_entry_label: .globl foobar_entry_label");
 }
 
+__attribute__ ((noinline))
+void
+barso_helper (void)
+{
+  asm ("barso_helper_label: .globl barso_helper_label");
+  I++;
+  J++;
+  asm ("fooso_entry_label: .globl fooso_entry_label");
+  J++;
+  K++;
+  asm ("foobarso_entry_label: .globl foobarso_entry_label");
+}
+
 int
 main (void)
 {
   asm ("main_label: .globl main_label");
   bar_helper ();
+  I = 0;
+  J = 0;
+  K = 0;
+  barso_helper ();
 
   return 0;
 }
index bd22560aa78bc0df68d2b3659eb9fca5d1cb8bce..bba4cfb198a8434045afd4e77c0d938570a69100 100644 (file)
@@ -36,6 +36,7 @@ Dwarf::assemble $asm_file {
 
     get_func_info main
     get_func_info bar_helper
+    get_func_info barso_helper
 
     set int_size [get_sizeof "int" 4]
 
@@ -135,8 +136,8 @@ Dwarf::assemble $asm_file {
                {decl_file 1 data1}
                {decl_line $bar_line data1}
                {external 1 flag}
-               {low_pc $bar_helper_start addr}
-               {high_pc "$bar_helper_start + $bar_helper_len" addr}
+               {low_pc $barso_helper_start addr}
+               {high_pc "$barso_helper_start + $barso_helper_len" addr}
            } {
                formal_parameter {
                    {name I}
@@ -152,7 +153,7 @@ Dwarf::assemble $asm_file {
                    {name fooso}
                    {decl_file 1 data1}
                    {decl_line $foo_line data1}
-                   {low_pc foo_entry_label addr}
+                   {low_pc fooso_entry_label addr}
                } {
                    formal_parameter {
                        {name J}