diff options
Diffstat (limited to 'src/client/mac/tests')
-rw-r--r-- | src/client/mac/tests/exception_handler_test.cc | 45 |
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); |