diff options
Diffstat (limited to 'src/processor/stackwalker_sparc.cc')
-rw-r--r-- | src/processor/stackwalker_sparc.cc | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/processor/stackwalker_sparc.cc b/src/processor/stackwalker_sparc.cc index 2e819a69..ac356baa 100644 --- a/src/processor/stackwalker_sparc.cc +++ b/src/processor/stackwalker_sparc.cc @@ -43,13 +43,12 @@ namespace google_breakpad { -StackwalkerSPARC::StackwalkerSPARC(const SystemInfo *system_info, - const MDRawContextSPARC *context, - MemoryRegion *memory, - const CodeModules *modules, - SymbolSupplier *supplier, - SourceLineResolverInterface *resolver) - : Stackwalker(system_info, memory, modules, supplier, resolver), +StackwalkerSPARC::StackwalkerSPARC(const SystemInfo* system_info, + const MDRawContextSPARC* context, + MemoryRegion* memory, + const CodeModules* modules, + StackFrameSymbolizer* resolver_helper) + : Stackwalker(system_info, memory, modules, resolver_helper), context_(context) { } @@ -60,7 +59,7 @@ StackFrame* StackwalkerSPARC::GetContextFrame() { return NULL; } - StackFrameSPARC *frame = new StackFrameSPARC(); + StackFrameSPARC* frame = new StackFrameSPARC(); // The instruction pointer is stored directly in a register, so pull it // straight out of the CPU context structure. @@ -73,13 +72,13 @@ StackFrame* StackwalkerSPARC::GetContextFrame() { } -StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack *stack) { +StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack* stack) { if (!memory_ || !stack) { BPLOG(ERROR) << "Can't get caller frame without memory or stack"; return NULL; } - StackFrameSPARC *last_frame = static_cast<StackFrameSPARC*>( + StackFrameSPARC* last_frame = static_cast<StackFrameSPARC*>( stack->frames()->back()); // new: caller @@ -87,7 +86,7 @@ StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack *stack) { // %fp, %i6 and g_r[30] is the same, see minidump_format.h // %sp, %o6 and g_r[14] is the same, see minidump_format.h // %sp_new = %fp_old - // %fp_new = *(%fp_old + 32 + 32 - 8), where the callee's %i6 + // %fp_new = *(%fp_old + 32 + 32 - 8), where the callee's %i6 // %pc_new = *(%fp_old + 32 + 32 - 4) + 8 // which is callee's %i7 plus 8 @@ -111,14 +110,14 @@ StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack *stack) { return NULL; } - StackFrameSPARC *frame = new StackFrameSPARC(); + StackFrameSPARC* frame = new StackFrameSPARC(); frame->context = last_frame->context; frame->context.g_r[14] = stack_pointer; frame->context.g_r[30] = stack_base; - + // frame->context.pc is the return address, which is 2 instruction - // past the branch that caused us to arrive at the callee, which are + // past the branch that caused us to arrive at the callee, which are // a CALL instruction then a NOP instruction. // frame_ppc->instruction to 8 less than that. Since all sparc // instructions are 4 bytes wide, this is the address of the branch @@ -131,7 +130,7 @@ StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack *stack) { StackFrameSPARC::CONTEXT_VALID_SP | StackFrameSPARC::CONTEXT_VALID_FP; frame->trust = StackFrame::FRAME_TRUST_FP; - + return frame; } |