Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: util/mach/exc_server_variants.h

Issue 566693003: ExcCrashRecoverOriginalException() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/catch_exception_tool.cc ('k') | util/mach/exc_server_variants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/exc_server_variants.h
diff --git a/util/mach/exc_server_variants.h b/util/mach/exc_server_variants.h
index d605869a4f4ca15781fc434534ef0d55f3add90e..3719b5257bc9e77decb14e1a01058879e62e9cd5 100644
--- a/util/mach/exc_server_variants.h
+++ b/util/mach/exc_server_variants.h
@@ -429,6 +429,40 @@ class UniversalMachExcServer
internal::SimplifiedMachExcServer mach_exc_server_;
};
+//! \brief Recovers the original exception, first exception code, and signal
+//! from the encoded form of the first exception code delivered with
+//! `EXC_CRASH` exceptions.
+//!
+//! `EXC_CRASH` exceptions are generated when the kernel has committed to
+//! terminating a process as a result of a core-generating POSIX signal and, for
+//! hardware exceptions, an earlier Mach exception. Information about this
+//! earlier exception and signal is made available to the `EXC_CRASH` handler
+//! via its `code[0]` parameter. This function recovers the original exception,
+//! the value of `code[0]` from the original exception, and the value of the
+//! signal responsible for process termination.
+//!
+//! \param[in] code_0 The first exception code (`code[0]`) passed to a Mach
+//! exception handler in an `EXC_CRASH` exception. It is invalid to call
+//! this function with an exception code from any exception other than
+//! `EXC_CRASH`.
+//! \param[out] original_code_0 The first exception code (`code[0]`) passed to
+//! the Mach exception handler for a hardware exception that resulted in the
+//! generation of a POSIX signal that caused process termination. If the
+//! signal that caused termination was not sent as a result of a hardware
+//! exception, this will be `0`. Callers that do not need this value may
+//! pass `NULL`.
+//! \param[out] signal The POSIX signal that caused process termination. Callers
+//! that do not need this value may pass `NULL`.
+//!
+//! \return The original exception for a hardware exception that resulted in the
+//! generation of a POSIX signal that caused process termination. If the
+//! signal that caused termination was not sent as a result of a hardware
+//! exception, this will be `0`.
+exception_type_t ExcCrashRecoverOriginalException(
+ mach_exception_data_type_t code_0,
+ mach_exception_data_type_t* original_code_0,
+ int* signal);
+
//! \brief Computes an approriate successful return value for an exception
//! handler function.
//!
« no previous file with comments | « tools/catch_exception_tool.cc ('k') | util/mach/exc_server_variants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698