C++ Runtime !full! May 2026

main → foo() → bar() → throw MyException(); → __cxa_throw (sets unwind info, calls _Unwind_RaiseException) → _Unwind_RaiseException → _Unwind_RaiseException_Phase1 (walks .eh_frame) → _Unwind_RaiseException_Phase2 (calls personality, destructors) → __gxx_personality_v0 (calls destructors of locals in bar, foo) → land on catch in main On Linux: readelf -S a.out (look for .init_array , .eh_frame , .gcc_except_table ) On Windows: dumpbin /HEADERS myapp.exe (look for .pdata for x64 exception tables) This report is based on the Itanium C++ ABI (version 1.2), Microsoft C++ ABI (x64), and publicly available documentation for GCC 13, Clang 17, and MSVC 2022.

static Logger& getLogger() static Logger instance; // thread‑safe initialization return instance; c++ runtime

static char instance_memory[sizeof(Logger)]; static uint8_t guard = 0; // 0 = uninitialized, 1 = initializing, 2 = done if (guard == 2) goto done; if (__cxa_guard_acquire(&guard)) new (instance_memory) Logger(); __cxa_guard_release(&guard); __cxa_atexit(destroyer, instance_memory, __dso_handle); main → foo() → bar() → throw MyException();

Compiler transforms to:

done: return instance_memory;