Index: src/processor/exploitability_linux.cc |
=================================================================== |
--- src/processor/exploitability_linux.cc (revision 1467) |
+++ src/processor/exploitability_linux.cc (working copy) |
@@ -37,8 +37,8 @@ |
#include "processor/exploitability_linux.h" |
#include "google_breakpad/common/minidump_exception_linux.h" |
+#include "google_breakpad/processor/call_stack.h" |
#include "google_breakpad/processor/process_state.h" |
-#include "google_breakpad/processor/call_stack.h" |
#include "google_breakpad/processor/stack_frame.h" |
#include "processor/logging.h" |
@@ -98,26 +98,9 @@ |
return EXPLOITABILITY_ERR_PROCESSING; |
} |
- // Getting instruction pointer based off architecture. |
- uint32_t architecture = context->GetContextCPU(); |
- switch (architecture) { |
- case MD_CONTEXT_X86: |
- instruction_ptr = context->GetContextX86()->eip; |
- break; |
- case MD_CONTEXT_AMD64: |
- instruction_ptr = context->GetContextAMD64()->rip; |
- break; |
- case MD_CONTEXT_ARM: |
- instruction_ptr = |
- context->GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC]; |
- break; |
- case MD_CONTEXT_ARM64: |
- instruction_ptr = |
- context->GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_PC]; |
- break; |
- default: |
- BPLOG(INFO) << "Unsupported architecture."; |
- return EXPLOITABILITY_ERR_PROCESSING; |
+ // Getting the instruction pointer. |
+ if (!context->GetInstructionPointer(&instruction_ptr)) { |
+ return EXPLOITABILITY_ERR_PROCESSING; |
} |
// Checking for the instruction pointer in a valid instruction region. |