mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-20 02:23:47 +00:00
mac: Add --use-system-default-handler option to crashpad_handler
This is a weird option that causes crashpad_handler to discard the crash handler it inherited and replace it with the system default. Its use is not recommended. BUG=chromium:538373 R=rsesek@chromium.org Review URL: https://codereview.chromium.org/1391463002 .
This commit is contained in:
parent
c95b30464a
commit
08e5e10167
@ -82,6 +82,13 @@ Listen on the given pipe name for connections from clients. 'PIPE' must be of
|
|||||||
the form +\\.\pipe\<somename>+. This option is required. This option is only
|
the form +\\.\pipe\<somename>+. This option is required. This option is only
|
||||||
valid on Windows.
|
valid on Windows.
|
||||||
|
|
||||||
|
*--reset-own-crash-exception-port-to-system-default*::
|
||||||
|
Causes the exception handler server to set its own crash handler to the system
|
||||||
|
default before beginning operation. This is only expected to be useful in cases
|
||||||
|
where the server inherits an inappropriate crash handler from its parent
|
||||||
|
process. This option is only valid on OS X. Use of this option is discouraged.
|
||||||
|
It should not be used absent extraordinary circumstances.
|
||||||
|
|
||||||
*--url*='URL'::
|
*--url*='URL'::
|
||||||
If uploads are enabled, sends crash reports to the Breakpad-type crash report
|
If uploads are enabled, sends crash reports to the Breakpad-type crash report
|
||||||
collection server at 'URL'. Uploads are disabled by default, and can only be
|
collection server at 'URL'. Uploads are disabled by default, and can only be
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
|
#include "client/crashpad_client.h"
|
||||||
#include "tools/tool_support.h"
|
#include "tools/tool_support.h"
|
||||||
#include "handler/crash_report_upload_thread.h"
|
#include "handler/crash_report_upload_thread.h"
|
||||||
#include "util/stdlib/map_insert.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"
|
" --database=PATH store the crash report database at PATH\n"
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
" --handshake-fd=FD establish communication with the client over FD\n"
|
" --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)
|
#elif defined(OS_WIN)
|
||||||
" --pipe-name=PIPE communicate with the client over PIPE\n"
|
" --pipe-name=PIPE communicate with the client over PIPE\n"
|
||||||
#endif // OS_MACOSX
|
#endif // OS_MACOSX
|
||||||
@ -78,6 +81,7 @@ int HandlerMain(int argc, char* argv[]) {
|
|||||||
kOptionDatabase,
|
kOptionDatabase,
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
kOptionHandshakeFD,
|
kOptionHandshakeFD,
|
||||||
|
kOptionResetOwnCrashExceptionPortToSystemDefault,
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
kOptionPipeName,
|
kOptionPipeName,
|
||||||
#endif // OS_MACOSX
|
#endif // OS_MACOSX
|
||||||
@ -94,12 +98,14 @@ int HandlerMain(int argc, char* argv[]) {
|
|||||||
const char* database;
|
const char* database;
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
int handshake_fd;
|
int handshake_fd;
|
||||||
|
bool reset_own_crash_exception_port_to_system_default;
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
std::string pipe_name;
|
std::string pipe_name;
|
||||||
#endif
|
#endif
|
||||||
} options = {};
|
} options = {};
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
options.handshake_fd = -1;
|
options.handshake_fd = -1;
|
||||||
|
options.reset_own_crash_exception_port_to_system_default = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const option long_options[] = {
|
const option long_options[] = {
|
||||||
@ -107,6 +113,10 @@ int HandlerMain(int argc, char* argv[]) {
|
|||||||
{"database", required_argument, nullptr, kOptionDatabase},
|
{"database", required_argument, nullptr, kOptionDatabase},
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
{"handshake-fd", required_argument, nullptr, kOptionHandshakeFD},
|
{"handshake-fd", required_argument, nullptr, kOptionHandshakeFD},
|
||||||
|
{"reset-own-crash-exception-port-to-system-default",
|
||||||
|
no_argument,
|
||||||
|
nullptr,
|
||||||
|
kOptionResetOwnCrashExceptionPortToSystemDefault},
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
{"pipe-name", required_argument, nullptr, kOptionPipeName},
|
{"pipe-name", required_argument, nullptr, kOptionPipeName},
|
||||||
#endif
|
#endif
|
||||||
@ -147,6 +157,10 @@ int HandlerMain(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case kOptionResetOwnCrashExceptionPortToSystemDefault: {
|
||||||
|
options.reset_own_crash_exception_port_to_system_default = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
case kOptionPipeName: {
|
case kOptionPipeName: {
|
||||||
options.pipe_name = optarg;
|
options.pipe_name = optarg;
|
||||||
@ -196,6 +210,12 @@ int HandlerMain(int argc, char* argv[]) {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
|
if (options.reset_own_crash_exception_port_to_system_default) {
|
||||||
|
CrashpadClient::UseSystemDefaultHandler();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ExceptionHandlerServer exception_handler_server;
|
ExceptionHandlerServer exception_handler_server;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user