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. |
//! |