Previously it was only possible to extract a value of type `any` using
an attribute name. This poses challenges when fields are allowed to have
different classes, and it is ambiguous how to handle them.
Go 1.19 also formats doc comments according to the new godoc syntax.
Some of our comments, especially unexported symbols did not conform to
the godoc syntax and therefore are mangled by 'go fmt'.
This PR runs 'go fmt' from go1.19 on everything and manually fixes the
problems.
See also:
https://github.com/golang/proposal/blob/master/design/51082-godocfmt.md
The godwarf package provides two ways to turn a dwarf.Entry into a
godwarf.Tree: LoadTree and EntryToTree. The former doesn't handle
children - it doesn't advance a Reader past them (in fact, it doesn't
even know about a Reader). EntryToTree is only used for variables and
formal param DIEs, which don't have children, and it would very likely
be incorrect to use it for DIEs with children. This patch makes the
function panic if the entry can have children.
Instead of rescanning debug_info every time we want to read a function
(either to find inlined calls or its variables) cache the tree of
dwarf.Entry that we would generate and use that.
Benchmark before:
BenchmarkConditionalBreakpoints-4 1 5164689165 ns/op
Benchmark after:
BenchmarkConditionalBreakpoints-4 1 4817425836 ns/op
Updates #1549