]> Cypherpunks repositories - gostls13.git/commit
debug/dwarf: more graceful handling of unsupported types
authorThan McIntosh <thanm@google.com>
Fri, 18 Jan 2019 20:16:11 +0000 (15:16 -0500)
committerThan McIntosh <thanm@google.com>
Fri, 15 Mar 2019 17:33:46 +0000 (17:33 +0000)
commitc135dfbf1842993aa2fd4c293b2476ce4733daf7
tree7f66e8ae126664969d145c3bdd823de3506eec1c
parent6e63b15567cb67059153bbcd787ed0d2f64dbcf3
debug/dwarf: more graceful handling of unsupported types

Enhance the type decoder to do a better job handling unknown type
tags. DWARF has a number of type DIEs that this package doesn't handle
(things like "pointer to member" types in C++); avoid crashing for
such types, but instead return a placeholder "UnsupportedType" object
(this idea suggested by Austin). This provides a compromise between
implementing the entire kitchen sink and simply returning an error
outright on any unknown type DIE.

Fixes #29601.

Change-Id: I2eeffa094c86ef3a2c358ee42e8e629d74cec2ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/158797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/debug/dwarf/testdata/cppunsuptypes.cc [new file with mode: 0644]
src/debug/dwarf/testdata/cppunsuptypes.elf [new file with mode: 0644]
src/debug/dwarf/type.go
src/debug/dwarf/type_test.go