mirror of git://gcc.gnu.org/git/gcc.git
runtime: Remove confusion about split stack functions in backtrace.
From-SVN: r195627
This commit is contained in:
parent
dbdbd982df
commit
7c81527e48
|
|
@ -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,
|
||||||
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)
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue