aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/libgo/runtime/go-callers.c
diff options
context:
space:
mode:
authorsynergydev <synergye@codefi.re>2013-10-17 18:16:42 -0700
committersynergydev <synergye@codefi.re>2013-10-17 18:16:42 -0700
commit61c0330cc243abf13fdd01f377a7f80bd3989eb1 (patch)
tree119b08ae76294f23e2b1b7e72ff9a06afa9e8509 /gcc-4.8/libgo/runtime/go-callers.c
parent1c712bf7621f3859c33fd3afaa61fdcaf3fdfd76 (diff)
downloadtoolchain_gcc-61c0330cc243abf13fdd01f377a7f80bd3989eb1.tar.gz
toolchain_gcc-61c0330cc243abf13fdd01f377a7f80bd3989eb1.tar.bz2
toolchain_gcc-61c0330cc243abf13fdd01f377a7f80bd3989eb1.zip
[4.8] Merge GCC 4.8.2
Change-Id: I0f1fcf69c5076d8534c5c45562745e1a37adb197
Diffstat (limited to 'gcc-4.8/libgo/runtime/go-callers.c')
-rw-r--r--gcc-4.8/libgo/runtime/go-callers.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.8/libgo/runtime/go-callers.c b/gcc-4.8/libgo/runtime/go-callers.c
index dd1cf7909..291dfd0d6 100644
--- a/gcc-4.8/libgo/runtime/go-callers.c
+++ b/gcc-4.8/libgo/runtime/go-callers.c
@@ -53,6 +53,21 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
return 0;
}
+ /* Skip thunks and recover functions. There is no equivalent to
+ these functions in the gc toolchain, so returning them here means
+ significantly different results for runtime.Caller(N). */
+ if (function != NULL)
+ {
+ const char *p;
+
+ p = __builtin_strchr (function, '.');
+ if (p != NULL && __builtin_strncmp (p + 1, "$thunk", 6) == 0)
+ return 0;
+ p = __builtin_strrchr (function, '$');
+ if (p != NULL && __builtin_strcmp(p, "$recover") == 0)
+ return 0;
+ }
+
if (arg->skip > 0)
{
--arg->skip;