diff --git a/handler/fuchsia/crash_report_exception_handler.cc b/handler/fuchsia/crash_report_exception_handler.cc index b181cb60..34bed289 100644 --- a/handler/fuchsia/crash_report_exception_handler.cc +++ b/handler/fuchsia/crash_report_exception_handler.cc @@ -99,12 +99,15 @@ bool CrashReportExceptionHandler::HandleExceptionHandles( const zx::thread& thread, const zx::unowned_port& exception_port, UUID* local_report_id) { - ScopedTaskSuspend suspend(process); - - // Now that the thread has been successfully retrieved, it is possible to - // correctly call zx_task_resume_from_exception() to continue exception - // processing, even if something else during this function fails. ScopedThreadResumeAfterException resume(thread, exception_port); + return HandleException(process, thread, local_report_id); +} + +bool CrashReportExceptionHandler::HandleException( + const zx::process& process, + const zx::thread& thread, + UUID* local_report_id) { + ScopedTaskSuspend suspend(process); ProcessSnapshotFuchsia process_snapshot; if (!process_snapshot.Initialize(process)) { diff --git a/handler/fuchsia/crash_report_exception_handler.h b/handler/fuchsia/crash_report_exception_handler.h index c636fcae..57afe7d0 100644 --- a/handler/fuchsia/crash_report_exception_handler.h +++ b/handler/fuchsia/crash_report_exception_handler.h @@ -84,6 +84,8 @@ class CrashReportExceptionHandler { //! \param[out] local_report_id The unique identifier for the report created //! in the local report database. Optional. //! \return `true` on success, or `false` with an error logged. + //! + //! \deprecated Use the port-less version instead and have the caller resume. bool HandleException(uint64_t process_id, uint64_t thread_id, const zx::unowned_port& exception_port, @@ -104,11 +106,27 @@ class CrashReportExceptionHandler { //! \param[out] local_report_id The unique identifier for the report created //! in the local report database. Optional. //! \return `true` on success, or `false` with an error logged. + //! + //! \deprecated Use the port-less #HandleException instead. bool HandleExceptionHandles(const zx::process& process, const zx::thread& thread, const zx::unowned_port& exception_port, UUID* local_report_id = nullptr); + //! \brief Called when the exception handler server has caught an exception + //! and wants a crash dump to be taken. + //! + //! \param[in] process The handle to the process which sustained the + //! exception. + //! \param[in] thread The handle to the thread of \a process which sustained + //! the exception. + //! \param[out] local_report_id The unique identifier for the report created + //! in the local report database. Optional. + //! \return `true` on success, or `false` with an error logged. + bool HandleException(const zx::process& process, + const zx::thread& thread, + UUID* local_report_id = nullptr); + private: CrashReportDatabase* database_; // weak CrashReportUploadThread* upload_thread_; // weak