aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-01-31 19:44:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-01-31 19:44:24 +0000
commit7c81527e48c72ac3409f3bf848eca64bf69015e5 (patch)
treef9951e5980f39941e3976bda28868e6036f21518 /libgo
parentdbdbd982df2d044f3b43b2f41ef1ada5667160f9 (diff)
downloadgcc-7c81527e48c72ac3409f3bf848eca64bf69015e5.zip
gcc-7c81527e48c72ac3409f3bf848eca64bf69015e5.tar.gz
gcc-7c81527e48c72ac3409f3bf848eca64bf69015e5.tar.bz2
runtime: Remove confusion about split stack functions in backtrace.
From-SVN: r195627
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-callers.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libgo/runtime/go-callers.c b/libgo/runtime/go-callers.c
index 2154a8a..b6c494c 100644
--- a/libgo/runtime/go-callers.c
+++ b/libgo/runtime/go-callers.c
@@ -16,6 +16,7 @@
struct callers_data
{
Location *locbuf;
+ int skip;
int index;
int max;
};
@@ -41,6 +42,12 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
return 0;
}
+ if (arg->skip > 0)
+ {
+ --arg->skip;
+ return 0;
+ }
+
loc = &arg->locbuf[arg->index];
loc->pc = pc;
@@ -75,10 +82,11 @@ runtime_callers (int32 skip, Location *locbuf, int32 m)
struct callers_data data;
data.locbuf = locbuf;
+ data.skip = skip + 1;
data.index = 0;
data.max = m;
- backtrace_full (__go_get_backtrace_state (), skip + 1, callback,
- error_callback, &data);
+ backtrace_full (__go_get_backtrace_state (), 0, callback, error_callback,
+ &data);
return data.index;
}