# hsdbg hsdbg is a cross-platform GUI debugger for C and C++. I wrote it because I didn't like the options I had. Debugging is a visual thing, at least to me. I want to see the source, the state of the program, the stack, my variables, registers, and whatever else is going on, all at once. Most of the good C/C++ debuggers are either terminal programs or tied to one platform. The only ones I've actually liked are RemedyBG and Visual Studio. Both are Windows-only. I'm not on Windows, so I made my own. hsdbg is meant to be a debugger, not a full IDE. It should start quickly, work on everything I use, and have the stuff I actually reach for without turning into an entire development environment. Underneath, it's an LLDB frontend. LLDB does the debugging; hsdbg is the UI I wish I had on top of it. ## Features The usual debugger stuff is there. You can launch or attach to processes, step through code, and set breakpoints by line, function, or address. Breakpoints can have conditions and ignore counts. There's a source view with syntax highlighting and a breakpoint gutter, alongside locals, registers, threads, and the call stack. There's also disassembly, symbols, and raw memory for when you need to go further down. The console lets you type C or C++ directly into the debugger, which LLDB JIT-compiles and runs inside the debugged process. So if you do something like `a = 60` you actually changed `a`, and that change sticks when you continue. ![screenshot](branding/screenshot.png) ## Build hsdbg builds on macOS, Linux, and Windows. You'll need [meson](https://mesonbuild.com/), [ninja](https://ninja-build.org/), Python 3, and a C++23 compiler. hsdbg links against LLVM/LLDB. Running `tools/fetch_llvm.py` pulls the pinned LLVM release (22.1.0) for your platform. Alternatively, you can point it at an existing LLVM installation that ships the LLDB headers with `-Dllvm_prefix=` or the `LLVM_PREFIX` environment variable, or have `llvm-config` available on your `PATH`. ```bash $ git clone --recursive https://git.hachem.wtf/hsdbg.git $ cd hsdbg $ python3 tools/fetch_llvm.py $ meson setup build --buildtype=release -Db_ndebug=true $ ninja -C build $ ./build/hsdbg ./a.out ``` The binary lands in `build/hsdbg`. Each meson build directory is one configuration; set up whichever you need: ```bash # debug: symbols, asserts, address + UB sanitizers $ meson setup build-debug --buildtype=debug -Db_sanitize=address,undefined # release: optimized, asserts still on $ meson setup build-release --buildtype=release # dist: optimized, asserts off (defines HSDBG_DIST), stripped $ meson setup build-dist --buildtype=release -Db_ndebug=true --strip ``` Build any of them with `ninja -C `. Two helper targets are also available: `ninja -C fetch-llvm` re-downloads the pinned LLVM, and `ninja -C cppcheck` runs static analysis against the generated `compile_commands.json` (analyze a `dist` build dir so cppcheck sees the code without the debug-only asserts and sanitizers). ## License hsdbg is released under the [MIT License](LICENSE).