Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_BLBackTrace.H File Reference

Utilities for capturing and printing lightweight backtraces. More...

#include <AMReX_Config.H>
#include <stack>
#include <string>
#include <utility>
#include <cstdlib>

Go to the source code of this file.

Classes

struct  amrex::BLBackTrace
 
class  amrex::BLBTer
 

Namespaces

namespace  amrex
 

Macros

#define BL_BACKTRACE_PUSH(S)   amrex::BLBTer BL_PASTE( bl_bter, __COUNTER__ )( S, __FILE__, __LINE__ )
 Push a named scope onto the backtrace stack via an RAII guard.
 
#define BL_BACKTRACE_POP()   amrex::BLBackTrace::bt_stack.pop()
 Manually pop the top entry from the backtrace stack.
 

Detailed Description

Utilities for capturing and printing lightweight backtraces.

Macro Definition Documentation

◆ BL_BACKTRACE_POP

#define BL_BACKTRACE_POP ( )    amrex::BLBackTrace::bt_stack.pop()

Manually pop the top entry from the backtrace stack.

Normally not needed; the RAII guard from BL_BACKTRACE_PUSH handles this. Use only when manual stack control is required.

◆ BL_BACKTRACE_PUSH

#define BL_BACKTRACE_PUSH (   S)    amrex::BLBTer BL_PASTE( bl_bter, __COUNTER__ )( S, __FILE__, __LINE__ )

Push a named scope onto the backtrace stack via an RAII guard.

Place at the top of a function to record its entry in backtrace output. The guard is automatically popped when it falls out of scope.

Parameters
SString literal describing the scope (e.g., function name).