Dbgee is a handy utility that allows you to launch CLI debuggers and VSCode debuggers from the debuggee side. Just start your program by a simple command in a terminal, and the debugger will automatically attach to it with zero configuration. Dbgee also has the ability to preconfigure your program to automatically start a debug session no matter how the program is started.
Dbgee is very useful especially when your program requires command line arguments or redirection, or when your program is launched by some script.
In addition, Dbgee frees you from the hassle of writing launch.json for VSCode.
Since the concept of Dbgee may be new to you, so here are some demos.
dbgee run -- ./cmdFind and attach to a process compiled from source files in the current directory, from all descendant processes of the given command
Linux only
dbgee run --hook-source-dir . -- ./any_run_scriptdbgee set commandThe current supported languages are C, C++, Rust, Go, Python and any languages which Gdb, LLDB, or CodeLLDB support.
- Linux x64 (including WSL2). Tested and built on ubuntu-latest of GitHub action
- macOS x64. Tested and built on macos-latest of GitHub action
There are two components, dbgee command and the optional VSCode extension.
curl -L -O https://github.com/nullpo-head/dbgee/releases/download/cli-v0.5.0/dbgee-linux-x64.tar.gz
tar xvf dbgee-linux-x64.tar.gz
mv dbgee /usr/local/bin/ # Or anywhere in the PATHcurl -L -O https://github.com/nullpo-head/dbgee/releases/download/cli-v0.5.0/dbgee-darwin-x64.tar.gz
tar xvf dbgee-darwin-x64.tar.gz
mv dbgee /usr/local/bin/ # Or anywhere in the PATHPlease install "Dbgee" extension from the marketplace.
Use run subcommand to launch your program and attach a proper debugger to it.
By the following command, the proper debugger for your program launches in a new tmux window.
dbgee run -- ./program arg0 arg1 arg2...You can manually specify your preferred debugger by the -d option.
dbgee run -d lldb -- ./program arg0 arg1 arg2...dbgee launches a debugger in a new tmux window unless you run dbgee in an integrated terminal in VSCode.
However, you can choose other options by specifying -t option. Please see the help for more information.
dbgee run -t tmuxw -- ./program arg0 arg1 arg2... # launch a debugger in a new tmux window instead of a windowdbgee launches the given debuggee and wait for VSCode to connect to your program
if dbgee is running in a VSCode's integrated terminal.
Run the following command, and attach to your program in VSCode as the demo videos.
dbgee run -- ./program arg0 arg1 arg2...Or, you can use -t vscode option to explicitly make dbgee wait for VSCode.
dbgee run -t vscode -- ./program arg0 arg1 arg2...set subcommand will automatically attach a debugger to your program, no matter by what means it is started.
This is a very useful feature when your program is launched by some start up scripts in your development flow.
However, please note that set command doesn't work if you rebuild your program after you run set,
or when your start up scripts incur rebuild, because set command works by replacing your program with a wrapper script.
dbgee set ./program
./program arg0 arg1 arg2 # your program is launched, being attached by the debuggerUse unset command to stop the debugger from attaching automatically
dbgee unset ./programIf you specify some to launch your program, dbgee automatically runs unset after your command finishes.
dbgee set ./program -- ./some_startup_script



