From: Tom de Vries Date: Mon, 26 Oct 2020 10:08:38 +0000 (+0100) Subject: [gdb/testsuite] Add missing ranges base in dw2-objfile-overlap-*.S X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1612c4bbcb47ffbf6287e973db8c6b987d5b8b58;p=binutils-gdb.git [gdb/testsuite] Add missing ranges base in dw2-objfile-overlap-*.S When doing a gdb testsuite run with this trigger patch: ... @@ -14454,6 +14454,7 @@ dwarf2_ranges_process if (!base.has_value ()) { + gdb_assert (false); /* We have no valid base address for the ranges data. */ complaint (_("Invalid .debug_ranges data (no base address)")); ... we run into the assert with test-case gdb.dwarf2/dw2-objfile-overlap.exp. Fix this by adding the missing .debug_ranges base in gdb.dwarf2/dw2-objfile-overlap-*.S. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-26 Tom de Vries * gdb.dwarf2/dw2-objfile-overlap-inner.S: Specify default base address for CU. * gdb.dwarf2/dw2-objfile-overlap-outer.S: Same. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e2944f21806..60bbd8a8696 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-10-26 Tom de Vries + + * gdb.dwarf2/dw2-objfile-overlap-inner.S: Specify default base address + for CU. + * gdb.dwarf2/dw2-objfile-overlap-outer.S: Same. + 2020-10-23 Tom de Vries * lib/dwarf.exp (Dwarf::_guess_form): Return "" by default instead of diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S index e895929532a..dd4d5b0eb93 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S @@ -42,6 +42,7 @@ inner: /* CU die */ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ .4byte .Lline1_begin /* DW_AT_stmt_list */ + .4byte 0 /* DW_AT_low_pc */ .4byte .Ldebug_ranges /* DW_AT_ranges */ .ascii "inner.c\0" /* DW_AT_name */ .ascii "/tmp\0" /* DW_AT_comp_dir */ @@ -77,6 +78,8 @@ inner: .byte 1 /* has_children */ .uleb128 0x10 /* DW_AT_stmt_list */ .uleb128 0x6 /* DW_FORM_data4 */ + .uleb128 0x11 /* DW_AT_low_pc */ + .uleb128 0x1 /* DW_FORM_addr */ .uleb128 0x55 /* DW_AT_ranges */ .uleb128 0x6 /* DW_FORM_data4 */ .uleb128 0x3 /* DW_AT_name */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S index 9fa578db8ad..75efa014003 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S @@ -55,6 +55,7 @@ outer_after: /* CU die */ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ .4byte .Lline1_begin /* DW_AT_stmt_list */ + .4byte 0 /* DW_AT_low_pc */ .4byte .Ldebug_ranges /* DW_AT_ranges */ .ascii "outer.c\0" /* DW_AT_name */ .ascii "/tmp\0" /* DW_AT_comp_dir */ @@ -101,6 +102,8 @@ outer_after: .byte 1 /* has_children */ .uleb128 0x10 /* DW_AT_stmt_list */ .uleb128 0x6 /* DW_FORM_data4 */ + .uleb128 0x11 /* DW_AT_low_pc */ + .uleb128 0x1 /* DW_FORM_addr */ .uleb128 0x55 /* DW_AT_ranges */ .uleb128 0x6 /* DW_FORM_data4 */ .uleb128 0x3 /* DW_AT_name */