aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-callers.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-02-22 18:52:33 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-02-22 18:52:33 +0000
commitafedc99bd2e1f2c8b64e3deaf5ef4e1231a756af (patch)
tree5eca75e24abe6155adb44ab8c29ea40cb0bea840 /libgo/runtime/go-callers.c
parent35e7db41cab1a2b134b8ccd4407675ab20fde578 (diff)
downloadgcc-afedc99bd2e1f2c8b64e3deaf5ef4e1231a756af.zip
gcc-afedc99bd2e1f2c8b64e3deaf5ef4e1231a756af.tar.gz
gcc-afedc99bd2e1f2c8b64e3deaf5ef4e1231a756af.tar.bz2
runtime: funcfileline: get missing function name from symbol table
Copy the idea of https://golang.org/cl/92756 to funcfileline, which is used by runtime.FuncForPC, runtime.(*Frames).Next, and others. Reviewed-on: https://go-review.googlesource.com/96175 From-SVN: r257913
Diffstat (limited to 'libgo/runtime/go-callers.c')
-rw-r--r--libgo/runtime/go-callers.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 5903153..b16ae0c 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -145,16 +145,17 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
/* Syminfo callback. */
-static void
-syminfo_fnname_callback (void *data, uintptr_t pc __attribute__ ((unused)),
- const char *symname,
- uintptr_t address __attribute__ ((unused)),
- uintptr_t size __attribute__ ((unused)))
+void
+__go_syminfo_fnname_callback (void *data,
+ uintptr_t pc __attribute__ ((unused)),
+ const char *symname,
+ uintptr_t address __attribute__ ((unused)),
+ uintptr_t size __attribute__ ((unused)))
{
- Location* locptr = (Location*) data;
+ String* strptr = (String*) data;
if (symname != NULL)
- locptr->function = runtime_gostringnocopy ((const byte *) symname);
+ *strptr = runtime_gostringnocopy ((const byte *) symname);
}
/* Error callback. */
@@ -228,8 +229,8 @@ runtime_callers (int32 skip, Location *locbuf, int32 m, bool keep_thunks)
for (i = 0; i < data.index; ++i)
{
if (locbuf[i].function.len == 0 && locbuf[i].pc != 0)
- backtrace_syminfo (state, locbuf[i].pc, syminfo_fnname_callback,
- error_callback, &locbuf[i]);
+ backtrace_syminfo (state, locbuf[i].pc, __go_syminfo_fnname_callback,
+ error_callback, &locbuf[i].function);
}
return data.index;