mcp-gdb
v0.1.3MCP server for GDB debugging functionality
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
gdb_start
Start a new GDB session
| Parameter | Type | Description |
|---|---|---|
gdbPath | string | Path to the GDB executable (optional, defaults to "gdb") |
workingDir | string | Working directory for GDB (optional) |
gdb_load
Load a program into GDB
| Parameter | Type | Description |
|---|---|---|
program * | string | Path to the program to debug |
sessionId * | string | GDB session ID |
arguments | array | Command-line arguments for the program (optional) |
gdb_command
Execute a GDB command
| Parameter | Type | Description |
|---|---|---|
command * | string | GDB command to execute |
sessionId * | string | GDB session ID |
gdb_terminate
Terminate a GDB session
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
gdb_list_sessions
List all active GDB sessions
gdb_attach
Attach to a running process
| Parameter | Type | Description |
|---|---|---|
pid * | number | Process ID to attach to |
sessionId * | string | GDB session ID |
gdb_load_core
Load a core dump file
| Parameter | Type | Description |
|---|---|---|
corePath * | string | Path to the core dump file |
program * | string | Path to the program executable |
sessionId * | string | GDB session ID |
gdb_set_breakpoint
Set a breakpoint
| Parameter | Type | Description |
|---|---|---|
location * | string | Breakpoint location (e.g., function name, file:line) |
sessionId * | string | GDB session ID |
condition | string | Breakpoint condition (optional) |
gdb_continue
Continue program execution
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
gdb_step
Step program execution
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
instructions | boolean | Step by instructions instead of source lines (optional) |
gdb_next
Step over function calls
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
instructions | boolean | Step by instructions instead of source lines (optional) |
gdb_finish
Execute until the current function returns
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
gdb_backtrace
Show call stack
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
full | boolean | Show variables in each frame (optional) |
limit | number | Maximum number of frames to show (optional) |
gdb_print
Print value of expression
| Parameter | Type | Description |
|---|---|---|
expression * | string | Expression to evaluate |
sessionId * | string | GDB session ID |
gdb_examine
Examine memory
| Parameter | Type | Description |
|---|---|---|
expression * | string | Memory address or expression |
sessionId * | string | GDB session ID |
count | number | Number of units to display |
format | string | Display format (e.g., "x" for hex, "i" for instruction) |
gdb_info_registers
Display registers
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
register | string | Specific register to display (optional) |
gdb_list_source
List source code at current location or specified location, with VS Code integration
| Parameter | Type | Description |
|---|---|---|
sessionId * | string | GDB session ID |
lineCount | number | Number of lines to show (optional, default is 10) |
location | string | Source location (e.g., function name, file:line, optional) |