#include "handler/linux/cros_crash_report_exception_handler.h"
#include <vector>
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#if defined(CRASHPAD_IS_IN_CHROMIUM)
#include "base/system/sys_info.h"
#endif
#include "client/settings.h"
#include "handler/linux/capture_snapshot.h"
#include "handler/minidump_to_upload_parameters.h"
#include "minidump/minidump_file_writer.h"
#include "snapshot/linux/process_snapshot_linux.h"
#include "snapshot/minidump/process_snapshot_minidump.h"
#include "snapshot/sanitized/process_snapshot_sanitized.h"
#include "util/file/file_writer.h"
#include "util/linux/direct_ptrace_connection.h"
#include "util/linux/ptrace_client.h"
#include "util/misc/metrics.h"
#include "util/misc/uuid.h"
#include "util/posix/spawn_subprocess.h"
namespace crashpad {
namespace {
const std::string GetProcessNameFromPid(pid_t pid) { … }
bool WriteAnnotationsAndMinidump(
const std::map<std::string, std::string>& parameters,
MinidumpFileWriter& minidump,
FileWriter& file_writer) { … }
}
CrosCrashReportExceptionHandler::CrosCrashReportExceptionHandler(
CrashReportDatabase* database,
const std::map<std::string, std::string>* process_annotations,
const UserStreamDataSources* user_stream_data_sources)
: … { … }
CrosCrashReportExceptionHandler::~CrosCrashReportExceptionHandler() = default;
bool CrosCrashReportExceptionHandler::HandleException(
pid_t client_process_id,
uid_t client_uid,
const ExceptionHandlerProtocol::ClientInformation& info,
VMAddress requesting_thread_stack_address,
pid_t* requesting_thread_id,
UUID* local_report_id) { … }
bool CrosCrashReportExceptionHandler::HandleExceptionWithBroker(
pid_t client_process_id,
uid_t client_uid,
const ExceptionHandlerProtocol::ClientInformation& info,
int broker_sock,
UUID* local_report_id) { … }
bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection(
PtraceConnection* connection,
const ExceptionHandlerProtocol::ClientInformation& info,
uid_t client_uid,
VMAddress requesting_thread_stack_address,
pid_t* requesting_thread_id,
UUID* local_report_id) { … }
}