aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-05-07 10:58:57 +0200
committerTom de Vries <tdevries@suse.de>2019-05-07 10:58:57 +0200
commit77e7aaa4bd980fb96244b874bc867e20b399fe60 (patch)
tree77b614f0bcb19b374f60db45565d0dbd7655337a /gdb
parent456ba0fa36d17648a6cf32d1561c8c5802103153 (diff)
downloadgdb-77e7aaa4bd980fb96244b874bc867e20b399fe60.zip
gdb-77e7aaa4bd980fb96244b874bc867e20b399fe60.tar.gz
gdb-77e7aaa4bd980fb96244b874bc867e20b399fe60.tar.bz2
[gdb/testsuite] Fix .debug_aranges in dw2-case-insensitive-debug.S
When running gdb.dwarf2/dw2-case-insensitive.exp with target board cc-with-debug-names, we run into: ... FAIL: gdb.dwarf2/dw2-case-insensitive.exp: regexp case-sensitive off \ (GDB internal error) ... in more detail: ... (gdb) info functions fUnC_lang gdb/dwarf2read.c:5293: internal-error: \ compunit_symtab* dw2_find_pc_sect_compunit_symtab(objfile*, \ bound_minimal_symbol, CORE_ADDR, obj_section*, int): \ Assertion `result != NULL' failed. ... The problem is that the .debug_aranges section in dw2-case-insensitive-debug.S contains a debug_info_offset which is set to 0: ... .section .debug_aranges,"",@progbits .4byte .Laranges_end - .Laranges_start .Laranges_start: .2byte 0x2 .4byte 0 ... while the compilation unit at offset 0 in the .debug_section of the executable is in fact not the compilation unit generated from dw2-case-insensitive-debug.S. This happens when linked in object files contain dwarf info and are placed in the .debug_info section before the compilation unit generated from dw2-case-insensitive-debug.S. Fix this by defining the debug_info_offset field using the label .Lcu1_begin that defines the start of the compilation unit: ... - .4byte 0 + .4byte .Lcu1_begin ... Tested on x86_64-linux with native, cc-with-gdb-index and cc-with-debug-names. gdb/testsuite/ChangeLog: 2019-05-07 Tom de Vries <tdevries@suse.de> PR testsuite/24522 * gdb.dwarf2/dw2-case-insensitive-debug.S: Fix debug_info_offset in .debug_aranges section.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S2
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e2b5075..c514c03 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2019-05-07 Tom de Vries <tdevries@suse.de>
+ PR testsuite/24522
+ * gdb.dwarf2/dw2-case-insensitive-debug.S: Fix debug_info_offset in
+ .debug_aranges section.
+
+2019-05-07 Tom de Vries <tdevries@suse.de>
+
PR testsuite/24159
* lib/dwarf.exp: Fix handling of DW_FORM_ref_addr.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
index f12a821..7f5e1a5 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
@@ -64,7 +64,7 @@
.4byte .Laranges_end - .Laranges_start // Length of Address Ranges Info
.Laranges_start:
.2byte 0x2 // DWARF Version
- .4byte 0 // .Ldebug_info0 - Offset of Compilation Unit Info
+ .4byte .Lcu1_begin // .Ldebug_info0 - Offset of Compilation Unit Info
.byte PTRBITS / 8 // Size of Address
.byte 0 // Size of Segment Descriptor
.2byte 0 // Pad to 16 byte boundary