summaryrefslogtreecommitdiff
path: root/src/stacktrace_x86-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stacktrace_x86-inl.h')
-rw-r--r--src/stacktrace_x86-inl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stacktrace_x86-inl.h b/src/stacktrace_x86-inl.h
index f7c0095..46eb5d8 100644
--- a/src/stacktrace_x86-inl.h
+++ b/src/stacktrace_x86-inl.h
@@ -288,7 +288,7 @@ static void **NextStackFrame(void **old_sp, const void *uc) {
// int skip_count: how many stack pointers to skip before storing in result
// void* ucp: a ucontext_t* (GetStack{Trace,Frames}WithContext only)
-int GET_STACK_TRACE_OR_FRAMES {
+static int GET_STACK_TRACE_OR_FRAMES {
void **sp;
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || __llvm__
// __builtin_frame_address(0) can return the wrong address on gcc-4.1.0-k8.
@@ -321,6 +321,8 @@ int GET_STACK_TRACE_OR_FRAMES {
# error Using stacktrace_x86-inl.h on a non x86 architecture!
#endif
+ skip_count++; // skip parent's frame due to indirection in stacktrace.cc
+
int n = 0;
while (sp && n < max_depth) {
if (*(sp+1) == reinterpret_cast<void *>(0)) {