debugbreak
« Back to VersTracker
Description:
Break into the debugger programmatically
Type: Formula  |  Latest Version: 1.0@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: debugging c c++ header-only cross-platform developer-tools
Install: brew install debugbreak
About:
debugbreak is a header-only C/C++ library that provides a cross-platform `debug_break()` function. It allows developers to programmatically insert breakpoints into source code, which will trigger a debugger if attached. This is particularly useful for debugging in environments where manual breakpoint setting is difficult or for conditional debugging scenarios.
Key Features:
  • Header-only library (no linking required)
  • Cross-platform support (Linux, macOS, Windows, BSD)
  • Supports multiple compilers (GCC, Clang, MSVC)
  • Works with GDB, LLDB, and Visual Studio debuggers
  • Minimal overhead when not debugging
Use Cases:
  • Debugging conditional logic that is hard to reproduce manually
  • Halting execution in automated test environments
  • Debugging embedded systems or remote processes
  • Adding assertions that break into the debugger
Alternatives:
  • raise(SIGTRAP) – Unix-specific and requires signal handling; debugbreak is cross-platform and easier to use.
  • __debugbreak() – MSVC-specific intrinsic; debugbreak provides a portable equivalent for other compilers.
License: BSD-2-Clause
Bottles available for: all
Version History
Detected Version Rev Change Commit