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

Unified Diff: handler/main.cc

Issue 1391463002: mac: Add --use-system-default-handler option to crashpad_handler (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: For checkin Created 5 years, 2 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 | « handler/crashpad_handler.ad ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/main.cc
diff --git a/handler/main.cc b/handler/main.cc
index 0f3c3643498a1dae93679517dc2e9f071fb092a0..261808c915edbbb8a96dbfb5d49b546be4b8620a 100644
--- a/handler/main.cc
+++ b/handler/main.cc
@@ -24,6 +24,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "client/crash_report_database.h"
+#include "client/crashpad_client.h"
#include "tools/tool_support.h"
#include "handler/crash_report_upload_thread.h"
#include "util/stdlib/map_insert.h"
@@ -55,6 +56,8 @@ void Usage(const base::FilePath& me) {
" --database=PATH store the crash report database at PATH\n"
#if defined(OS_MACOSX)
" --handshake-fd=FD establish communication with the client over FD\n"
+" --reset-own-crash-exception-port-to-system-default\n"
+" reset the server's exception handler to default\n"
#elif defined(OS_WIN)
" --pipe-name=PIPE communicate with the client over PIPE\n"
#endif // OS_MACOSX
@@ -78,6 +81,7 @@ int HandlerMain(int argc, char* argv[]) {
kOptionDatabase,
#if defined(OS_MACOSX)
kOptionHandshakeFD,
+ kOptionResetOwnCrashExceptionPortToSystemDefault,
#elif defined(OS_WIN)
kOptionPipeName,
#endif // OS_MACOSX
@@ -94,12 +98,14 @@ int HandlerMain(int argc, char* argv[]) {
const char* database;
#if defined(OS_MACOSX)
int handshake_fd;
+ bool reset_own_crash_exception_port_to_system_default;
#elif defined(OS_WIN)
std::string pipe_name;
#endif
} options = {};
#if defined(OS_MACOSX)
options.handshake_fd = -1;
+ options.reset_own_crash_exception_port_to_system_default = false;
#endif
const option long_options[] = {
@@ -107,6 +113,10 @@ int HandlerMain(int argc, char* argv[]) {
{"database", required_argument, nullptr, kOptionDatabase},
#if defined(OS_MACOSX)
{"handshake-fd", required_argument, nullptr, kOptionHandshakeFD},
+ {"reset-own-crash-exception-port-to-system-default",
+ no_argument,
+ nullptr,
+ kOptionResetOwnCrashExceptionPortToSystemDefault},
#elif defined(OS_WIN)
{"pipe-name", required_argument, nullptr, kOptionPipeName},
#endif
@@ -147,6 +157,10 @@ int HandlerMain(int argc, char* argv[]) {
}
break;
}
+ case kOptionResetOwnCrashExceptionPortToSystemDefault: {
+ options.reset_own_crash_exception_port_to_system_default = true;
+ break;
+ }
#elif defined(OS_WIN)
case kOptionPipeName: {
options.pipe_name = optarg;
@@ -196,6 +210,12 @@ int HandlerMain(int argc, char* argv[]) {
return EXIT_FAILURE;
}
+#if defined(OS_MACOSX)
+ if (options.reset_own_crash_exception_port_to_system_default) {
+ CrashpadClient::UseSystemDefaultHandler();
+ }
+#endif
+
ExceptionHandlerServer exception_handler_server;
#if defined(OS_MACOSX)
« no previous file with comments | « handler/crashpad_handler.ad ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698