std::breakpoint(3)
π NAME π
okay so this is the std::breakpoint(3) page from the C++ Standard Libary manual, and the NAME section is literally std::breakpoint - std::breakpoint. no extra notes, just iconic behavior π
.
π§ Synopsis π§
bestie, hereβs the exact synopsis block, no cap:
Defined in header <debugging>
void breakpoint() noexcept; (since C++26)
This is the unconditional breakpoint: it attempts to temporarily halt the execution of the program and transfer control to the debugger, whether or not it's not possible to determine if the debugger is present.
π¨ Formally, the behavior of this function is completely implementation-defined. π¨
π¦ Notes π¦
The intent of this function is allowing for runtime control of breakpoints beyond what might be available from a debugger while not causing the program to exit. For example: breaking when an infrequent non-critical condition is detected, allowing programmatic control with complex runtime sensitive conditions, breaking on user input to inspect context in interactive programs without needing to switch to the debugger application, etc.
This function standardizes many similar existing facilities: __builtin_debugtrap from LLVM, __debugbreak from Win32 API, debugger_break from boost.test, assert(false), _asm { int 3 } (MSVC) and asm("int3") (GCC/clang) for x86 targets, etc.
π feature-test macro
__cpp_lib_debuggingβ value202311Lβ std(C++26)β feature: Debugging support library__cpp_lib_debuggingβ value202403Lβ std(C++26)β feature: Replaceablestd::is_debugger_present
π Example π
This section is incomplete Reason: no example
π See also π
is_debugger_presentβ checks whether a program is running under the control of a debugger β(C++26)(function)breakpoint_if_debuggingβ callsstd::breakpointifstd::is_debugger_presentreturnstrueβ(C++26)(function)
π External links π
- armKEIL:
__breakpointintrinsic - Portable Snippets: Debugging assertions and traps
- EASTL:
EASTL_DEBUG_BREAK - Catch2:
CATCH_TRAPandCATCH_BREAK_INTO_DEBUGGER - Unreal Engine:
DebugBreak - JUCE:
JUCE_BREAK_IN_DEBUGGER - Dear ImGui:
IM_DEBUG_BREAK - AWS C Common:
aws_debug_break
π Category π
* Todo no example
π cute sign-off: source/version http://cppreference.com β date 2024.06.10 β page std::breakpoint(3) β mwah π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms