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:
aarzilli
2017-10-26 13:37:19 +02:00
committed by Derek Parker
parent 84ce278352
commit ec8dc3a10d
30 changed files with 4571 additions and 35 deletions

View File

@ -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