// 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_
#include <map>
#include <set>
#include <string>
#include <vector>
#include <stdint.h>
#include "base/files/file_path.h"
#include "base/macros.h"
#include "build/build_config.h"
#include "util/file/file_io.h"
#include "util/misc/capture_context.h"
#if defined(OS_APPLE)
#include "base/mac/scoped_mach_port.h"
#elif defined(OS_WIN)
#include <windows.h>
#include "util/win/scoped_handle.h"
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
#include <signal.h>
#include <ucontext.h>
#endif
namespace crashpad {
#if defined(OS_WIN)
void IgnoreNextException(bool value);
#endif
//! \brief The primary interface for an application to have Crashpad monitor
//! it for crashes.
class CrashpadClient {
public:
CrashpadClient();
~CrashpadClient();
#if defined(OS_WIN)
bool StartHandlerForBacktrace(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,
const std::map<std::string, std::string>& fileAttachments,
bool restartable,
bool asynchronous_start);
#endif
//! \brief Starts a Crashpad handler process, performing any necessary
//! handshake to configure it.
//!
//! 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().
//!
//! On macOS, this method starts a Crashpad handler and obtains a Mach send
//! 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
//! processes created after StartHandler() is called. These child processes do
//! not need to call StartHandler() or be aware of Crashpad in any way. The
//! 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.
//!
//! On Fuchsia, this method binds to the exception port of the current default
//! job, and starts a Crashpad handler to monitor that port.
//!
//! 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.
//!
//! \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] 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.
//! \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.
//! \param[in] attachments Vector that stores file paths that should be
//! captured with each report at the time of the crash.
//!
//! \return `true` on success, `false` on failure with a message logged.
bool StartHandler(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,
bool restartable,
bool asynchronous_start,
const std::vector<base::FilePath>& attachments = {});
#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || DOXYGEN
//! \brief Retrieve the socket and process ID for the handler.
//!
//! `StartHandler()` must have successfully been called before calling this
//! method.
//!
//! \param[out] sock The socket connected to the handler, if not `nullptr`.
//! \param[out] pid The handler's process ID, if not `nullptr`.
//! \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.
bool SetHandlerSocket(ScopedFileHandle sock, pid_t pid);
//! \brief Uses `sigaltstack()` to allocate a signal stack for the calling
//! thread.
//!
//! This method allocates an alte
没有合适的资源?快使用搜索试试~ 我知道了~
编译好的Crashpad库
release-x86
debug-x86
release-x86-64
debug-x86-64
内容概要
本资源包含经过编译的Crashpad库,支持x86和x64架构,提供Release和Debug两种版本。Crashpad是一个跨平台的崩溃报告系统,用于捕获和报告应用程序的崩溃信息,以便开发人员能够及时分析和修复问题。
适用人群
软件开发人员
系统工程师
质量保证(QA)团队
需要崩溃报告功能的应用程序开发者
使用场景及目标
用于开发和维护高可靠性的软件系统
集成到现有的项目中,捕获应用程序崩溃信息
帮助开发人员快速定位和修复崩溃问题,提升软件质量
适用于需要详细调试信息的开发环境和需要高性能的发布环境
其他说明
本资源包含详细的使用说明和集成指南
提供示例代码以帮助用户快速上手
适用于Windows操作系统
包含相关的依赖库和头文件,方便直接使用
希望这些信息能够帮助您在CSDN上成功上传和分享编译好的Crashpad库。
收起资源包目录
编译好的Crashpad库 (x86 & x64) - Release & Debug 版本 (1116个子文件)
crashpad_handler.com 3.96MB
crashpad_handler.com 3.04MB
crashpad_handler.com 795KB
crashpad_handler.com 609KB
crashpad_handler.exe 3.96MB
crashpad_handler.exe 3.04MB
crashpad_database_util.exe 2.19MB
crashpad_http_upload.exe 2.04MB
crashpad_database_util.exe 1.68MB
crashpad_http_upload.exe 1.56MB
crashpad_handler.exe 795KB
crashpad_handler.exe 674KB
crashpad_database_util.exe 394KB
crashpad_database_util.exe 370KB
crashpad_http_upload.exe 365KB
crashpad_http_upload.exe 353KB
crashpad_client.h 38KB
crashpad_client.h 38KB
crashpad_client.h 38KB
crashpad_client.h 38KB
safe_conversions_impl.h 34KB
safe_conversions_impl.h 34KB
safe_conversions_impl.h 34KB
safe_conversions_impl.h 34KB
checked_math_impl.h 22KB
checked_math_impl.h 22KB
checked_math_impl.h 22KB
checked_math_impl.h 22KB
file_io.h 20KB
file_io.h 20KB
file_io.h 20KB
file_io.h 20KB
crash_report_database.h 17KB
crash_report_database.h 17KB
crash_report_database.h 17KB
crash_report_database.h 17KB
child_port_handshake.h 16KB
child_port_handshake.h 16KB
child_port_handshake.h 16KB
child_port_handshake.h 16KB
safe_conversions.h 14KB
safe_conversions.h 14KB
safe_conversions.h 14KB
safe_conversions.h 14KB
checked_math.h 14KB
checked_math.h 14KB
checked_math.h 14KB
checked_math.h 14KB
process_structs.h 14KB
process_structs.h 14KB
process_structs.h 14KB
process_structs.h 14KB
icu_utf.h 14KB
icu_utf.h 14KB
icu_utf.h 14KB
icu_utf.h 14KB
clamped_math_impl.h 13KB
clamped_math_impl.h 13KB
clamped_math_impl.h 13KB
clamped_math_impl.h 13KB
exception_ports.h 12KB
exception_ports.h 12KB
exception_ports.h 12KB
exception_ports.h 12KB
exc_server_variants.h 11KB
exc_server_variants.h 11KB
exc_server_variants.h 11KB
exc_server_variants.h 11KB
crashpad_info.h 11KB
crashpad_info.h 11KB
crashpad_info.h 11KB
crashpad_info.h 11KB
signals.h 11KB
signals.h 11KB
signals.h 11KB
signals.h 11KB
file_path.h 11KB
file_path.h 11KB
file_path.h 11KB
file_path.h 11KB
logging.h 10KB
logging.h 10KB
logging.h 10KB
logging.h 10KB
notify_server.h 10KB
notify_server.h 10KB
notify_server.h 10KB
notify_server.h 10KB
mach_message.h 9KB
mach_message.h 9KB
mach_message.h 9KB
mach_message.h 9KB
annotation.h 9KB
annotation.h 9KB
annotation.h 9KB
annotation.h 9KB
clamped_math.h 9KB
clamped_math.h 9KB
clamped_math.h 9KB
clamped_math.h 9KB
共 1116 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源推荐
资源预览
资源评论
2017-09-08 上传
2011-09-02 上传
178 浏览量
123 浏览量
175 浏览量
166 浏览量
162 浏览量
5星 · 资源好评率100%
165 浏览量
5星 · 资源好评率100%
152 浏览量
2024-10-15 上传
133 浏览量
2017-08-24 上传
5星 · 资源好评率100%
178 浏览量
191 浏览量
179 浏览量
5星 · 资源好评率100%
116 浏览量
2018-01-19 上传
155 浏览量
117 浏览量
2020-08-17 上传
2020-11-24 上传
142 浏览量
2018-01-06 上传
106 浏览量
161 浏览量
141 浏览量
2023-10-28 上传
2020-03-17 上传
资源评论
码农葫芦侠
- 粉丝: 265
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 20241226_243237026.jpeg
- f81f7b71ce9eb640ab3b0707aaf789f2.PNG
- YOLOv10目标检测基础教程:从零开始构建你的检测系统
- 学生实验:计算机编程基础教程
- 软件安装与配置基础教程:从新手到高手
- IT类课程习题解析与实践基础教程
- 湖南大学大一各种代码:实验1-9,小班,作业1-10,开放题库 注:这是21级的,有问题不要找我,少了也不要找我
- 湖南大学大一计科小学期的练习题 注,有问题别找我
- unidbg一、符号调用、地址调用
- forest-http
- christmas-圣诞树代码
- platform-绿色创新理论与实践
- christmas-圣诞树
- 数据分析-泰坦尼克号幸存者预测
- 字符串-圣诞树c语言编程代码
- learning_coder-二叉树的深度
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功