ASL
Loading...
Searching...
No Matches
StackTrace Class Reference

Detailed Description

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.

});
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.
Definition StackTrace.h:38
#define ASL_LOG_E(...)
Log a formatted message with the ERROR level.
Definition Log.h:153

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.
 

The documentation for this class was generated from the following file: