[gdb/testsuite] Add missing ranges base in dw2-objfile-overlap-*.S
authorTom de Vries <tdevries@suse.de>
Mon, 26 Oct 2020 10:08:38 +0000 (11:08 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 26 Oct 2020 10:08:38 +0000 (11:08 +0100)
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  <tdevries@suse.de>

* gdb.dwarf2/dw2-objfile-overlap-inner.S: Specify default base address
for CU.
* gdb.dwarf2/dw2-objfile-overlap-outer.S: Same.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S
gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S

index e2944f21806c7e3f4f44caab530bc91178fcf888..60bbd8a86967480f6521d550af5ea746d5811582 100644 (file)
@@ -1,3 +1,9 @@
+2020-10-26  Tom de Vries  <tdevries@suse.de>
+
+       * 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  <tdevries@suse.de>
 
        * lib/dwarf.exp (Dwarf::_guess_form): Return "" by default instead of
index e895929532ac0b3287aa76e8256da14764231df7..dd4d5b0eb930f5bf77b93783ff9a1e73d7fd0c6d 100644 (file)
@@ -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 */
index 9fa578db8ad70c7df7db852e013d99d91bd674fe..75efa01400344d9a1e747fcdadafa9c0a659f3cb 100644 (file)
@@ -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 */