2019-04-09 07:44:44 +00:00
|
|
|
Crash Handling System
|
|
|
|
=====================
|
|
|
|
|
2019-12-28 20:54:00 +00:00
|
|
|
Cutter uses `Breakpad <https://github.com/google/breakpad>`__ as a backend
|
2019-04-09 07:44:44 +00:00
|
|
|
for crash handling.
|
|
|
|
|
2019-12-28 20:54:00 +00:00
|
|
|
Crash Handling System is disabled by default to not interfere with developers while debugging.
|
|
|
|
To enable this system, set the ``CUTTER_ENABLE_CRASH_REPORTS`` build option.
|
2019-04-09 07:44:44 +00:00
|
|
|
|
|
|
|
Solution description
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
There are only 2 source files:
|
|
|
|
|
|
|
|
* ``CrashHandler.h``
|
|
|
|
* ``CrashHandler.cpp``
|
|
|
|
|
2019-12-28 20:54:00 +00:00
|
|
|
And the API is very simple: One function, ``initCrashHandler()``, enables the Crash Handling System if
|
|
|
|
``CUTTER_ENABLE_CRASH_REPORTS`` is true, otherwise it does nothing.
|
2019-04-09 07:44:44 +00:00
|
|
|
|
2019-12-28 20:54:00 +00:00
|
|
|
As soon as a signal is raised, ``crashHandler(int signum)`` is called with the signal's code as argument.
|
|
|
|
This function first writes a crash dump to the operating system's temporary directory to catch core and
|
|
|
|
memory state as it was at the moment of the crash.
|
2019-04-09 07:44:44 +00:00
|
|
|
|
2019-12-28 20:54:00 +00:00
|
|
|
Then the crash dialog is shown:
|
2019-04-09 07:44:44 +00:00
|
|
|
|
2020-07-19 19:23:00 +00:00
|
|
|
.. image :: /images/crash-dialog.png
|
2019-04-09 07:44:44 +00:00
|
|
|
|
2019-12-28 20:54:00 +00:00
|
|
|
If the user chooses to create a crash dump, the prepared dump is moved to the directory specified by user.
|
|
|
|
And then the success dialog is shown:
|
2019-04-09 07:44:44 +00:00
|
|
|
|
2020-07-19 19:23:00 +00:00
|
|
|
.. image :: /images/success-dump-dialog.png
|