Optimize Next implementation

Once the program detects that we have stepped into another function,
we simply calculate the return address and then set a breakpoint and
continue to that location, avoiding numerous syscalls.
This commit is contained in:
Derek Parker
2014-10-11 17:29:10 -05:00
parent c60f3aafde
commit dc8c9cc2a4
4 changed files with 53 additions and 6 deletions

View File

@ -56,7 +56,7 @@ func TestFindReturnAddress(t *testing.T) {
syscall.PtracePeekText(p.Pid, uintptr(addr), data)
addr = binary.LittleEndian.Uint64(data)
expected := uint64(0x400f04)
expected := uint64(0x400ed4)
if addr != expected {
t.Fatalf("return address not found correctly, expected %#v got %#v", expected, addr)
}