GDB MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| gdb_init | 启动指定架构的GDB进程,默认使用aarch64交叉编译器。 参数:
示例:
|
| gdb_connect | 通过TCP连接到目标板的gdbserver或QEMU。 参数:
示例:
|
| gdb_disconnect | 优雅地断开与目标板的连接并终止GDB进程。会先发送detach命令通知gdbserver。 |
| gdb_load_program | 加载要调试的可执行文件及其符号表。 参数:
必须在连接目标板后调用此命令。 |
| gdb_run | 从程序入口点开始执行。程序将运行直到遇到断点或异常。 |
| gdb_continue | 从当前位置继续执行程序。程序将运行直到遇到断点或异常。 |
| gdb_step | 执行一行代码。如果当前行包含函数调用,将进入该函数内部。 |
| gdb_next | 执行一行代码。如果当前行包含函数调用,将跳过该函数(不进入内部)。 |
| gdb_finish | 继续执行直到当前函数返回。在返回点暂停。 |
| gdb_interrupt | 中断正在运行的程序。程序将暂停在当前位置。 |
| gdb_set_breakpoint | 在指定位置设置断点,支持条件断点和临时断点。 参数:
示例:
|
| gdb_delete_breakpoint | 删除指定编号的断点。 |
| gdb_list_breakpoints | 列出当前设置的所有断点及其详细信息(包括条件)。 |
| gdb_enable_breakpoint | 启用指定编号的断点。 |
| gdb_disable_breakpoint | 禁用指定编号的断点。 |
| gdb_set_condition | 为已有断点设置或修改条件表达式。 参数:
示例:
|
| gdb_read_memory | 从指定地址读取内存内容。 参数:
|
| gdb_list_registers | 获取目标架构的所有寄存器名称列表。 |
| gdb_read_registers | 读取指定寄存器的值,默认读取所有寄存器。 参数:
|
| gdb_write_register | 修改指定寄存器的值。 参数:
警告: 此操作可能影响程序执行状态。 |
| gdb_list_frames | 列出当前的调用栈帧信息。 |
| gdb_select_frame | 选择指定编号的栈帧,用于查看该层的局部变量。 参数:
|
| gdb_list_locals | 列出当前栈帧的局部变量及其值。 |
| gdb_list_arguments | 列出当前函数的参数及其值。 |
| gdb_evaluate_expression | 计算并返回表达式的值。 参数:
示例:
|
| gdb_list_threads | 列出当前程序的所有线程信息。 |
| gdb_select_thread | 切换到指定线程进行调试。 |
| gdb_get_current_location | 获取程序当前位置(源文件和行号)。 |
| gdb_list_source_files | 列出调试程序的所有源文件。 |
| gdb_disassemble | 反汇编当前函数或指定地址范围。 参数:
默认反汇编当前函数。 |
| gdb_command | 直接执行GDB Machine Interface (MI)命令。 参数:
示例:
高级用法:当其他工具不支持特定操作时使用。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
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/zjm1060/gdb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server