std::breakpoint is an upcoming C++26 standard library function that requests a temporary pause in program execution from within source code and passes control to the debugger. Based on cppreference documentation checked on 2026-10-28 (KST), this post covers the three functions in the <debugging> header (std::breakpoint, std::breakpoint_if_debugging, and std::is_debugger_present), how they standardize existing compiler-specific facilities, and what happened when checking with g++ (Debian 14.2.0-19) 14.2.0.
Summary
std::breakpoint is a C++26 standard function that asks from within code to pause execution and hand control to the debugger. Previously, developers relied on compiler- or OS-specific facilities such as __debugbreak, __builtin_debugtrap, or asm("int3"), which are now standardized under the <debugging> header. Use std::breakpoint_if_debugging() to stop only when a debugger is attached, and std::is_debugger_present() to check whether the program is running under a debugger. Exact behavior is implementation-defined, and GCC 14.2 in our environment did not include this header yet.
What is std::breakpoint?
One-line answer: std::breakpoint is a C++26 standard function that requests from code to temporarily stop program execution and pass control to the debugger without terminating the program.
According to the cppreference page for std::breakpoint, it is an unconditional breakpoint that attempts to temporarily stop program execution and pass control to the debugger, regardless of whether the presence of a debugger can be detected. The behavior of this function is implementation-defined.
Unlike setting a breakpoint on a line number from an IDE or debugger UI, calling a breakpoint function directly in code gives you runtime control over breakpoints beyond what a debugger offers without making the program exit—for instance, breaking when a rare non-critical condition is detected.
Runtime memory error checkers serve a different purpose; for details on detecting memory errors during execution, see How to find memory errors at runtime with AddressSanitizer (Korean). Likewise, C++26 function contract checking with contract_assert is a separate feature covered in What is C++26 Contracts? Checking function conditions with pre, post, and contract_assert.
What is inside the <debugging> header?
One-line answer: It provides three noexcept functions: breakpoint() for an unconditional stop request, breakpoint_if_debugging() to stop only when a debugger is present, and is_debugger_present() to check whether a debugger is attached.
In the cppreference synopsis for <debugging>, three functions are declared in namespace std:
void breakpoint() noexcept;void breakpoint_if_debugging() noexcept;bool is_debugger_present() noexcept;
std::breakpoint_if_debugging() is a conditional breakpoint: it breaks into the debugger only if it can determine that a debugger is present, and acts as a no-op otherwise. Although its behavior is formally implementation-defined, it is equivalent to if (std::is_debugger_present()) std::breakpoint();. std::is_debugger_present() checks whether the program is running under the control of a debugger and returns a bool.
| Function | What it does | When no debugger is attached |
|---|---|---|
std::breakpoint() noexcept | Attempts to temporarily stop execution and pass control to the debugger regardless of whether a debugger is detected | Implementation-defined |
std::breakpoint_if_debugging() noexcept | Breaks into the debugger only if a debugger can be determined to be present (equivalent to if (std::is_debugger_present()) std::breakpoint();) | Acts as a no-op |
std::is_debugger_present() noexcept | Checks whether the program is running under the control of a debugger (returns bool) | Returns whether a debugger is attached (bool) |

The synopsis also marks all three functions as // all freestanding, meaning the standard specifies them as available in freestanding implementations (environments without a full OS, such as embedded systems).
How does it differ from existing approaches?
One-line answer: It standardizes compiler- and platform-specific facilities such as __builtin_debugtrap, DebugBreak(), __debugbreak, and asm("int3") into a single portable interface.
Previously, triggering a debugger stop from C++ code required non-standard compiler extensions or OS APIs. According to cppreference, std::breakpoint standardizes existing facilities such as:
__builtin_debugtrap(LLVM)DebugBreak()(Win32 API)__debugbreak(MSVC extension)asm("int3")(GCC/clang on x86)
C++26 unifies these under <debugging> and provides the feature-test macro __cpp_lib_debugging. This standardization of debugging traps into a C++26 header was also highlighted on Hacker News in “C++26: The New Debugging Header” (posted 2026-10-17 KST).

Can you use it right now?
One-line answer: C++26 has not yet been published by ISO, and GCC 14.2 in our environment did not have the <debugging> header yet, so code can guard usage with __has_include and __cpp_lib_debugging.
C++26 has not yet been published by ISO. When we checked on 2026-10-28 (KST) using g++ (Debian 14.2.0-19) 14.2.0 with the following breakpoint.cpp file:
breakpoint.cpp:
#include <debugging>
int main() { std::breakpoint_if_debugging(); }
Running $ g++ -std=c++26 -c breakpoint.cpp exited with status 1 (exit=1) and produced the following output:
breakpoint.cpp:1:10: fatal error: debugging: No such file or directory
1 | #include <debugging>
| ^~~~~~~~~~~
compilation terminated.
GCC 14.2 on this machine did not have the header yet. To write code that checks for the header and falls back to existing compiler-specific extensions when the header is missing (as noted in the comment inside the #else branch below), you can use the following concept code, not run:
Concept code, not run:
#if defined(__has_include)
# if __has_include(<debugging>)
# include <debugging>
# endif
#endif
void check_state(bool rare_condition) {
#if defined(__cpp_lib_debugging)
if (rare_condition) std::breakpoint_if_debugging();
#else
(void)rare_condition; // 헤더가 없으면 기존 방법(컴파일러별 확장)으로 대체
#endif
}
What are the frequently asked questions?
One-line answer: Here are the answers on how std::breakpoint differs from assert, what happens when no debugger is attached, and where to check practical gdb workflows.
How does it differ from assert?
assert stops the program by aborting when its condition is false (in builds where NDEBUG is not defined), whereas std::breakpoint asks to pause execution and hand control to the debugger without ending the program.
What happens if the program runs without a debugger?
std::breakpoint_if_debugging() acts as a no-op and does nothing when no debugger is attached. For std::breakpoint(), the behavior is implementation-defined.
How do you inspect state in gdb?
For practical crash and state inspection workflows using gdb, core dumps, and gdbserver on Linux, see How to find crash causes with gdb on Embedded Linux: core dump and gdbserver in practice.
What related posts are worth reading?
One-line answer: These related posts cover Linux gdb debugging, AddressSanitizer runtime memory checking, and C++26 Contracts.
- How to find crash causes with gdb on Embedded Linux: core dump and gdbserver in practice
- How to find memory errors at runtime with AddressSanitizer (Korean)
- What is C++26 Contracts? Checking function conditions with pre, post, and contract_assert
What are the sources?
One-line answer: This post references the Hacker News thread and the cppreference documentation for the C++26 <debugging> header and functions.
- Hacker News — C++26: The New Debugging Header (posted 2026-10-17 KST, checked 2026-10-28)
- cppreference — Standard library header <debugging> (C++26) (checked 2026-10-28)
- cppreference — std::breakpoint (checked 2026-10-28)
- cppreference — std::breakpoint_if_debugging (checked 2026-10-28)