diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-10-20 17:25:02 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2019-11-05 02:49:48 +0000 |
commit | 2ff746d7dc3ce5ce7034bfcc3af16b7b8eab7413 (patch) | |
tree | 042cfca423a4f83993f526eb7dd7ce11c29c4da1 /src/runtime/traceback.go | |
parent | 376c4ceab76591838623086ce387230cab5d0d5d (diff) | |
download | go-2ff746d7dc3ce5ce7034bfcc3af16b7b8eab7413.tar.gz go-2ff746d7dc3ce5ce7034bfcc3af16b7b8eab7413.zip |
runtime: add async preemption support on ARM
This CL adds support of call injection and async preemption on
ARM.
Injected call, like sigpanic, has special frame layout. Teach
traceback to handle it.
Change-Id: I887e90134fbf8a676b73c26321c50b3c4762dba4
Reviewed-on: https://go-review.googlesource.com/c/go/+/202338
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/traceback.go')
-rw-r--r-- | src/runtime/traceback.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 9be7d739d1..dc2a7a3693 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -462,6 +462,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in } waspanic = f.funcID == funcID_sigpanic + injectedCall := waspanic || f.funcID == funcID_asyncPreempt // Do not unwind past the bottom of the stack. if !flr.valid() { @@ -477,8 +478,8 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in frame.argmap = nil // On link register architectures, sighandler saves the LR on stack - // before faking a call to sigpanic. - if usesLR && waspanic { + // before faking a call. + if usesLR && injectedCall { x := *(*uintptr)(unsafe.Pointer(frame.sp)) frame.sp += sys.MinFrameSize if GOARCH == "arm64" { |