Adds a CrashEventResult type returned from the user callback registered with the exception handler, which can either be Handled(bool) covering the previous use case, but can also be a Jump specifying a jump buffer and value. This allows the exception handler to cleanly cleanup its state (eg unlock mutexes) before long jumping to the specified location. This functionality was only used in testing before, but there's no reason it can't be part of the user API in cases where users know they are about to raise an exception and want to be able to handle it gracefully....except for MacOS! Since MacOS delivers exceptions to a separate thread, we can't longjump from it back to the point in the user thread that raised the exception, at least, not in a way that I know of.
This adds the initial MacOS implementation for crash-context, exception-handler, and minidumper. This PR heavily depends on https://github.com/rust-minidump/minidump_writer_linux/pull/21 for the minidump write implementation.
Other notable changes:
CrashEventResult
type returned from the user callback registered with the exception handler, which can either beHandled(bool)
covering the previous use case, but can also be aJump
specifying a jump buffer and value. This allows the exception handler to cleanly cleanup its state (eg unlock mutexes) before long jumping to the specified location. This functionality was only used in testing before, but there's no reason it can't be part of the user API in cases where users know they are about to raise an exception and want to be able to handle it gracefully....except for MacOS! Since MacOS delivers exceptions to a separate thread, we can't longjump from it back to the point in the user thread that raised the exception, at least, not in a way that I know of.Resolves: #3