mirror of
https://github.com/go-delve/delve.git
synced 2025-10-27 20:23:41 +08:00
pkg/proc: enable basic debug functionality for stripped ELF binaries (#3408)
We used to parse the .gopclntab section but removed support in favor of simply using DWARF debug information, due to lack of C symbols among other reasons. This makes it impossible to debug stripped binaries, which some distrubutions ship by default. Add back in basic support for .gopclntab which survives if the binary is stripped, allowing for rudimentary debugging such as basic program navigation, tracing, etc...
This commit is contained in:
@ -535,7 +535,7 @@ func (g *G) StartLoc(tgt *Target) Location {
|
||||
if fn == nil {
|
||||
return Location{PC: g.StartPC}
|
||||
}
|
||||
f, l := fn.cu.lineInfo.PCToLine(fn.Entry, fn.Entry)
|
||||
f, l := tgt.BinInfo().EntryLineForFunc(fn)
|
||||
return Location{PC: fn.Entry, File: f, Line: l, Fn: fn}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user