1
0
mirror of https://github.com/golang/go synced 2024-11-06 13:46:16 -07:00
go/src/debug
Austin Clements 6044dd098d debug/dwarf: return ClassUnknown if attribute class cannot be determined
Currently, if the .debug_abbrev section of an ELF file contains
attributes that aren't known to the dwarf package and that have form
formSecOffset, the dwarf package will fail to open the DWARF data with
an error like "decoding dwarf section abbrev at offset 0x17: cannot
determine class of unknown attribute with formSecOffset". For the most
part, the class is implied by the form encoded in the abbrev section,
but formSecOffset can imply many different DWARF classes. Hence,
debug/dwarf disambiguates these using a table of known attributes.
However, it will reject the entire image if it encounters an attribute
it can't determine the class of. This is particularly unfortunate
because the caller may never even uses the offending attribute.

Fix this by introducing a ClassUnknown attribute class to use as a
fallback in these cases. This allows the dwarf package to load the
DWARF data and isolates the problem to just the affected attributes.

Fixes #12592.

Change-Id: I766227b136e9757f8b89c0b3ab8e9ddea899d94f
Reviewed-on: https://go-review.googlesource.com/14541
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: jcd . <jcd@golang.org>
2015-09-15 17:57:51 +00:00
..
dwarf debug/dwarf: return ClassUnknown if attribute class cannot be determined 2015-09-15 17:57:51 +00:00
elf all: remove executable bit from several files 2015-09-04 02:59:49 +00:00
gosym debug/gosym: avoid calling the shell in test 2015-06-05 14:06:13 +00:00
macho all: remove executable bit from several files 2015-09-04 02:59:49 +00:00
pe debug/pe: truncate pe sections to their size in memory 2015-07-10 03:33:38 +00:00
plan9obj all: remove executable bit from several files 2015-09-04 02:59:49 +00:00