diff options
Diffstat (limited to 'src/processor/stackwalker_amd64.cc')
-rw-r--r-- | src/processor/stackwalker_amd64.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index 0fec3d71..3aa7c736 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -33,6 +33,7 @@ // // Author: Mark Mentovai, Ted Mielczarek +#include <assert.h> #include "common/scoped_ptr.h" #include "google_breakpad/processor/call_stack.h" @@ -100,6 +101,11 @@ StackwalkerAMD64::StackwalkerAMD64(const SystemInfo* system_info, (sizeof(cfi_register_map_) / sizeof(cfi_register_map_[0]))) { } +u_int64_t StackFrameAMD64::ReturnAddress() const +{ + assert(context_validity & StackFrameAMD64::CONTEXT_VALID_RIP); + return context.rip; +} StackFrame* StackwalkerAMD64::GetContextFrame() { if (!context_) { @@ -226,14 +232,11 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack) { if (new_frame->context.rsp <= last_frame->context.rsp) return NULL; - // new_frame->context.rip is the return address, which is one instruction - // past the CALL that caused us to arrive at the callee. Set - // new_frame->instruction to one less than that. This won't reference the - // beginning of the CALL instruction, but it's guaranteed to be within - // the CALL, which is sufficient to get the source line information to - // match up with the line that contains a function call. Callers that - // require the exact return address value may access the context.rip - // field of StackFrameAMD64. + // new_frame->context.rip is the return address, which is the instruction + // after the CALL that caused us to arrive at the callee. Set + // new_frame->instruction to one less than that, so it points within the + // CALL instruction. See StackFrame::instruction for details, and + // StackFrameAMD64::ReturnAddress. new_frame->instruction = new_frame->context.rip - 1; return new_frame.release(); |