From: Tom de Vries Date: Fri, 29 Aug 2025 15:31:58 +0000 (+0200) Subject: [gdb/testsuite] Fix overlapping CUs in gdb.dwarf2/dw2-entry-points.exp X-Git-Tag: gdb-17-branchpoint~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fee7bd256f7dc7ad1076087280d63e993e390e86;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix overlapping CUs in gdb.dwarf2/dw2-entry-points.exp 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 PR testsuite/33315 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33315 --- diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.c b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.c index ccfb150e207..258ebfaa175 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.c @@ -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; } diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp index bd22560aa78..bba4cfb198a 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp @@ -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}