aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-04-06 14:04:45 -0700
committerIan Lance Taylor <iant@golang.org>2020-04-06 16:37:24 -0700
commit52fa80f853c0b0f623ea9e4c7198e324ce44ff30 (patch)
treee2695726e95b7bd125d52b7bdd315cb0028854fa /libgo/runtime
parent749bd22ddc50b5112e5ed506ffef7249bf8e6fb3 (diff)
downloadgcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.zip
gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.gz
gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.bz2
libgo: update to almost the 1.14.2 release
Update to edea4a79e8d7dea2456b688f492c8af33d381dc2 which is likely to be approximately the 1.14.2 release. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227377
Diffstat (limited to 'libgo/runtime')
-rw-r--r--libgo/runtime/go-callers.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 33956ca..3178369 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -364,3 +364,39 @@ runtime_callersRaw (uintptr *pcbuf, int32 m)
return data.index;
}
+/* runtime_pcInlineCallers returns the inline stack of calls for a PC.
+ This is like runtime_callers, but instead of doing a backtrace,
+ just finds the information for a single PC value. */
+
+int32 runtime_pcInlineCallers (uintptr, Location *, int32)
+ __asm__ (GOSYM_PREFIX "runtime.pcInlineCallers");
+
+int32
+runtime_pcInlineCallers (uintptr pc, Location *locbuf, int32 m)
+{
+ struct callers_data data;
+ struct backtrace_state *state;
+ int32 i;
+
+ data.locbuf = locbuf;
+ data.skip = 0;
+ data.index = 0;
+ data.max = m;
+ data.keep_thunks = false;
+ data.saw_sigtramp = 0;
+ runtime_xadd (&__go_runtime_in_callers, 1);
+ state = __go_get_backtrace_state ();
+ backtrace_pcinfo (state, pc, callback, error_callback, &data);
+ runtime_xadd (&__go_runtime_in_callers, -1);
+
+ /* Try to use backtrace_syminfo to fill in missing names. See
+ runtime_callers. */
+ for (i = 0; i < data.index; ++i)
+ {
+ if (locbuf[i].function.len == 0 && locbuf[i].pc != 0)
+ backtrace_syminfo (state, locbuf[i].pc, __go_syminfo_fnname_callback,
+ error_callback, &locbuf[i].function);
+ }
+
+ return data.index;
+}