2014-12-30 14:24:52 -05:00
|
|
|
|
// Copyright 2014 The Crashpad Authors. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
|
//
|
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
//
|
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
|
|
#ifndef CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_
|
|
|
|
|
#define CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_
|
|
|
|
|
|
2015-03-12 14:28:19 -04:00
|
|
|
|
#include <map>
|
2019-09-09 14:07:42 -07:00
|
|
|
|
#include <set>
|
2014-12-30 14:24:52 -05:00
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2016-04-22 10:03:59 -07:00
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2014-12-30 14:24:52 -05:00
|
|
|
|
#include "base/files/file_path.h"
|
2016-01-06 12:22:50 -05:00
|
|
|
|
#include "base/macros.h"
|
2014-12-30 14:24:52 -05:00
|
|
|
|
#include "build/build_config.h"
|
2021-01-12 13:45:14 -08:00
|
|
|
|
#include "build/chromeos_buildflags.h"
|
2019-08-19 11:30:12 -07:00
|
|
|
|
#include "util/file/file_io.h"
|
2018-02-20 16:16:22 -08:00
|
|
|
|
#include "util/misc/capture_context.h"
|
2014-12-30 14:24:52 -05:00
|
|
|
|
|
2020-07-27 22:20:52 -04:00
|
|
|
|
#if defined(OS_APPLE)
|
2014-12-30 14:24:52 -05:00
|
|
|
|
#include "base/mac/scoped_mach_port.h"
|
2015-09-25 13:45:32 -07:00
|
|
|
|
#elif defined(OS_WIN)
|
|
|
|
|
#include <windows.h>
|
2016-10-21 13:08:18 -07:00
|
|
|
|
#include "util/win/scoped_handle.h"
|
2020-09-03 12:48:55 -06:00
|
|
|
|
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
2018-02-23 11:32:06 -08:00
|
|
|
|
#include <signal.h>
|
|
|
|
|
#include <ucontext.h>
|
2014-12-30 14:24:52 -05:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
namespace crashpad {
|
|
|
|
|
|
|
|
|
|
//! \brief The primary interface for an application to have Crashpad monitor
|
|
|
|
|
//! it for crashes.
|
|
|
|
|
class CrashpadClient {
|
|
|
|
|
public:
|
|
|
|
|
CrashpadClient();
|
|
|
|
|
~CrashpadClient();
|
|
|
|
|
|
|
|
|
|
//! \brief Starts a Crashpad handler process, performing any necessary
|
|
|
|
|
//! handshake to configure it.
|
|
|
|
|
//!
|
2016-11-07 09:01:20 -05:00
|
|
|
|
//! This method directs crashes to the Crashpad handler. On macOS, this is
|
|
|
|
|
//! applicable to this process and all subsequent child processes. On Windows,
|
|
|
|
|
//! child processes must also register by using SetHandlerIPCPipe().
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//!
|
2016-11-07 09:01:20 -05:00
|
|
|
|
//! On macOS, this method starts a Crashpad handler and obtains a Mach send
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! right corresponding to a receive right held by the handler process. The
|
|
|
|
|
//! handler process runs an exception server on this port. This method sets
|
|
|
|
|
//! the task’s exception port for `EXC_CRASH`, `EXC_RESOURCE`, and `EXC_GUARD`
|
|
|
|
|
//! exceptions to the Mach send right obtained. The handler will be installed
|
|
|
|
|
//! with behavior `EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES` and thread
|
|
|
|
|
//! state flavor `MACHINE_THREAD_STATE`. Exception ports are inherited, so a
|
|
|
|
|
//! Crashpad handler started here will remain the handler for any child
|
2016-11-07 09:01:20 -05:00
|
|
|
|
//! processes created after StartHandler() is called. These child processes do
|
|
|
|
|
//! not need to call StartHandler() or be aware of Crashpad in any way. The
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! Crashpad handler will receive crashes from child processes that have
|
|
|
|
|
//! inherited it as their exception handler even after the process that called
|
|
|
|
|
//! StartHandler() exits.
|
|
|
|
|
//!
|
|
|
|
|
//! On Windows, if \a asynchronous_start is `true`, this function will not
|
|
|
|
|
//! directly call `CreateProcess()`, making it suitable for use in a
|
|
|
|
|
//! `DllMain()`. In that case, the handler is started from a background
|
|
|
|
|
//! thread, deferring the handler's startup. Nevertheless, regardless of the
|
|
|
|
|
//! value of \a asynchronous_start, after calling this method, the global
|
|
|
|
|
//! unhandled exception filter is set up, and all crashes will be handled by
|
|
|
|
|
//! Crashpad. Optionally, use WaitForHandlerStart() to join with the
|
|
|
|
|
//! background thread and retrieve the status of handler startup.
|
2014-12-30 14:24:52 -05:00
|
|
|
|
//!
|
2018-05-04 12:20:52 -07:00
|
|
|
|
//! On Fuchsia, this method binds to the exception port of the current default
|
|
|
|
|
//! job, and starts a Crashpad handler to monitor that port.
|
|
|
|
|
//!
|
2019-05-01 22:19:21 -07:00
|
|
|
|
//! On Linux, this method starts a Crashpad handler, connected to this process
|
|
|
|
|
//! via an `AF_UNIX` socket pair and installs signal handlers to request crash
|
|
|
|
|
//! dumps on the client's socket end.
|
|
|
|
|
//!
|
2014-12-30 14:24:52 -05:00
|
|
|
|
//! \param[in] handler The path to a Crashpad handler executable.
|
2015-03-12 14:28:19 -04:00
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
2016-09-16 13:21:50 -07:00
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
2015-03-12 14:28:19 -04:00
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
2015-11-03 19:13:48 -05:00
|
|
|
|
//! \param[in] restartable If `true`, the handler will be restarted if it
|
|
|
|
|
//! dies, if this behavior is supported. This option is not available on
|
|
|
|
|
//! all platforms, and does not function on all OS versions. If it is
|
|
|
|
|
//! not supported, it will be ignored.
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! \param[out] asynchronous_start If `true`, the handler will be started from
|
|
|
|
|
//! a background thread. Optionally, WaitForHandlerStart() can be used at
|
|
|
|
|
//! a suitable time to retreive the result of background startup. This
|
|
|
|
|
//! option is only used on Windows.
|
2020-06-24 09:03:47 +02:00
|
|
|
|
//! \param[in] attachments Vector that stores file paths that should be
|
|
|
|
|
//! captured with each report at the time of the crash.
|
2014-12-30 14:24:52 -05:00
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
|
|
|
|
bool StartHandler(const base::FilePath& handler,
|
2015-03-12 14:28:19 -04:00
|
|
|
|
const base::FilePath& database,
|
2016-09-16 13:21:50 -07:00
|
|
|
|
const base::FilePath& metrics_dir,
|
2015-03-12 14:28:19 -04:00
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
2015-11-03 19:13:48 -05:00
|
|
|
|
const std::vector<std::string>& arguments,
|
2016-10-21 13:08:18 -07:00
|
|
|
|
bool restartable,
|
2020-06-24 09:03:47 +02:00
|
|
|
|
bool asynchronous_start,
|
|
|
|
|
const std::vector<base::FilePath>& attachments = {});
|
2014-12-30 14:24:52 -05:00
|
|
|
|
|
2020-09-03 12:48:55 -06:00
|
|
|
|
#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || DOXYGEN
|
2019-08-19 11:30:12 -07:00
|
|
|
|
//! \brief Retrieve the socket and process ID for the handler.
|
|
|
|
|
//!
|
|
|
|
|
//! `StartHandler()` must have successfully been called before calling this
|
|
|
|
|
//! method.
|
|
|
|
|
//!
|
2019-10-03 10:25:00 -07:00
|
|
|
|
//! \param[out] sock The socket connected to the handler, if not `nullptr`.
|
|
|
|
|
//! \param[out] pid The handler's process ID, if not `nullptr`.
|
2019-08-19 11:30:12 -07:00
|
|
|
|
//! \return `true` on success. Otherwise `false` with a message logged.
|
|
|
|
|
static bool GetHandlerSocket(int* sock, pid_t* pid);
|
|
|
|
|
|
|
|
|
|
//! \brief Sets the socket to a presumably-running Crashpad handler process
|
|
|
|
|
//! which was started with StartHandler().
|
|
|
|
|
//!
|
|
|
|
|
//! This method installs a signal handler to request crash dumps on \a sock.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] sock A socket connected to a Crashpad handler.
|
|
|
|
|
//! \param[in] pid The process ID of the handler, used to set the handler as
|
|
|
|
|
//! this process' ptracer. 0 indicates it is not necessary to set the
|
|
|
|
|
//! handler as this process' ptracer. -1 indicates that the handler's
|
|
|
|
|
//! process ID should be determined by communicating over the socket.
|
2019-09-09 14:07:42 -07:00
|
|
|
|
bool SetHandlerSocket(ScopedFileHandle sock, pid_t pid);
|
2020-07-15 11:26:08 -07:00
|
|
|
|
|
|
|
|
|
//! \brief Uses `sigaltstack()` to allocate a signal stack for the calling
|
|
|
|
|
//! thread.
|
|
|
|
|
//!
|
|
|
|
|
//! This method allocates an alternate stack to handle signals delivered to
|
|
|
|
|
//! the calling thread and should be called early in the lifetime of each
|
|
|
|
|
//! thread. Installing an alternate stack allows signals to be delivered in
|
|
|
|
|
//! the event that the call stack's stack pointer points to invalid memory,
|
|
|
|
|
//! as in the case of stack overflow.
|
|
|
|
|
//!
|
|
|
|
|
//! This method is called automatically by SetHandlerSocket() and
|
|
|
|
|
//! the various StartHandler() methods. It is harmless to call multiple times.
|
|
|
|
|
//! A new signal stack will be allocated only if there is no existing stack or
|
|
|
|
|
//! the existing stack is too small. The stack will be automatically freed
|
|
|
|
|
//! when the thread exits.
|
|
|
|
|
//!
|
|
|
|
|
//! An application might choose to diligently call this method from the start
|
|
|
|
|
//! routine for each thread, call it from a `pthread_create()` wrapper which
|
|
|
|
|
//! the application provides, or link the provided "client:pthread_create"
|
|
|
|
|
//! target.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success. Otherwise `false` with a message logged.
|
|
|
|
|
static bool InitializeSignalStackForThread();
|
2020-09-03 12:48:55 -06:00
|
|
|
|
#endif // OS_ANDROID || OS_LINUX || OS_CHROMEOS || DOXYGEN
|
2019-08-19 11:30:12 -07:00
|
|
|
|
|
2018-08-29 09:00:15 -07:00
|
|
|
|
#if defined(OS_ANDROID) || DOXYGEN
|
|
|
|
|
//! \brief Installs a signal handler to execute `/system/bin/app_process` and
|
|
|
|
|
//! load a Java class in response to a crash.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] class_name The fully qualified class name to load, which must
|
|
|
|
|
//! define a `main()` method to be invoked by `app_process`. Arguments
|
|
|
|
|
//! will be passed to this method as though it were the Crashpad handler.
|
|
|
|
|
//! This class is expected to load a native library defining
|
|
|
|
|
//! crashpad::HandlerMain() and pass the arguments to it.
|
|
|
|
|
//! \param[in] env A vector of environment variables of the form `var=value`
|
|
|
|
|
//! defining the environment in which to execute `app_process`. If this
|
|
|
|
|
//! value is `nullptr`, the application's environment at the time of the
|
|
|
|
|
//! crash will be used.
|
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
2019-09-09 14:07:42 -07:00
|
|
|
|
bool StartJavaHandlerAtCrash(
|
2018-08-29 09:00:15 -07:00
|
|
|
|
const std::string& class_name,
|
|
|
|
|
const std::vector<std::string>* env,
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const base::FilePath& metrics_dir,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
|
|
|
|
const std::vector<std::string>& arguments);
|
|
|
|
|
|
|
|
|
|
//! \brief Executes `/system/bin/app_process` and loads a Java class.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] class_name The fully qualified class name to load, which must
|
|
|
|
|
//! define a `main()` method to be invoked by `app_process`. Arguments
|
|
|
|
|
//! will be passed to this method as though it were the Crashpad handler.
|
|
|
|
|
//! This class is expected to load a native library defining
|
|
|
|
|
//! crashpad::HandlerMain() and pass the arguments to it.
|
|
|
|
|
//! \param[in] env A vector of environment variables of the form `var=value`
|
|
|
|
|
//! defining the environment in which to execute `app_process`. If this
|
|
|
|
|
//! value is `nullptr`, the application's current environment will be
|
|
|
|
|
//! used.
|
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
|
|
|
|
//! \param[in] socket The server end of a socket pair. The client end should
|
|
|
|
|
//! be used with an ExceptionHandlerClient.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
|
|
|
|
static bool StartJavaHandlerForClient(
|
|
|
|
|
const std::string& class_name,
|
|
|
|
|
const std::vector<std::string>* env,
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const base::FilePath& metrics_dir,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
|
|
|
|
const std::vector<std::string>& arguments,
|
|
|
|
|
int socket);
|
2019-02-21 17:26:25 -08:00
|
|
|
|
|
|
|
|
|
//! \brief Installs a signal handler to start a Crashpad handler process by
|
|
|
|
|
//! loading it with `/system/bin/linker`.
|
|
|
|
|
//!
|
|
|
|
|
//! This method is only supported by Android Q+.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] handler_trampoline The path to a Crashpad handler trampoline
|
|
|
|
|
//! executable, possibly located within an apk, e.g.
|
|
|
|
|
//! "/data/app/myapk.apk!/myabi/libcrashpad_handler_trampoline.so".
|
|
|
|
|
//! \param[in] handler_library The name of a library exporting the symbol
|
|
|
|
|
//! `CrashpadHandlerMain()`. The path to this library must be present in
|
|
|
|
|
//! `LD_LIBRARY_PATH`.
|
|
|
|
|
//! \param[in] is_64_bit `true` if \a handler_trampoline and \a
|
|
|
|
|
//! handler_library are 64-bit objects. They must have the same bitness.
|
|
|
|
|
//! \param[in] env A vector of environment variables of the form `var=value`
|
|
|
|
|
//! defining the environment in which to execute `app_process`. If this
|
|
|
|
|
//! value is `nullptr`, the application's environment at the time of the
|
|
|
|
|
//! crash will be used.
|
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
2019-09-09 14:07:42 -07:00
|
|
|
|
bool StartHandlerWithLinkerAtCrash(
|
2019-02-21 17:26:25 -08:00
|
|
|
|
const std::string& handler_trampoline,
|
|
|
|
|
const std::string& handler_library,
|
|
|
|
|
bool is_64_bit,
|
|
|
|
|
const std::vector<std::string>* env,
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const base::FilePath& metrics_dir,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
|
|
|
|
const std::vector<std::string>& arguments);
|
|
|
|
|
|
|
|
|
|
//! \brief Starts a Crashpad handler process with an initial client by loading
|
|
|
|
|
//! it with `/system/bin/linker`.
|
|
|
|
|
//!
|
|
|
|
|
//! This method is only supported by Android Q+.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] handler_trampoline The path to a Crashpad handler trampoline
|
|
|
|
|
//! executable, possibly located within an apk, e.g.
|
|
|
|
|
//! "/data/app/myapk.apk!/myabi/libcrashpad_handler_trampoline.so".
|
|
|
|
|
//! \param[in] handler_library The name of a library exporting the symbol
|
|
|
|
|
//! `CrashpadHandlerMain()`. The path to this library must be present in
|
|
|
|
|
//! `LD_LIBRARY_PATH`.
|
|
|
|
|
//! \param[in] is_64_bit `true` if \a handler_trampoline and \a
|
|
|
|
|
//! handler_library are 64-bit objects. They must have the same bitness.
|
|
|
|
|
//! \param[in] env A vector of environment variables of the form `var=value`
|
|
|
|
|
//! defining the environment in which to execute `app_process`. If this
|
|
|
|
|
//! value is `nullptr`, the application's current environment will be
|
|
|
|
|
//! used.
|
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
|
|
|
|
//! \param[in] socket The server end of a socket pair. The client end should
|
|
|
|
|
//! be used with an ExceptionHandlerClient.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
|
|
|
|
static bool StartHandlerWithLinkerForClient(
|
|
|
|
|
const std::string& handler_trampoline,
|
|
|
|
|
const std::string& handler_library,
|
|
|
|
|
bool is_64_bit,
|
|
|
|
|
const std::vector<std::string>* env,
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const base::FilePath& metrics_dir,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
|
|
|
|
const std::vector<std::string>& arguments,
|
|
|
|
|
int socket);
|
2018-08-29 09:00:15 -07:00
|
|
|
|
#endif // OS_ANDROID || DOXYGEN
|
|
|
|
|
|
2020-09-03 12:48:55 -06:00
|
|
|
|
#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_CHROMEOS) || DOXYGEN
|
2018-02-01 10:39:32 -08:00
|
|
|
|
//! \brief Installs a signal handler to launch a handler process in reponse to
|
|
|
|
|
//! a crash.
|
|
|
|
|
//!
|
|
|
|
|
//! The handler process will create a crash dump for this process and exit.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] handler The path to a Crashpad handler executable.
|
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
2019-09-09 14:07:42 -07:00
|
|
|
|
bool StartHandlerAtCrash(
|
2018-02-01 10:39:32 -08:00
|
|
|
|
const base::FilePath& handler,
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const base::FilePath& metrics_dir,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
2020-06-24 09:03:47 +02:00
|
|
|
|
const std::vector<std::string>& arguments,
|
|
|
|
|
const std::vector<base::FilePath>& attachments = {});
|
2018-02-01 10:39:32 -08:00
|
|
|
|
|
|
|
|
|
//! \brief Starts a handler process with an initial client.
|
|
|
|
|
//!
|
|
|
|
|
//! This method allows a process to launch the handler process on behalf of
|
|
|
|
|
//! another process.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] handler The path to a Crashpad handler executable.
|
|
|
|
|
//! \param[in] database The path to a Crashpad database. The handler will be
|
|
|
|
|
//! started with this path as its `--database` argument.
|
|
|
|
|
//! \param[in] metrics_dir The path to an already existing directory where
|
|
|
|
|
//! metrics files can be stored. The handler will be started with this
|
|
|
|
|
//! path as its `--metrics-dir` argument.
|
|
|
|
|
//! \param[in] url The URL of an upload server. The handler will be started
|
|
|
|
|
//! with this URL as its `--url` argument.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! The handler will be started with an `--annotation` argument for each
|
|
|
|
|
//! element in this map.
|
|
|
|
|
//! \param[in] arguments Additional arguments to pass to the Crashpad handler.
|
|
|
|
|
//! Arguments passed in other parameters and arguments required to perform
|
|
|
|
|
//! the handshake are the responsibility of this method, and must not be
|
|
|
|
|
//! specified in this parameter.
|
|
|
|
|
//! \param[in] socket The server end of a socket pair. The client end should
|
|
|
|
|
//! be used with an ExceptionHandlerClient.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
2018-03-16 10:52:55 -07:00
|
|
|
|
static bool StartHandlerForClient(
|
2018-02-01 10:39:32 -08:00
|
|
|
|
const base::FilePath& handler,
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const base::FilePath& metrics_dir,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations,
|
|
|
|
|
const std::vector<std::string>& arguments,
|
|
|
|
|
int socket);
|
2018-02-20 16:16:22 -08:00
|
|
|
|
|
|
|
|
|
//! \brief Requests that the handler capture a dump even though there hasn't
|
|
|
|
|
//! been a crash.
|
|
|
|
|
//!
|
2018-02-23 11:32:06 -08:00
|
|
|
|
//! A handler must have already been installed before calling this method.
|
|
|
|
|
//!
|
2018-02-20 16:16:22 -08:00
|
|
|
|
//! TODO(jperaza): Floating point information in the context is zeroed out
|
|
|
|
|
//! until CaptureContext() supports collecting that information.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] context A NativeCPUContext, generally captured by
|
|
|
|
|
//! CaptureContext() or similar.
|
|
|
|
|
static void DumpWithoutCrash(NativeCPUContext* context);
|
|
|
|
|
|
2018-10-02 15:19:32 -07:00
|
|
|
|
//! \brief Disables any installed crash handler, including any
|
|
|
|
|
//! FirstChanceHandler and crashes the current process.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] message A message to be logged before crashing.
|
|
|
|
|
static void CrashWithoutDump(const std::string& message);
|
|
|
|
|
|
2018-02-23 11:32:06 -08:00
|
|
|
|
//! \brief The type for custom handlers installed by clients.
|
|
|
|
|
using FirstChanceHandler = bool (*)(int, siginfo_t*, ucontext_t*);
|
|
|
|
|
|
|
|
|
|
//! \brief Installs a custom crash signal handler which runs before the
|
|
|
|
|
//! currently installed Crashpad handler.
|
|
|
|
|
//!
|
|
|
|
|
//! Handling signals appropriately can be tricky and use of this method
|
|
|
|
|
//! should be avoided, if possible.
|
|
|
|
|
//!
|
|
|
|
|
//! A handler must have already been installed before calling this method.
|
|
|
|
|
//!
|
|
|
|
|
//! The custom handler runs in a signal handler context and must be safe for
|
|
|
|
|
//! that purpose.
|
|
|
|
|
//!
|
|
|
|
|
//! If the custom handler returns `true`, the signal is considered handled and
|
|
|
|
|
//! the signal handler returns. Otherwise, the currently installed Crashpad
|
|
|
|
|
//! signal handler is run.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] handler The custom crash signal handler to install.
|
|
|
|
|
static void SetFirstChanceExceptionHandler(FirstChanceHandler handler);
|
|
|
|
|
|
2019-09-09 14:07:42 -07:00
|
|
|
|
//! \brief Configures a set of signals that shouldn't have Crashpad signal
|
|
|
|
|
//! handlers installed.
|
|
|
|
|
//!
|
|
|
|
|
//! This method should be called before calling StartHandler(),
|
|
|
|
|
//! SetHandlerSocket(), or other methods that install Crashpad signal
|
|
|
|
|
//! handlers.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] unhandled_signals The set of unhandled signals
|
|
|
|
|
void SetUnhandledSignals(const std::set<int>& unhandled_signals);
|
2020-09-03 12:48:55 -06:00
|
|
|
|
#endif // OS_LINUX || OS_ANDROID || OS_CHROMEOS || DOXYGEN
|
2018-02-01 10:39:32 -08:00
|
|
|
|
|
2020-02-18 14:49:10 -05:00
|
|
|
|
#if defined(OS_IOS) || DOXYGEN
|
|
|
|
|
//! \brief Configures the process to direct its crashes to the iOS in-process
|
|
|
|
|
//! Crashpad handler.
|
|
|
|
|
//!
|
|
|
|
|
//! This method is only defined on iOS.
|
|
|
|
|
//!
|
2021-02-02 09:02:28 -05:00
|
|
|
|
//! \param[in] database The path to a Crashpad database.
|
|
|
|
|
//! \param[in] url The URL of an upload server.
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
void StartCrashpadInProcessHandler(
|
|
|
|
|
const base::FilePath& database,
|
|
|
|
|
const std::string& url,
|
|
|
|
|
const std::map<std::string, std::string>& annotations);
|
2020-03-04 15:19:46 -05:00
|
|
|
|
|
2021-02-03 23:20:30 -05:00
|
|
|
|
//! \brief Requests that the handler convert intermediate dumps into
|
|
|
|
|
//! minidumps and trigger an upload if possible.
|
|
|
|
|
//!
|
|
|
|
|
//! A handler must have already been installed before calling this method.
|
|
|
|
|
//! This method should be called when an application is ready to start
|
2021-02-16 22:38:31 -05:00
|
|
|
|
//! processing previously created intermediate dumps. Processing will block,
|
|
|
|
|
//! so this should not be called on the main UI thread. No intermediate dumps
|
|
|
|
|
//! will be processed until this method is called.
|
2021-02-03 23:20:30 -05:00
|
|
|
|
//!
|
|
|
|
|
//! \param[in] annotations Process annotations to set in each crash report.
|
|
|
|
|
//! Useful when adding crash annotations detected on the next run after a
|
|
|
|
|
//! crash but before upload.
|
|
|
|
|
void ProcessIntermediateDumps(
|
|
|
|
|
const std::map<std::string, std::string>& annotations = {});
|
|
|
|
|
|
2021-02-16 22:38:31 -05:00
|
|
|
|
//! \brief Requests that the handler begin in-process uploading of any
|
|
|
|
|
//! pending reports.
|
|
|
|
|
//!
|
|
|
|
|
//! A handler must have already been installed before calling this method.
|
|
|
|
|
void EnableUploading();
|
|
|
|
|
|
2020-03-04 15:19:46 -05:00
|
|
|
|
// TODO(justincohen): This method is purely for bringing up iOS interfaces.
|
|
|
|
|
//! \brief Requests that the handler capture a dump even though there hasn't
|
|
|
|
|
//! been a crash.
|
|
|
|
|
//!
|
|
|
|
|
//! A handler must have already been installed before calling this method.
|
2020-04-25 17:16:10 -04:00
|
|
|
|
//!
|
|
|
|
|
//! \param[in] context A NativeCPUContext, generally captured by
|
|
|
|
|
//! CaptureContext() or similar.
|
|
|
|
|
static void DumpWithoutCrash(NativeCPUContext* context);
|
2020-02-18 14:49:10 -05:00
|
|
|
|
#endif
|
|
|
|
|
|
2020-07-27 22:20:52 -04:00
|
|
|
|
#if defined(OS_APPLE) || DOXYGEN
|
2015-11-03 19:20:29 -05:00
|
|
|
|
//! \brief Sets the process’ crash handler to a Mach service registered with
|
|
|
|
|
//! the bootstrap server.
|
|
|
|
|
//!
|
2016-11-07 09:01:20 -05:00
|
|
|
|
//! This method is only defined on macOS.
|
2015-11-03 19:20:29 -05:00
|
|
|
|
//!
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! See StartHandler() for more detail on how the port and handler are
|
|
|
|
|
//! configured.
|
|
|
|
|
//!
|
2015-11-03 19:20:29 -05:00
|
|
|
|
//! \param[in] service_name The service name of a Crashpad exception handler
|
|
|
|
|
//! service previously registered with the bootstrap server.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
|
|
|
|
bool SetHandlerMachService(const std::string& service_name);
|
|
|
|
|
|
|
|
|
|
//! \brief Sets the process’ crash handler to a Mach port.
|
|
|
|
|
//!
|
2016-11-07 09:01:20 -05:00
|
|
|
|
//! This method is only defined on macOS.
|
2015-11-03 19:20:29 -05:00
|
|
|
|
//!
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! See StartHandler() for more detail on how the port and handler are
|
|
|
|
|
//! configured.
|
|
|
|
|
//!
|
2015-11-03 19:20:29 -05:00
|
|
|
|
//! \param[in] exception_port An `exception_port_t` corresponding to a
|
|
|
|
|
//! Crashpad exception handler service.
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success, `false` on failure with a message logged.
|
|
|
|
|
bool SetHandlerMachPort(base::mac::ScopedMachSendRight exception_port);
|
2017-03-08 17:38:27 -05:00
|
|
|
|
|
|
|
|
|
//! \brief Retrieves a send right to the process’ crash handler Mach port.
|
|
|
|
|
//!
|
|
|
|
|
//! This method is only defined on macOS.
|
|
|
|
|
//!
|
|
|
|
|
//! This method can be used to obtain the crash handler Mach port when a
|
|
|
|
|
//! Crashpad client process wishes to provide a send right to this port to
|
|
|
|
|
//! another process. The IPC mechanism used to convey the right is under the
|
|
|
|
|
//! application’s control. If the other process wishes to become a client of
|
|
|
|
|
//! the same crash handler, it can provide the transferred right to
|
|
|
|
|
//! SetHandlerMachPort().
|
|
|
|
|
//!
|
|
|
|
|
//! See StartHandler() for more detail on how the port and handler are
|
|
|
|
|
//! configured.
|
|
|
|
|
//!
|
|
|
|
|
//! \return The Mach port set by SetHandlerMachPort(), possibly indirectly by
|
|
|
|
|
//! a call to another method such as StartHandler() or
|
|
|
|
|
//! SetHandlerMachService(). This method must only be called after a
|
|
|
|
|
//! successful call to one of those methods. `MACH_PORT_NULL` on failure
|
|
|
|
|
//! with a message logged.
|
|
|
|
|
base::mac::ScopedMachSendRight GetHandlerMachPort() const;
|
2015-11-03 19:20:29 -05:00
|
|
|
|
#endif
|
|
|
|
|
|
2015-04-29 18:53:47 -07:00
|
|
|
|
#if defined(OS_WIN) || DOXYGEN
|
2015-11-02 23:15:22 -05:00
|
|
|
|
//! \brief Sets the IPC pipe of a presumably-running Crashpad handler process
|
2015-04-29 18:53:47 -07:00
|
|
|
|
//! which was started with StartHandler() or by other compatible means
|
|
|
|
|
//! and does an IPC message exchange to register this process with the
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! handler. Crashes will be serviced once this method returns.
|
2015-04-29 18:53:47 -07:00
|
|
|
|
//!
|
2015-11-03 19:20:29 -05:00
|
|
|
|
//! This method is only defined on Windows.
|
|
|
|
|
//!
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! This method sets the unhandled exception handler to a local
|
|
|
|
|
//! function that when reached will "signal and wait" for the crash handler
|
|
|
|
|
//! process to create the dump.
|
|
|
|
|
//!
|
2015-11-02 17:00:06 -05:00
|
|
|
|
//! \param[in] ipc_pipe The full name of the crash handler IPC pipe. This is
|
|
|
|
|
//! a string of the form `"\\.\pipe\NAME"`.
|
2015-04-29 18:53:47 -07:00
|
|
|
|
//!
|
|
|
|
|
//! \return `true` on success and `false` on failure.
|
2015-11-02 17:00:06 -05:00
|
|
|
|
bool SetHandlerIPCPipe(const std::wstring& ipc_pipe);
|
2015-09-25 13:45:32 -07:00
|
|
|
|
|
2015-11-02 23:15:22 -05:00
|
|
|
|
//! \brief Retrieves the IPC pipe name used to register with the Crashpad
|
|
|
|
|
//! handler.
|
|
|
|
|
//!
|
2017-03-08 17:38:27 -05:00
|
|
|
|
//! This method is only defined on Windows.
|
|
|
|
|
//!
|
2015-11-02 23:15:22 -05:00
|
|
|
|
//! This method retrieves the IPC pipe name set by SetHandlerIPCPipe(), or a
|
2017-03-08 17:38:27 -05:00
|
|
|
|
//! suitable IPC pipe name chosen by StartHandler(). It must only be called
|
|
|
|
|
//! after a successful call to one of those methods. It is intended to be used
|
2015-11-02 23:15:22 -05:00
|
|
|
|
//! to obtain the IPC pipe name so that it may be passed to other processes,
|
|
|
|
|
//! so that they may register with an existing Crashpad handler by calling
|
|
|
|
|
//! SetHandlerIPCPipe().
|
|
|
|
|
//!
|
|
|
|
|
//! \return The full name of the crash handler IPC pipe, a string of the form
|
|
|
|
|
//! `"\\.\pipe\NAME"`.
|
|
|
|
|
std::wstring GetHandlerIPCPipe() const;
|
|
|
|
|
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! \brief When `asynchronous_start` is used with StartHandler(), this method
|
|
|
|
|
//! can be used to block until the handler launch has been completed to
|
|
|
|
|
//! retrieve status information.
|
|
|
|
|
//!
|
|
|
|
|
//! This method should not be used unless `asynchronous_start` was `true`.
|
|
|
|
|
//!
|
2016-12-12 20:57:48 -08:00
|
|
|
|
//! \param[in] timeout_ms The number of milliseconds to wait for a result from
|
|
|
|
|
//! the background launch, or `0xffffffff` to block indefinitely.
|
|
|
|
|
//!
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! \return `true` if the hander startup succeeded, `false` otherwise, and an
|
|
|
|
|
//! error message will have been logged.
|
2016-12-12 20:57:48 -08:00
|
|
|
|
bool WaitForHandlerStart(unsigned int timeout_ms);
|
2016-10-21 13:08:18 -07:00
|
|
|
|
|
2015-09-25 13:45:32 -07:00
|
|
|
|
//! \brief Requests that the handler capture a dump even though there hasn't
|
|
|
|
|
//! been a crash.
|
|
|
|
|
//!
|
2015-09-30 14:10:08 -04:00
|
|
|
|
//! \param[in] context A `CONTEXT`, generally captured by CaptureContext() or
|
|
|
|
|
//! similar.
|
2015-09-25 13:45:32 -07:00
|
|
|
|
static void DumpWithoutCrash(const CONTEXT& context);
|
2015-11-06 14:08:13 -08:00
|
|
|
|
|
|
|
|
|
//! \brief Requests that the handler capture a dump using the given \a
|
|
|
|
|
//! exception_pointers to get the `EXCEPTION_RECORD` and `CONTEXT`.
|
|
|
|
|
//!
|
|
|
|
|
//! This function is not necessary in general usage as an unhandled exception
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! filter is installed by StartHandler() or SetHandlerIPCPipe().
|
2015-11-06 14:08:13 -08:00
|
|
|
|
//!
|
|
|
|
|
//! \param[in] exception_pointers An `EXCEPTION_POINTERS`, as would generally
|
|
|
|
|
//! passed to an unhandled exception filter.
|
|
|
|
|
static void DumpAndCrash(EXCEPTION_POINTERS* exception_pointers);
|
2016-04-22 10:03:59 -07:00
|
|
|
|
|
|
|
|
|
//! \brief Requests that the handler capture a dump of a different process.
|
|
|
|
|
//!
|
|
|
|
|
//! The target process must be an already-registered Crashpad client. An
|
|
|
|
|
//! exception will be triggered in the target process, and the regular dump
|
|
|
|
|
//! mechanism used. This function will block until the exception in the target
|
|
|
|
|
//! process has been handled by the Crashpad handler.
|
|
|
|
|
//!
|
|
|
|
|
//! This function is unavailable when running on Windows XP and will return
|
|
|
|
|
//! `false`.
|
|
|
|
|
//!
|
|
|
|
|
//! \param[in] process A `HANDLE` identifying the process to be dumped.
|
|
|
|
|
//! \param[in] blame_thread If non-null, a `HANDLE` valid in the caller's
|
|
|
|
|
//! process, referring to a thread in the target process. If this is
|
|
|
|
|
//! supplied, instead of the exception referring to the location where the
|
|
|
|
|
//! exception was injected, an exception record will be fabricated that
|
|
|
|
|
//! refers to the current location of the given thread.
|
|
|
|
|
//! \param[in] exception_code If \a blame_thread is non-null, this will be
|
|
|
|
|
//! used as the exception code in the exception record.
|
|
|
|
|
//!
|
|
|
|
|
//! \return `true` if the exception was triggered successfully.
|
2018-02-02 12:47:44 -08:00
|
|
|
|
static bool DumpAndCrashTargetProcess(HANDLE process,
|
|
|
|
|
HANDLE blame_thread,
|
|
|
|
|
DWORD exception_code);
|
2016-04-22 10:03:59 -07:00
|
|
|
|
|
|
|
|
|
enum : uint32_t {
|
|
|
|
|
//! \brief The exception code (roughly "Client called") used when
|
|
|
|
|
//! DumpAndCrashTargetProcess() triggers an exception in a target
|
|
|
|
|
//! process.
|
|
|
|
|
//!
|
|
|
|
|
//! \note This value does not have any bits of the top nibble set, to avoid
|
|
|
|
|
//! confusion with real exception codes which tend to have those bits
|
|
|
|
|
//! set.
|
|
|
|
|
kTriggeredExceptionCode = 0xcca11ed,
|
|
|
|
|
};
|
2015-04-29 18:53:47 -07:00
|
|
|
|
#endif
|
|
|
|
|
|
2020-07-27 22:20:52 -04:00
|
|
|
|
#if defined(OS_APPLE) || DOXYGEN
|
2015-10-02 14:40:38 -04:00
|
|
|
|
//! \brief Configures the process to direct its crashes to the default handler
|
|
|
|
|
//! for the operating system.
|
|
|
|
|
//!
|
2016-11-07 09:01:20 -05:00
|
|
|
|
//! On macOS, this sets the task’s exception port as in SetHandlerMachPort(),
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! but the exception handler used is obtained from
|
|
|
|
|
//! SystemCrashReporterHandler(). If the system’s crash reporter handler
|
|
|
|
|
//! cannot be determined or set, the task’s exception ports for crash-type
|
|
|
|
|
//! exceptions are cleared.
|
2015-10-02 14:40:38 -04:00
|
|
|
|
//!
|
|
|
|
|
//! Use of this function is strongly discouraged.
|
|
|
|
|
//!
|
2015-10-05 17:12:04 -04:00
|
|
|
|
//! \warning After a call to this function, Crashpad will no longer monitor
|
2016-10-21 13:08:18 -07:00
|
|
|
|
//! the process for crashes until a subsequent call to
|
|
|
|
|
//! SetHandlerMachPort().
|
2015-10-02 14:40:38 -04:00
|
|
|
|
//!
|
|
|
|
|
//! \note This is provided as a static function to allow it to be used in
|
|
|
|
|
//! situations where a CrashpadClient object is not otherwise available.
|
|
|
|
|
//! This may be useful when a child process inherits its parent’s Crashpad
|
|
|
|
|
//! handler, but wants to sever this tie.
|
2015-10-05 17:12:04 -04:00
|
|
|
|
static void UseSystemDefaultHandler();
|
2015-10-02 14:40:38 -04:00
|
|
|
|
#endif
|
|
|
|
|
|
2021-01-12 13:45:14 -08:00
|
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
2019-08-19 15:43:02 -07:00
|
|
|
|
//! \brief Sets a timestamp on the signal handler to be passed on to
|
|
|
|
|
//! crashpad_handler and then eventually Chrome OS's crash_reporter.
|
|
|
|
|
//!
|
|
|
|
|
//! \note This method is used by clients that use `StartHandler()` to start
|
|
|
|
|
//! a handler and not by clients that use any other handler starting
|
|
|
|
|
//! methods.
|
|
|
|
|
static void SetCrashLoopBefore(uint64_t crash_loop_before_time);
|
|
|
|
|
#endif
|
|
|
|
|
|
2014-12-30 14:24:52 -05:00
|
|
|
|
private:
|
2020-07-27 22:20:52 -04:00
|
|
|
|
#if defined(OS_APPLE)
|
2017-03-08 17:38:27 -05:00
|
|
|
|
base::mac::ScopedMachSendRight exception_port_;
|
|
|
|
|
#elif defined(OS_WIN)
|
2015-11-02 17:00:06 -05:00
|
|
|
|
std::wstring ipc_pipe_;
|
2016-10-21 13:08:18 -07:00
|
|
|
|
ScopedKernelHANDLE handler_start_thread_;
|
2020-09-03 12:48:55 -06:00
|
|
|
|
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
2019-09-09 14:07:42 -07:00
|
|
|
|
std::set<int> unhandled_signals_;
|
2020-07-27 22:20:52 -04:00
|
|
|
|
#endif // OS_APPLE
|
2014-12-30 14:24:52 -05:00
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CrashpadClient);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace crashpad
|
|
|
|
|
|
|
|
|
|
#endif // CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_
|