TRLC Platform Library  1.0.0
Header-only C++ library for compile-time platform detection and abstraction
trlc::platform::DebugUtils Class Reference

Debug utilities class with static methods. More...

#include <trlc/platform/debug.hpp>

Static Public Member Functions

static void setAssertionHandler (AssertionHandler handler)
 
static AssertionHandler getAssertionHandler ()
 Get the current assertion handler. More...
 
static void debugBreak ()
 
static void unreachable ()
 
static void abort (const char *message=nullptr)
 
static bool canCaptureStackTrace ()
 Check if stack trace capture is supported. More...
 
static void printStackTrace ()
 

Detailed Description

Debug utilities class with static methods.

This class provides a collection of debug-related utilities including assertion handling, debug breaks, program termination, and stack trace support. All methods are static and thread-safe.

The class manages a global assertion handler that can be customized by the application. Thread safety is ensured through atomic operations.

Definition at line 157 of file debug.hpp.

Member Function Documentation

◆ abort()

static void trlc::platform::DebugUtils::abort ( const char *  message = nullptr)
inlinestatic

◆ canCaptureStackTrace()

static bool trlc::platform::DebugUtils::canCaptureStackTrace ( )
inlinestatic

Check if stack trace capture is supported.

Determines whether the current platform and build configuration supports capturing and displaying stack traces.

Returns
True if stack trace capture is available
Note
Availability depends on platform, compiler, and build settings
Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/core.hpp, and /home/tranglc/sources/trlc-platform/include/trlc/platform/debug.hpp.

Definition at line 344 of file debug.hpp.

◆ debugBreak()

static void trlc::platform::DebugUtils::debugBreak ( )
inlinestatic

◆ getAssertionHandler()

static AssertionHandler trlc::platform::DebugUtils::getAssertionHandler ( )
inlinestatic

Get the current assertion handler.

Returns the currently registered assertion handler function.

Returns
The current assertion handler function pointer
Note
This function is thread-safe
Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/debug.hpp.

Definition at line 200 of file debug.hpp.

◆ printStackTrace()

static void trlc::platform::DebugUtils::printStackTrace ( )
inlinestatic

◆ setAssertionHandler()

static void trlc::platform::DebugUtils::setAssertionHandler ( AssertionHandler  handler)
inlinestatic

◆ unreachable()

static void trlc::platform::DebugUtils::unreachable ( )
inlinestatic

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