From 52935b4e812f413beaf294b24e5677c0324f98b6 Mon Sep 17 00:00:00 2001 From: "ted.mielczarek@gmail.com" Date: Mon, 17 Sep 2012 14:01:28 +0000 Subject: 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 --- .../linux/handler/exception_handler_unittest.cc | 45 ++-------------------- 1 file changed, 3 insertions(+), 42 deletions(-) (limited to 'src/client/linux') 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); -- cgit v1.2.1