|
ASL
|
Functionality to capture call stack traces on crashes.
It allows setting a callback function that will be called when a crash occurs, and provides a message with the stack trace information. Supports Windows, Linux, and macOS. Programs must be compiled with debug info (Debug or RelWithDebInfo) to get function names, file names, and line numbers.
The message is platform-dependent and may include function names, file names, and line numbers if available. On Linux, it calls addr2line if available to get file and line information if the binary has debug symbols. On macOS, it calls atos if available to get file and line information if the binary has debug symbols.
#include <asl/StackTrace.h>
Static Public Member Functions | |
| static void | onCrash (asl::Function< void > f) |
| Sets a callback function to be called when a crash occurs. | |
| static asl::String | message () |
| Returns the message containing the stack trace information after a crash has occurred. | |