Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2235)

Unified Diff: snapshot/mac/mach_o_image_reader.cc

Issue 997713002: Allow exception forwarding to the system’s native crash reporter to be disabled (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Remove unused function declaration Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/mac/mach_o_image_reader.h ('k') | snapshot/mac/mach_o_image_reader_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/mac/mach_o_image_reader.cc
diff --git a/snapshot/mac/mach_o_image_reader.cc b/snapshot/mac/mach_o_image_reader.cc
index 26f7138823b4057ee524b313a56ff33eb1a0c828..0f791e1b8ed43574921299d65ec6d2ed7ac6b673 100644
--- a/snapshot/mac/mach_o_image_reader.cc
+++ b/snapshot/mac/mach_o_image_reader.cc
@@ -23,6 +23,7 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
+#include "client/crashpad_info.h"
#include "snapshot/mac/mach_o_image_segment_reader.h"
#include "snapshot/mac/mach_o_image_symbol_table_reader.h"
#include "snapshot/mac/process_reader.h"
@@ -454,6 +455,39 @@ void MachOImageReader::UUID(crashpad::UUID* uuid) const {
memcpy(uuid, &uuid_, sizeof(uuid_));
}
+bool MachOImageReader::GetCrashpadInfo(
+ process_types::CrashpadInfo* crashpad_info) const {
+ INITIALIZATION_STATE_DCHECK_VALID(initialized_);
+
+ mach_vm_address_t crashpad_info_address;
+ const process_types::section* crashpad_info_section =
+ GetSectionByName(SEG_DATA, "__crashpad_info", &crashpad_info_address);
+ if (!crashpad_info_section) {
+ return false;
+ }
+
+ if (crashpad_info_section->size <
+ crashpad_info->ExpectedSize(process_reader_)) {
+ LOG(WARNING) << "small crashpad info section size "
+ << crashpad_info_section->size << module_info_;
+ return false;
+ }
+
+ if (!crashpad_info->Read(process_reader_, crashpad_info_address)) {
+ LOG(WARNING) << "could not read crashpad info" << module_info_;
+ return false;
+ }
+
+ if (crashpad_info->signature != CrashpadInfo::kSignature ||
+ crashpad_info->size != crashpad_info_section->size ||
+ crashpad_info->version < 1) {
+ LOG(WARNING) << "unexpected crashpad info data" << module_info_;
+ return false;
+ }
+
+ return true;
+}
+
template <typename T>
bool MachOImageReader::ReadLoadCommand(mach_vm_address_t load_command_address,
const std::string& load_command_info,
« no previous file with comments | « snapshot/mac/mach_o_image_reader.h ('k') | snapshot/mac/mach_o_image_reader_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698