delve/pkg/proc/native
Alessandro Arzilli 1a9e38aa0c
proc,terminal: Implement reverse step, next and stepout (#1785)
* proc: move defer breakpoint code into a function

Moves the code that sets a breakpoint on the first deferred function,
used by both next and StepOut, to its function.

* proc: implement reverse step/next/stepout

When the direction of execution is reversed (on a recording) Step, Next and
StepOut will behave similarly to their forward version. However there are
some subtle interactions between their behavior, prologue skipping, deferred
calls and normal calls. Specifically:

- when stepping backwards we need to set a breakpoint on the first
  instruction after each CALL instruction, once this breakpoint is reached we
  need to execute a single StepInstruction operation to reverse step into the
  CALL.
- to insure that the prologue is skipped reverse next needs to check if it
  is on the first instruction after the prologue, and if it is behave like
  reverse stepout.
- there is no reason to set breakpoints on deferred calls when reverse
  nexting or reverse stepping out, they will never be hit.
- reverse step out should generally place its breakpoint on the CALL
  instruction that created the current stack frame (which will be the CALL
  instruction immediately preceding the instruction at the return address).
- reverse step out needs to treat panic calls and deferreturn calls
  specially.

* service,terminal: implement reverse step, next, stepout
2020-03-11 15:40:41 -07:00
..
exc_user_darwin.c proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
exc.h proc: refactoring: split backends to separate packages 2017-04-21 14:00:04 -07:00
exec_darwin.c proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
exec_darwin.h proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
mach_exc_user_darwin.c proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
mach_exc.h proc: refactoring: split backends to separate packages 2017-04-21 14:00:04 -07:00
nonative_darwin.go pkg/proc: Introduce Target and remove CommonProcess (#1834) 2020-01-21 12:41:24 -08:00
proc_darwin.c proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
proc_darwin.go proc,proc/*: add StopReason field to Target (#1877) 2020-03-10 12:27:38 -07:00
proc_darwin.h proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
proc_freebsd.c *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
proc_freebsd.go proc,proc/*: add StopReason field to Target (#1877) 2020-03-10 12:27:38 -07:00
proc_freebsd.h *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
proc_linux.go proc,proc/*: add StopReason field to Target (#1877) 2020-03-10 12:27:38 -07:00
proc_windows.go proc,proc/*: add StopReason field to Target (#1877) 2020-03-10 12:27:38 -07:00
proc.go proc,terminal: Implement reverse step, next and stepout (#1785) 2020-03-11 15:40:41 -07:00
ptrace_darwin.go proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
ptrace_freebsd_amd64.c *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
ptrace_freebsd_amd64.h *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
ptrace_freebsd.go *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
ptrace_linux_64bit.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
ptrace_linux_386.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
ptrace_linux_amd64.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
ptrace_linux.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
register_linux_386.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
registers_darwin_amd64.go proc: only format registers value when it's necessary (#1860) 2020-02-12 13:31:48 -08:00
registers_freebsd_amd64.go *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
registers_linux_amd64.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
registers_linux_arm64.go pkg/proc: fix typo in the comment of PtraceGetFpRegset (#1848) 2020-01-27 10:20:56 +01:00
registers_windows_amd64.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
support_sentinel.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
syscall_windows_amd64.go proc: move windows register handling code to winutil package 2018-11-21 12:17:16 -08:00
syscall_windows.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
threads_darwin.c proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
threads_darwin.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
threads_darwin.h proc/native,Makefile: allow compiling on macOS without native backend 2018-10-02 10:46:09 -07:00
threads_freebsd.go *: FreeBSD initial support (#1480) 2019-07-12 18:28:04 -07:00
threads_linux_386.go pkg/proc,service: support linux/386 (#1884) 2020-03-10 09:34:40 -07:00
threads_linux_amd64.go proc/native: separate amd64-arch code 2019-11-27 11:07:31 -08:00
threads_linux_arm64.go proc/core: implementing coredump functionality for ARM64 (#1774) 2020-02-17 09:29:17 -08:00
threads_linux.go proc/native/linuc: Better native.Process.stop performance (#1874) 2020-03-09 10:15:45 -07:00
threads_windows.go *: Go 1.14 support branch (#1727) 2020-02-10 17:31:54 -08:00
threads.go pkg/proc: Introduce Target and remove CommonProcess (#1834) 2020-01-21 12:41:24 -08:00
zsyscall_windows.go proc: refactoring: split backends to separate packages 2017-04-21 14:00:04 -07:00