diff options
Diffstat (limited to 'src/processor/microdump.cc')
-rw-r--r-- | src/processor/microdump.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc index b100f765..13e261b4 100644 --- a/src/processor/microdump.cc +++ b/src/processor/microdump.cc @@ -44,6 +44,7 @@ #include "google_breakpad/common/minidump_cpu_arm.h" #include "google_breakpad/processor/code_module.h" #include "processor/basic_code_module.h" +#include "processor/convert_old_arm64_context.h" #include "processor/linked_ptr.h" #include "processor/logging.h" #include "processor/range_map-inl.h" @@ -125,8 +126,8 @@ void MicrodumpContext::SetContextARM(MDRawContextARM* arm) { valid_ = true; } -void MicrodumpContext::SetContextARM64(MDRawContextARM64_Old* arm64) { - DumpContext::SetContextFlags(MD_CONTEXT_ARM64_OLD); +void MicrodumpContext::SetContextARM64(MDRawContextARM64* arm64) { + DumpContext::SetContextFlags(MD_CONTEXT_ARM64); DumpContext::SetContextARM64(arm64); valid_ = true; } @@ -311,15 +312,22 @@ Microdump::Microdump(const string& contents) memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size()); context_->SetContextARM(arm); } else if (strcmp(arch.c_str(), kArm64Architecture) == 0) { - if (cpu_state_raw.size() != sizeof(MDRawContextARM64_Old)) { + if (cpu_state_raw.size() == sizeof(MDRawContextARM64)) { + MDRawContextARM64* arm = new MDRawContextARM64(); + memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size()); + context_->SetContextARM64(arm); + } else if (cpu_state_raw.size() == sizeof(MDRawContextARM64_Old)) { + MDRawContextARM64_Old old_arm; + memcpy(&old_arm, &cpu_state_raw[0], cpu_state_raw.size()); + MDRawContextARM64* new_arm = new MDRawContextARM64(); + ConvertOldARM64Context(old_arm, new_arm); + context_->SetContextARM64(new_arm); + } else { std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() - << " bytes instead of " << sizeof(MDRawContextARM64_Old) + << " bytes instead of " << sizeof(MDRawContextARM64) << std::endl; continue; } - MDRawContextARM64_Old* arm = new MDRawContextARM64_Old(); - memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size()); - context_->SetContextARM64(arm); } else if (strcmp(arch.c_str(), kX86Architecture) == 0) { if (cpu_state_raw.size() != sizeof(MDRawContextX86)) { std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size() |