diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-05-27 10:05:52 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-05-31 21:17:40 +0000 |
commit | 3d037cfaf8c70b8af87cb5d57553a7e3e9dc2117 (patch) | |
tree | 217097c00ea85f856d669f0660de9413a18a8bf7 /src/runtime/cgo/gcc_traceback.c | |
parent | c52dff0727c58cb7a6e768d91d15e3eaafcb420a (diff) | |
download | go-3d037cfaf8c70b8af87cb5d57553a7e3e9dc2117.tar.gz go-3d037cfaf8c70b8af87cb5d57553a7e3e9dc2117.zip |
runtime: pass signal context to cgo traceback function
When doing a backtrace from a signal that occurs in C code compiled
without using -fasynchronous-unwind-tables, we have to rely on frame
pointers. In order to do that, the traceback function needs the signal
context to reliably pick up the frame pointer.
Change-Id: I7b45930fced01685c337d108e0f146057928f876
Reviewed-on: https://go-review.googlesource.com/23494
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/cgo/gcc_traceback.c')
-rw-r--r-- | src/runtime/cgo/gcc_traceback.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/cgo/gcc_traceback.c b/src/runtime/cgo/gcc_traceback.c index 01f9bb128b..667ea4c0cf 100644 --- a/src/runtime/cgo/gcc_traceback.c +++ b/src/runtime/cgo/gcc_traceback.c @@ -9,6 +9,7 @@ struct cgoTracebackArg { uintptr_t Context; + uintptr_t SigContext; uintptr_t* Buf; uintptr_t Max; }; @@ -22,6 +23,7 @@ x_cgo_callers(uintptr_t sig, void *info, void *context, void (*cgoTraceback)(str struct cgoTracebackArg arg; arg.Context = 0; + arg.SigContext = (uintptr_t)(context); arg.Buf = cgoCallers; arg.Max = 32; // must match len(runtime.cgoCallers) (*cgoTraceback)(&arg); |