From 7f49a8c074271efcf7930f4a476927155170a3d1 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 8 Sep 2023 12:27:02 +0200 Subject: [PATCH] [gdb/testsuite] Add aranges in gdb.dwarf2/dwzbuildid.exp While investigating the execs of gdb.dwarf2/dwzbuildid.exp using readelf I ran into a warning: ... $ readelf -w dwzbuildid-ok > READELF readelf: Warning: .debug_info offset of 0x2e in .debug_aranges section does not point to a CU header. ... AFAICT, the warning is incorrect, I've filed PR binutils/30835 about that. While looking at the .debug_aranges section, I noticed that the entries for the CUs generated by the dwarf assembler are missing. Fix this by adding the missing .debug_aranges entries. Tested on x86_64-linux. --- gdb/testsuite/gdb.dwarf2/dwzbuildid.exp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp index 1aad712e32c..721aef8d344 100644 --- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp +++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp @@ -46,10 +46,13 @@ proc write_just_debugaltlink {filename dwzname buildid} { # Only the DWARF reader checks .gnu_debugaltlink, so make sure # there is a bit of DWARF in here. - cu {} { + cu { label cu_start } { compile_unit {{language @DW_LANG_C}} { } } + aranges {} cu_start { + arange {} 0 0 + } } } @@ -65,7 +68,7 @@ proc write_dwarf_file {filename buildid {value 99}} { build_id $buildid - cu {} { + cu { label cu_start } { compile_unit {{language @DW_LANG_C}} { int_label2: base_type { {name int} @@ -80,6 +83,10 @@ proc write_dwarf_file {filename buildid {value 99}} { } } } + + aranges {} cu_start { + arange {} 0 0 + } } } -- 2.30.2