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

@ -3455,3 +3455,21 @@ func TestIssue1145(t *testing.T) {
}
})
}
func TestDisassembleGlobalVars(t *testing.T) {
withTestProcess("teststepconcurrent", t, func(p proc.Process, fixture protest.Fixture) {
mainfn := p.BinInfo().LookupFunc["main.main"]
text, err := proc.Disassemble(p, nil, mainfn.Entry, mainfn.End)
assertNoError(err, t, "Disassemble")
found := false
for i := range text {
if strings.Index(text[i].Text(proc.IntelFlavour, p.BinInfo()), "main.v") > 0 {
found = true
break
}
}
if !found {
t.Fatalf("could not find main.v reference in disassembly")
}
})
}