From 240e28df2b886198ddd4d9b0c07f10cb38d7c1c7 Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Tue, 1 May 2018 12:21:38 -0700 Subject: [PATCH] Make run_with_crashpad buildable on Fuchsia too Exception handling in Zircon is very similar to Mach (https://fuchsia.googlesource.com/zircon/+/HEAD/docs/exceptions.md), so run_with_crashpad will be useful for testing. Bug: crashpad:196 Change-Id: Ib6956be284e92671c2e338a5056c18deb948daff Reviewed-on: https://chromium-review.googlesource.com/1036191 Commit-Queue: Scott Graham Reviewed-by: Joshua Peraza --- tools/BUILD.gn | 30 +++++++++++++++------------- tools/{mac => }/run_with_crashpad.cc | 0 tools/{mac => }/run_with_crashpad.md | 8 ++++---- tools/tools.gyp | 2 +- 4 files changed, 21 insertions(+), 19 deletions(-) rename tools/{mac => }/run_with_crashpad.cc (100%) rename tools/{mac => }/run_with_crashpad.md (93%) diff --git a/tools/BUILD.gn b/tools/BUILD.gn index a711bdf7..cd1e95f4 100644 --- a/tools/BUILD.gn +++ b/tools/BUILD.gn @@ -91,6 +91,22 @@ crashpad_executable("generate_dump") { } } +if (crashpad_is_mac || crashpad_is_fuchsia) { + crashpad_executable("run_with_crashpad") { + sources = [ + "run_with_crashpad.cc", + ] + + deps = [ + ":tool_support", + "../client", + "../compat", + "../third_party/mini_chromium:base", + "../util", + ] + } +} + if (crashpad_is_mac) { crashpad_executable("catch_exception_tool") { sources = [ @@ -147,18 +163,4 @@ if (crashpad_is_mac) { "../util", ] } - - crashpad_executable("run_with_crashpad") { - sources = [ - "mac/run_with_crashpad.cc", - ] - - deps = [ - ":tool_support", - "../client", - "../compat", - "../third_party/mini_chromium:base", - "../util", - ] - } } diff --git a/tools/mac/run_with_crashpad.cc b/tools/run_with_crashpad.cc similarity index 100% rename from tools/mac/run_with_crashpad.cc rename to tools/run_with_crashpad.cc diff --git a/tools/mac/run_with_crashpad.md b/tools/run_with_crashpad.md similarity index 93% rename from tools/mac/run_with_crashpad.md rename to tools/run_with_crashpad.md index c87cb150..9758f9af 100644 --- a/tools/mac/run_with_crashpad.md +++ b/tools/run_with_crashpad.md @@ -32,10 +32,10 @@ setting an exception port referencing the handler. Then, executes _COMMAND_ along with any arguments specified (_ARG…_) with the new exception port in effect. -The exception port is configured to receive exceptions of type `EXC_CRASH`, -`EXC_RESOURCE`, and `EXC_GUARD`. The exception behavior is configured as -`EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES`. The thread state flavor is -set to `MACHINE_THREAD_STATE`. +On macOS, the exception port is configured to receive exceptions of type +`EXC_CRASH`, `EXC_RESOURCE`, and `EXC_GUARD`. The exception behavior is +configured as `EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES`. The thread +state flavor is set to `MACHINE_THREAD_STATE`. Programs that use the Crashpad client library directly will not normally use this tool. This tool exists to allow programs that are unaware of Crashpad to be diff --git a/tools/tools.gyp b/tools/tools.gyp index 3639b531..d2ab29aa 100644 --- a/tools/tools.gyp +++ b/tools/tools.gyp @@ -200,7 +200,7 @@ '..', ], 'sources': [ - 'mac/run_with_crashpad.cc', + 'run_with_crashpad.cc', ], }, ],