debugbreak
brew install debugbreak
v1.0
BSD-2-Clause
Break into the debugger programmatically
2
30-day installs · #13555
5
90-day · #14787
21
365-day · #13954
676
★ GitHub stars · updated 2y ago
Links
- https://github.com/scottt/debugbreak
- GitHub: scottt/debugbreak
- Brew formula source: Formula/d/debugbreak.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Break into the debugger programmatically",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:36:53+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "debugbreak",
"github_default_branch": "master",
"github_last_commit_at": "2024-02-15T16:31:02Z",
"github_readme_excerpt": "# Debug Break\n\n[debugbreak.h](https://github.com/scottt/debugbreak/blob/master/debugbreak.h) allows you to put breakpoints in your C/C++ code with a call to **debug_break()**:\n```C\n#include \u003cstdio.h\u003e\n#include \"debugbreak.h\"\n\nint main()\n{\n\tdebug_break(); /* will break into debugger */\n\tprintf(\"hello world\\n\");\n\treturn 0;\n}\n```\n* Include one header file and insert calls to `debug_break()` in the code where you wish to break into the debugger.\n* Supports GCC, Clang and MSVC.\n* Works well on ARM, AArch64, i686, x86-64, POWER and has a fallback code path for other architectures.\n* Works like the **DebugBreak()** fuction provided by [Windows](http://msdn.microsoft.com/en-us/library/ea9yy3ey.aspx) and [QNX](http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/lib_ref/d/debugbreak.html).\n\n**License**: the very permissive [2-Clause BSD](https://github.com/scottt/debugbreak/blob/master/COPYING).\n\nKnown Problem: if continuing execution after a debugbreak breakpoint hit doesn\u0027t work (e.g. on ARM or POWER), see [HOW-TO-USE-DEBUGBREAK-GDB-PY.md](HOW-TO-USE-DEBUGBREAK-GDB-PY.md) for a workaround.\n\nImplementation Notes\n================================\n\nThe requirements for the **debug_break()** function are:\n* Act as a compiler code motion barrier\n* Don\u0027t cause the compiler optimizers to think the code following it can be removed\n* Trigger a software breakpoint hit when executed (e.g. **SIGTRAP** on Linux)\n* GDB commands like **continue**, **next**, **step**, **stepi** must work after a **debug_break()** hit\n\nIdeally, both GCC and Clang would provide a **__builtin_debugtrap()** that satisfies the above on all architectures and operating systems. Unfortunately, that is not the case (yet).\nGCC\u0027s [__builtin_trap()](http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-g_t_005f_005fbuiltin_005ftrap-3278) causes the optimizers to think the code follwing can be removed ([test/trap.c](https://github.com/scottt/debugbreak/blob/master/test/trap.c)):\n```C\n#include \u003cstdio.h\u003e\n\nint main()",
"github_repo": "scottt/debugbreak",
"github_stars": 676,
"github_topics": [],
"homepage": "https://github.com/scottt/debugbreak",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 2,
"installs_365d": 21,
"installs_90d": 5,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "BSD-2-Clause",
"llm_generated_at": null,
"llm_model": null,
"name": "debugbreak",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 13555,
"rank_365d": 13954,
"rank_90d": 14787,
"raw_hash": "7bccdd06c4bff173",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/d/debugbreak.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": null,
"version_stable": "1.0",
"versioned_formulae": [],
"why_use_this": null
}