aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac
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/mac
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/mac')
-rw-r--r--src/client/mac/tests/exception_handler_test.cc45
1 files changed, 3 insertions, 42 deletions
diff --git a/src/client/mac/tests/exception_handler_test.cc b/src/client/mac/tests/exception_handler_test.cc
index ee3ffa5b..8325d44e 100644
--- a/src/client/mac/tests/exception_handler_test.cc
+++ b/src/client/mac/tests/exception_handler_test.cc
@@ -347,20 +347,7 @@ TEST_F(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);
@@ -459,20 +446,7 @@ TEST_F(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);
@@ -571,20 +545,7 @@ TEST_F(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);