A native typescript implementation of a debug adapter for GDB for use in Visual Studio Code. Tested on Linux, Windows support is untested. This extension is under active development
.gdbinit
You can either download vGDB from within VSCode's Extensions pane (recommended), get it from the Extension marketplace, download the latest bundled VSIX package from the releases section on GitHub or build from source (instructions below).
vGDB ships with a sample launch configuration snippet you can use to quickly get started. Assuming your executable is named a.out
, getting started is as easy as:
There is also a snippet for an attach request.
These are all of the settings currently supported:
Configuration Option | Required | Description |
---|---|---|
program |
Yes | Path to program to debug"path/to/executable" |
request |
Yes | Set this to launch |
args |
No | Array of arguments to pass to debuggee["arg1", "arg2", "arg3"] |
cwd |
No | The directory in which to start GDB"someOptionalDirectory" |
debug |
No | Verbosity of logging."off"\|"basic"\|"verbose" |
debugger |
No | Path to GDB executable"/absolute/path/to/gdb" |
debuggerArgs |
No | Array of arguments to pass to debugger["arg1", "arg2", "arg3"] |
env |
No | Key value pairs of environment variables to set in debugging shell{"name1": "value1", "name2": "value2"} |
externalConsole |
No | If set to false, debuggee will launch in Visual Studio Code terminaltrue\|false |
sharedLibraries |
No | Array of shared library names to load, disregards all other libraries["solib1.so", "solib2.so"] |
startupCmds |
No | Array of GDB commands to run at start["gdb_command", "gdb_command2"] |
useAbsoluteFilePaths |
No | If true (default), full filepaths will be used when setting breakpointstrue\|false |
sharedLibraries
configuration setting, your .gdbinit
setting for auto-solib-add
will be overwritten to be false
. The debug adapter will listen for shared library load events and only proceed to sharedlibrary <name>
if that file is in your whitelist.externalConsole
setting to true
, hitting CTRL+C
in the integrated terminal will not abort the debug target.startupCmds
commands will run after those in your .gdbinit
file have run.Configuration Option | Required | Description |
---|---|---|
program |
Yes | Path to program to debug |
request |
Yes | Set this to attach |
debug |
No | Verbosity of logging. Values are off , basic or verbose |
debugger |
No | Path to GDB executable |
useAbsoluteFilePaths |
No | If true (default), full filepaths will be used when setting breakpoints |
It's recommended that you use one of the published VSIX files on the releases tab, but you can also build the extension from source. To compile/package the extension yourself, you'll need to run the following commands:
npm install
vsce package
If you do not already have the vsce
NodeJS CLI tool installed, please see https://code.visualstudio.com/api/working-with-extensions/publishing-extension