From 83247fda6010d3507aa1dc65926d5c77fc97defc Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Thu, 28 Jan 2016 12:24:51 -0800 Subject: [PATCH] Fix Mac after af3dc54f CrashpadInfo not being initialized/propagated properly on Mac. Change-Id: I5f33a16e4e18bb1b068e0d4aeb7f2032a6cb6278 Reviewed-on: https://chromium-review.googlesource.com/324500 Reviewed-by: Mark Mentovai --- snapshot/mac/module_snapshot_mac.cc | 5 +++++ snapshot/mac/process_snapshot_mac.cc | 3 ++- snapshot/mac/process_types/crashpad_info.proctype | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/snapshot/mac/module_snapshot_mac.cc b/snapshot/mac/module_snapshot_mac.cc index 64f04dce..dd9e8097 100644 --- a/snapshot/mac/module_snapshot_mac.cc +++ b/snapshot/mac/module_snapshot_mac.cc @@ -64,6 +64,7 @@ void ModuleSnapshotMac::GetCrashpadOptions(CrashpadInfoClientOptions* options) { if (!mach_o_image_reader_->GetCrashpadInfo(&crashpad_info)) { options->crashpad_handler_behavior = TriState::kUnset; options->system_crash_reporter_forwarding = TriState::kUnset; + options->gather_indirectly_referenced_memory = TriState::kUnset; return; } @@ -74,6 +75,10 @@ void ModuleSnapshotMac::GetCrashpadOptions(CrashpadInfoClientOptions* options) { options->system_crash_reporter_forwarding = CrashpadInfoClientOptions::TriStateFromCrashpadInfo( crashpad_info.system_crash_reporter_forwarding); + + options->gather_indirectly_referenced_memory = + CrashpadInfoClientOptions::TriStateFromCrashpadInfo( + crashpad_info.gather_indirectly_referenced_memory); } std::string ModuleSnapshotMac::Name() const { diff --git a/snapshot/mac/process_snapshot_mac.cc b/snapshot/mac/process_snapshot_mac.cc index 0e4b3d3b..3d44e935 100644 --- a/snapshot/mac/process_snapshot_mac.cc +++ b/snapshot/mac/process_snapshot_mac.cc @@ -112,7 +112,8 @@ void ProcessSnapshotMac::GetCrashpadOptions( // If non-default values have been found for all options, the loop can end // early. if (local_options.crashpad_handler_behavior != TriState::kUnset && - local_options.system_crash_reporter_forwarding != TriState::kUnset) { + local_options.system_crash_reporter_forwarding != TriState::kUnset && + local_options.gather_indirectly_referenced_memory != TriState::kUnset) { break; } } diff --git a/snapshot/mac/process_types/crashpad_info.proctype b/snapshot/mac/process_types/crashpad_info.proctype index cdc8247f..af30d951 100644 --- a/snapshot/mac/process_types/crashpad_info.proctype +++ b/snapshot/mac/process_types/crashpad_info.proctype @@ -32,7 +32,10 @@ PROCESS_TYPE_STRUCT_BEGIN(CrashpadInfo) // TriState PROCESS_TYPE_STRUCT_MEMBER(uint8_t, system_crash_reporter_forwarding) - PROCESS_TYPE_STRUCT_MEMBER(uint16_t, padding_0) + // TriState + PROCESS_TYPE_STRUCT_MEMBER(uint8_t, gather_indirectly_referenced_memory) + + PROCESS_TYPE_STRUCT_MEMBER(uint8_t, padding_0) // SimpleStringDictionary* PROCESS_TYPE_STRUCT_MEMBER(Pointer, simple_annotations)