aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux
diff options
context:
space:
mode:
authorted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-09-17 14:01:28 +0000
committerted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-09-17 14:01:28 +0000
commit52935b4e812f413beaf294b24e5677c0324f98b6 (patch)
tree69bafaa55473940b8568f001ea068fde445a5452 /src/client/linux
parentMake my_str_len/my_itos take uintmax_t (diff)
downloadbreakpad-52935b4e812f413beaf294b24e5677c0324f98b6.tar.xz
Add a GetInstructionPointer method to MinidumpException
R=mark at https://breakpad.appspot.com/444003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1039 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux')
-rw-r--r--src/client/linux/handler/exception_handler_unittest.cc45
1 files changed, 3 insertions, 42 deletions
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc
index 83af35d5..6de9b8d4 100644
--- a/src/client/linux/handler/exception_handler_unittest.cc
+++ b/src/client/linux/handler/exception_handler_unittest.cc
@@ -450,20 +450,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemory) {
ASSERT_TRUE(context);
u_int64_t instruction_pointer;
- switch (context->GetContextCPU()) {
- case MD_CONTEXT_X86:
- instruction_pointer = context->GetContextX86()->eip;
- break;
- case MD_CONTEXT_AMD64:
- instruction_pointer = context->GetContextAMD64()->rip;
- break;
- case MD_CONTEXT_ARM:
- instruction_pointer = context->GetContextARM()->iregs[15];
- break;
- default:
- FAIL() << "Unknown context CPU: " << context->GetContextCPU();
- break;
- }
+ ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
MinidumpMemoryRegion* region =
memory_list->GetMemoryRegionForAddress(instruction_pointer);
@@ -555,20 +542,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) {
ASSERT_TRUE(context);
u_int64_t instruction_pointer;
- switch (context->GetContextCPU()) {
- case MD_CONTEXT_X86:
- instruction_pointer = context->GetContextX86()->eip;
- break;
- case MD_CONTEXT_AMD64:
- instruction_pointer = context->GetContextAMD64()->rip;
- break;
- case MD_CONTEXT_ARM:
- instruction_pointer = context->GetContextARM()->iregs[15];
- break;
- default:
- FAIL() << "Unknown context CPU: " << context->GetContextCPU();
- break;
- }
+ ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
MinidumpMemoryRegion* region =
memory_list->GetMemoryRegionForAddress(instruction_pointer);
@@ -658,20 +632,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
ASSERT_TRUE(context);
u_int64_t instruction_pointer;
- switch (context->GetContextCPU()) {
- case MD_CONTEXT_X86:
- instruction_pointer = context->GetContextX86()->eip;
- break;
- case MD_CONTEXT_AMD64:
- instruction_pointer = context->GetContextAMD64()->rip;
- break;
- case MD_CONTEXT_ARM:
- instruction_pointer = context->GetContextARM()->iregs[15];
- break;
- default:
- FAIL() << "Unknown context CPU: " << context->GetContextCPU();
- break;
- }
+ ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
MinidumpMemoryRegion* region =
memory_list->GetMemoryRegionForAddress(instruction_pointer);