Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: src/processor/exploitability_linux.cc

Issue 1210943005: Use general instruction/stack pointer convenience method instead of manually (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/processor/dump_context.cc ('k') | src/processor/exploitability_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/processor/dump_context.cc ('k') | src/processor/exploitability_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698