Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GDB_PATHNoSpecify the path to the GDB executable to use. Default: gdb (resolved via system PATH).gdb
GDB_MCP_LOG_LEVELNoSet the logging level for the server. Options: DEBUG, INFO, WARNING, ERROR, CRITICAL. Default: INFO.INFO

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
gdb_start_sessionA

Start a new GDB debugging session. Can load an executable, core dump, or run custom initialization commands. Automatically detects and reports important warnings such as: missing debug symbols (not compiled with -g), file not found, or invalid executable. Check the 'warnings' field in the response for critical issues that may affect debugging. Available parameters: program (executable path), args (program arguments), core (core dump path - uses --core flag for proper symbol resolution), init_commands (GDB commands to run after loading), env (environment variables), gdb_path (GDB binary path), working_dir (directory to run program from). IMPORTANT for core dump debugging: Set 'sysroot' and 'solib-search-path' AFTER loading the core (either via 'core' parameter or 'core-file' init_command) for symbols to resolve correctly. Returns a session_id integer that must be passed to all other GDB tools.

gdb_execute_commandA

Execute a GDB command. Supports both CLI and MI commands. CLI commands (like 'info breakpoints', 'list', 'print x') are automatically handled and their output is formatted for readability. Multi-line commands (like 'commands', 'define', 'python') are supported; separate lines with \n. MI commands (starting with '-', like '-break-list', '-exec-run') return structured data. NOTE: For calling functions in the target process, prefer using the dedicated gdb_call_function tool instead of 'call' command, as it provides better structured output and can be separately permissioned. Common examples: 'info breakpoints', 'info threads', 'run', 'print variable', 'list main', 'disassemble func'. Requires session_id parameter (obtained from gdb_start_session).

gdb_get_statusB

Get the current status of the GDB session. Requires session_id parameter (obtained from gdb_start_session).

gdb_get_threadsA

Get information about all threads in the debugged process, including thread IDs, states, and the current thread. Requires session_id parameter (obtained from gdb_start_session).

gdb_select_threadA

Select a specific thread to make it the current thread. After selecting a thread, subsequent commands like gdb_get_backtrace, gdb_get_variables, and gdb_evaluate_expression will operate on this thread. Use gdb_get_threads to see available thread IDs. Requires session_id parameter (obtained from gdb_start_session).

gdb_get_backtraceB

Get the stack backtrace for a specific thread or the current thread. Shows function calls, file locations, and line numbers. Requires session_id parameter (obtained from gdb_start_session).

gdb_select_frameA

Select a specific stack frame to make it the current frame. Frame 0 is the innermost (current) frame, higher numbers are outer frames. After selecting a frame, commands like gdb_get_variables and gdb_evaluate_expression will operate in the context of that frame. Use gdb_get_backtrace to see available frames and their numbers. Requires session_id parameter (obtained from gdb_start_session).

gdb_get_frame_infoA

Get information about the current stack frame. Returns details about the currently selected frame including function name, file location, line number, and address. Use gdb_select_frame to change the current frame first if needed. Requires session_id parameter (obtained from gdb_start_session).

gdb_set_breakpointA

Set a breakpoint at a function, file:line, or address. Supports conditional breakpoints and temporary breakpoints. Supports hardware-assisted breakpoints with hardware=true. Returns breakpoint details including number, address, and location. Use gdb_list_breakpoints to verify breakpoints were set correctly. Requires session_id parameter (obtained from gdb_start_session).

gdb_list_breakpointsA

List all breakpoints as structured data with detailed information. Returns an array of breakpoint objects, each containing: number, type, enabled status, address, function name, source file, line number, and hit count. Use this to verify breakpoints were set correctly, check which have been hit (times field), and inspect their exact locations. Much easier to filter and analyze than text output. Requires session_id parameter (obtained from gdb_start_session).

gdb_delete_breakpointA

Delete a breakpoint by its number. Use gdb_list_breakpoints to see breakpoint numbers. Once deleted, the breakpoint cannot be recovered. Requires session_id parameter (obtained from gdb_start_session).

gdb_enable_breakpointA

Enable a previously disabled breakpoint by its number. Enabled breakpoints will pause execution when hit. Requires session_id parameter (obtained from gdb_start_session).

gdb_disable_breakpointA

Disable a breakpoint by its number without deleting it. Disabled breakpoints are not hit but remain in the breakpoint list. Use gdb_enable_breakpoint to re-enable it later. Requires session_id parameter (obtained from gdb_start_session).

gdb_continueA

Continue execution of the program until next breakpoint or completion. IMPORTANT: Only use this when the program is PAUSED (e.g., at a breakpoint). If the program hasn't been started yet, use gdb_execute_command with 'run' instead. If the program is already running, this will fail - use gdb_interrupt to pause it first. Requires session_id parameter (obtained from gdb_start_session).

gdb_stepA

Step into the next instruction (enters function calls). IMPORTANT: Only works when program is PAUSED at a specific location. Use this for single-stepping through code to debug line-by-line. Requires session_id parameter (obtained from gdb_start_session).

gdb_nextA

Step over to the next line (doesn't enter function calls). IMPORTANT: Only works when program is PAUSED at a specific location. Use this to step over function calls without entering them. Requires session_id parameter (obtained from gdb_start_session).

gdb_interruptA

Interrupt (pause) a running program. Use this when: 1) The program is running and hasn't hit a breakpoint, 2) You want to pause execution to inspect state or set breakpoints, 3) The program appears stuck or you want to see where it is. After interrupting, you can use other commands like gdb_get_backtrace, gdb_get_variables, or gdb_continue. Requires session_id parameter (obtained from gdb_start_session).

gdb_evaluate_expressionA

Evaluate a C/C++ expression in the current context and return its value. Can access variables, dereference pointers, call functions, etc. Requires session_id parameter (obtained from gdb_start_session).

gdb_get_variablesB

Get local variables for a specific stack frame in a thread. Requires session_id parameter (obtained from gdb_start_session).

gdb_get_registersA

Get CPU register values for the current frame. Requires session_id parameter (obtained from gdb_start_session).

gdb_stop_sessionA

Stop the current GDB session and clean up resources. Requires session_id parameter (obtained from gdb_start_session).

gdb_call_functionA

Call a function in the target process. WARNING: This is a privileged operation that executes code in the debugged program. It can call any function accessible in the current context, including: - Standard library functions: printf, malloc, free, etc. - Program functions: any function defined in the program - System calls via wrappers The function executes with full privileges of the debugged process. Use with caution as it may have side effects and modify program state. Examples: 'printf("debug: x=%d\n", x)', 'my_cleanup_func()', 'strlen(str)'. Requires session_id parameter (obtained from gdb_start_session).

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/airfloats/gdb_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server