]> Cypherpunks repositories - gostls13.git/commit
debug/dwarf: return ClassUnknown if attribute class cannot be determined
authorAustin Clements <austin@google.com>
Sun, 13 Sep 2015 16:12:13 +0000 (12:12 -0400)
committerAustin Clements <austin@google.com>
Tue, 15 Sep 2015 17:57:51 +0000 (17:57 +0000)
commit6044dd098d93d12c26ae8378a6c99338350e8280
treecb5c71fdd4d4c8cac235ebe1476b6edfc7b5051b
parentb6d115a583c42cb086de408471dc943ff6704cfb
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>
src/debug/dwarf/class_string.go
src/debug/dwarf/entry.go