debug_connect
Connect to a QEMU gdbstub and register the debugging session under a name, optionally loading an ELF for symbol and source-level breakpoints while the target stays halted.
Instructions
Connect to a gdbstub and register the session under name.
For QEMU, start it with -s (stub on tcp::1234) or -gdb tcp::PORT, and
add -S to halt the CPU before the first instruction so you can set
breakpoints before anything runs. With qemu-mcp, pass these via
qemu_boot's extra_args, e.g. extra_args="-s -S".
elf is the kernel image with symbols (and ideally DWARF debug info); it
enables symbol names, file:line breakpoints and source locations.
load_bias is added to every ELF address, for images loaded somewhere other
than their link address (0 for a normally linked kernel).
The target stays halted after connecting.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "debug_connect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elf | No | ||
| host | No | 127.0.0.1 | |
| name | Yes | ||
| port | No | ||
| load_bias | No | ||
| timeout_s | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |