[gdb/symtab] Ignore DW_LNE_lo_user/DW_LNE_hi_user range
authorTom de Vries <tdevries@suse.de>
Mon, 3 Aug 2020 14:59:20 +0000 (16:59 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 3 Aug 2020 14:59:20 +0000 (16:59 +0200)
commit8f34b74686c6b9bf83d1c46e93b5aecca2e0ed0e
tree605f17455a9ec80a06eb74b7bd4e790bc16d6b67
parente44a1d7b9ad8d73f6cea1f20fe353fc12f9b8e66
[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.
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp [new file with mode: 0644]
gdb/testsuite/lib/dwarf.exp