terminal: add ability to show disassembly instead of source (#3047)

Adds ability to show current position as disassembly instead of source
listing every time execution stops. Change default to show disassembly
after step-instruction and source listing in every other case.

Fixes #2878
This commit is contained in:
Alessandro Arzilli
2022-07-14 23:08:47 +02:00
committed by GitHub
parent 278e4d10c8
commit 1fe03e728c
4 changed files with 101 additions and 22 deletions

View File

@ -1331,3 +1331,14 @@ func TestTranscript(t *testing.T) {
os.Remove(name)
})
}
func TestDisassPosCmd(t *testing.T) {
withTestTerminal("testvariables2", t, func(term *FakeTerminal) {
term.MustExec("continue")
out := term.MustExec("step-instruction")
t.Logf("%q\n", out)
if !strings.Contains(out, "call $runtime.Breakpoint") && !strings.Contains(out, "CALL runtime.Breakpoint(SB)") {
t.Errorf("output doesn't look like disassembly")
}
})
}