Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,8 @@ class StackTraceImpl<system_tag::current_tag> : public StackTraceImplHolder {
ctx.uc_mcontext.fault_address = uctx->uc_mcontext.fault_address;
_stacktrace[index] = reinterpret_cast<void *>(ctx.uc_mcontext.pc);
++index;
#elif defined(__APPLE__) && defined(__x86_64__)
#elif defined(__APPLE__)
#if defined(__x86_64__)
unw_getcontext(&ctx);
// OS X's implementation of libunwind uses its own context object
// so we need to convert the passed context to libunwind's format
Expand Down Expand Up @@ -1037,7 +1038,7 @@ class StackTraceImpl<system_tag::current_tag> : public StackTraceImplHolder {
}
_stacktrace[index] = reinterpret_cast<void *>(ctx.data[16]);
++index;
#elif defined(__APPLE__)
#elif defined(__i386__)
unw_getcontext(&ctx)
// TODO: Convert the ucontext_t to libunwind's unw_context_t like
// we do in 64 bits
Expand All @@ -1048,6 +1049,18 @@ class StackTraceImpl<system_tag::current_tag> : public StackTraceImplHolder {
_stacktrace[index] =
reinterpret_cast<void *>(ctx.uc_mcontext->__ss.__eip);
++index;
#else // PowerPC
unw_getcontext(&ctx)
// TODO: Convert the ucontext_t to libunwind's unw_context_t like
// we do in x86_64 case.
if (ctx.uc_mcontext->__ss.__srr0 ==
reinterpret_cast<greg_t>(error_addr())) {
ctx.uc_mcontext->__ss.__srr0 = ctx.uc_mcontext->__ss.__r1;
}
_stacktrace[index] =
reinterpret_cast<void *>(ctx.uc_mcontext->__ss.__srr0);
++index;
#endif
#endif
}

Expand Down