penagos / vgdb

Visual Studio Code GDB Debug Adapter for C and C++ programs.
MIT License
11 stars 3 forks source link

Marketplace Installs Rating

vGDB | Visual Studio Code GDB Debug Adapter

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

Features

Installation

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).

Quick Start

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:

EZ Setup

There is also a snippet for an attach request.

Configuration

These are all of the settings currently supported:

Launch Requests

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 terminal
true\|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 breakpoints
true\|false

Additional Notes

Attach Requests

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

Building from Source

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