aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-08-03 16:59:20 +0200
committerTom de Vries <tdevries@suse.de>2020-08-03 16:59:20 +0200
commit8f34b74686c6b9bf83d1c46e93b5aecca2e0ed0e (patch)
tree605f17455a9ec80a06eb74b7bd4e790bc16d6b67 /gdb/dwarf2
parente44a1d7b9ad8d73f6cea1f20fe353fc12f9b8e66 (diff)
downloadgdb-8f34b74686c6b9bf83d1c46e93b5aecca2e0ed0e.zip
gdb-8f34b74686c6b9bf83d1c46e93b5aecca2e0ed0e.tar.gz
gdb-8f34b74686c6b9bf83d1c46e93b5aecca2e0ed0e.tar.bz2
[gdb/symtab] Ignore DW_LNE_lo_user/DW_LNE_hi_user range
When reading an exec with a .debug_line section containing a vendor-specific extended opcode, we get: ... $ gdb -batch -iex "set complaints 10" dw2-vendor-extended-opcode During symbol reading: mangled .debug_line section ... and reading of the .debug_line section is abandoned. The vendor-specific extended opcode should be ignored, as specified in the DWARF standard (7.1 Vendor Extensibility). [ FWIW, vendor-specific standard opcodes are already ignored. ] Fix this by ignoring all vendor-specific extended opcodes. Build and tested on x86_64-linux. gdb/ChangeLog: 2020-08-03 Tom de Vries <tdevries@suse.de> PR symtab/26333 * dwarf2/read.c (dwarf_decode_lines_1): Ignore DW_LNE_lo_user/DW_LNE_hi_user range. gdb/testsuite/ChangeLog: 2020-08-03 Tom de Vries <tdevries@suse.de> PR symtab/26333 * lib/dwarf.exp (DW_LNE_user): New proc. * gdb.dwarf2/dw2-vendor-extended-opcode.c: New test. * gdb.dwarf2/dw2-vendor-extended-opcode.exp: New file.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 4e70dcc..bcbffbf 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -20591,6 +20591,13 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
extended_end = line_ptr + extended_len;
extended_op = read_1_byte (abfd, line_ptr);
line_ptr += 1;
+ if (DW_LNE_lo_user <= extended_op
+ && extended_op <= DW_LNE_hi_user)
+ {
+ /* Vendor extension, ignore. */
+ line_ptr = extended_end;
+ break;
+ }
switch (extended_op)
{
case DW_LNE_end_sequence: