Commit 7c81527e by Ian Lance Taylor

runtime: Remove confusion about split stack functions in backtrace.

From-SVN: r195627
parent dbdbd982
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
struct callers_data struct callers_data
{ {
Location *locbuf; Location *locbuf;
int skip;
int index; int index;
int max; int max;
}; };
...@@ -41,6 +42,12 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno, ...@@ -41,6 +42,12 @@ callback (void *data, uintptr_t pc, const char *filename, int lineno,
return 0; return 0;
} }
if (arg->skip > 0)
{
--arg->skip;
return 0;
}
loc = &arg->locbuf[arg->index]; loc = &arg->locbuf[arg->index];
loc->pc = pc; loc->pc = pc;
...@@ -75,10 +82,11 @@ runtime_callers (int32 skip, Location *locbuf, int32 m) ...@@ -75,10 +82,11 @@ runtime_callers (int32 skip, Location *locbuf, int32 m)
struct callers_data data; struct callers_data data;
data.locbuf = locbuf; data.locbuf = locbuf;
data.skip = skip + 1;
data.index = 0; data.index = 0;
data.max = m; data.max = m;
backtrace_full (__go_get_backtrace_state (), skip + 1, callback, backtrace_full (__go_get_backtrace_state (), 0, callback, error_callback,
error_callback, &data); &data);
return data.index; return data.index;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment