proc: use DW_AT_trampoline to detect auto-generated code (#3528)

Use the trampoline attribute to detect auto-generated code. This fixes
a bug where stepping into a method of a generic type called through an
interface will take the debugger into an auto-generated wrapper that
does not have a dictionary and using next will step out of the wrapper.

Fixes a bug reported on the #delve channel of the gophers slack server.
This commit is contained in:
Alessandro Arzilli
2023-10-16 17:57:33 +02:00
committed by GitHub
parent 04bb7fda33
commit 788df884e6
4 changed files with 68 additions and 2 deletions

View File

@ -1191,7 +1191,7 @@ func extractVarInfoFromEntry(tgt *Target, bi *BinaryInfo, image *Image, regs op.
t, err = resolveParametricType(bi, mem, t, dictAddr)
if err != nil {
// Log the error, keep going with t, which will be the shape type
logflags.DebuggerLogger().Errorf("could not resolve parametric type of %s", n)
logflags.DebuggerLogger().Errorf("could not resolve parametric type of %s: %v", n, err)
}
addr, pieces, descr, err := bi.Location(entry, dwarf.AttrLocation, regs.PC(), regs, mem)