mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 10:17:03 +08:00
proc,vendor: show global variables in disassembly
updates vendored version of x86asm, adds a symbol lookup function to pass to the disassembler. This will show global symbol names in the disassembly like go tool objdump does.
This commit is contained in:
@ -653,10 +653,10 @@ func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) {
|
||||
}
|
||||
|
||||
func (scope *EvalScope) findGlobal(name string) (*Variable, error) {
|
||||
for n, off := range scope.BinInfo.packageVars {
|
||||
if n == name || strings.HasSuffix(n, "/"+name) {
|
||||
for _, pkgvar := range scope.BinInfo.packageVars {
|
||||
if pkgvar.name == name || strings.HasSuffix(pkgvar.name, "/"+name) {
|
||||
reader := scope.DwarfReader()
|
||||
reader.Seek(off)
|
||||
reader.Seek(pkgvar.offset)
|
||||
entry, err := reader.Next()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user