dwarf/reader: precalcStack does not need to read past the first entry

It was reading all the way to the end of the debug_info section,
slowing down stacktraces substantially.

Benchmark before:

BenchmarkConditionalBreakpoints-4   	       1	80344642562 ns/op

Benchmark after:

BenchmarkConditionalBreakpoints-4   	       1	22218288218 ns/op

i.e. a reduction of the cost of a breakpoint hit from 8ms to 2.2ms

Updates #1549
This commit is contained in:
aarzilli 2020-01-23 17:53:29 +01:00 committed by Derek Parker
parent fc3e01bb5b
commit 7eddfb77b9

@ -426,6 +426,9 @@ childLoop:
default:
irdr.reader.SkipChildren()
}
if rentry == nil {
break
}
}
if rentry != nil && rentry.Tag == dwarf.TagInlinedSubroutine {