Use general instruction/stack pointer convenience method instead of manually
finding the instruction/stack pointer for exploitability rating. There was already a method that found the instruction pointer, so the files for exploitability ratings had repeated code. Also a method for finding the stack pointer is implemented in this CL. R=ivanpe@chromium.org Review URL: https://codereview.chromium.org/1210943005 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1468 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
@@ -37,8 +37,8 @@
|
||||
#include "processor/exploitability_linux.h"
|
||||
|
||||
#include "google_breakpad/common/minidump_exception_linux.h"
|
||||
#include "google_breakpad/processor/process_state.h"
|
||||
#include "google_breakpad/processor/call_stack.h"
|
||||
#include "google_breakpad/processor/process_state.h"
|
||||
#include "google_breakpad/processor/stack_frame.h"
|
||||
#include "processor/logging.h"
|
||||
|
||||
@@ -98,26 +98,9 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user