Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::breakpoint

      From cppreference.com
      <cpp‎ |utility
       
       
      Diagnostics library
       
      Defined in header<debugging>
      void breakpoint()noexcept;
      (since C++26)

      Unconditional breakpoint: 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.

      Contents

      [edit]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 fromboost.test,assert(false),_asm{int3} (MSVC) andasm("int3") (GCC/clang) for x86 targets,etc.

      Feature-test macroValueStdFeature
      __cpp_lib_debugging202311L(C++26)Debugging support library
      202403L(C++26)Replaceablestd::is_debugger_present

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      checks whether a program is running under the control of a debugger
      (function)[edit]
      callsstd::breakpoint ifstd::is_debugger_present returnstrue
      (function)[edit]

      [edit]External links

      1. armKEIL:__breakpoint intrinsic
      2. Portable Snippets:Debugging assertions and traps
      3. EASTL:EASTL_DEBUG_BREAK
      4. Catch2:CATCH_TRAP andCATCH_BREAK_INTO_DEBUGGER
      5. Unreal Engine:DebugBreak
      6. JUCE:JUCE_BREAK_IN_DEBUGGER
      7. Dear ImGui:IM_DEBUG_BREAK
      8. AWS C Common:aws_debug_break
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/breakpoint&oldid=178612"

      [8]ページ先頭

      ©2009-2025 Movatter.jp