[ios] Bring up first half of UncaughtExceptionHandler.

When code raises an Objective-C exception, unwind the stack looking for
any exception handlers. If an exception handler is encountered, test to
see if it is a function known to be a catch-and-rethrow 'sinkhole'
exception handler. Various routines in UIKit and elsewhere do this, and
they obscure the exception stack, since the original throw location is
no longer present on the stack (just the re-throw) when Crashpad
captures the crash report. In the case of sinkholes, trigger an
immediate exception to capture the original stack.

The is an improvement over the alternative,
NSSetUncaughtExceptionHandler, which passes along the stack frames, but
not the stack memory contents and full exception context itself.

The details of what happens after a fatal exception is triggered are
unresolved in this CL.  For now, simply call std::terminate.

This code was inspired by chromium/src/chrome/browser/mac/
exception_processor.mm.

Bug: crashpad:31
Change-Id: Ife4c7c6d50e6a657c3a01d6b49f7fc50e21ba759
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2125254
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
GitOrigin-RevId: b2fd7d5307b083613469c29c09c5710265f47a91
10 files changed
tree: 7f36dd5456fb9bcf5f7891ca91e712527099288c
  1. build/
  2. client/
  3. compat/
  4. doc/
  5. handler/
  6. infra/
  7. minidump/
  8. snapshot/
  9. test/
  10. third_party/
  11. tools/
  12. util/
  13. .clang-format
  14. .gitattributes
  15. .gitignore
  16. .gn
  17. .vpython
  18. AUTHORS
  19. BUILD.gn
  20. codereview.settings
  21. CONTRIBUTORS
  22. crashpad.gyp
  23. DEPS
  24. LICENSE
  25. navbar.md
  26. package.h
  27. README.md
README.md

Crashpad

Crashpad is a crash-reporting system.

Documentation

Source Code

Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.

Other Links