Skip to main content
Glama

gdb_step

Step through program execution in a GDB debugging session by specifying instructions or source lines, enabling precise control over debugging processes.

Instructions

Step program execution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instructionsNoStep by instructions instead of source lines (optional)
sessionIdYesGDB session ID

Implementation Reference

  • The main execution logic for the gdb_step tool. Extracts sessionId and optional instructions flag from arguments, validates session exists, executes 'step' or 'stepi' GDB command via executeGdbCommand helper, and returns the output or error.
    private async handleGdbStep(args: any) { const { sessionId, instructions = false } = args; if (!activeSessions.has(sessionId)) { return { content: [ { type: 'text', text: `No active GDB session with ID: ${sessionId}` } ], isError: true }; } const session = activeSessions.get(sessionId)!; try { // Use stepi for instruction-level stepping, otherwise step const command = instructions ? "stepi" : "step"; const output = await this.executeGdbCommand(session, command); return { content: [ { type: 'text', text: `Stepped ${instructions ? 'instruction' : 'line'}\n\nOutput:\n${output}` } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text', text: `Failed to step: ${errorMessage}` } ], isError: true }; } }
  • Input schema validation for gdb_step tool parameters: requires sessionId (string), optional instructions (boolean).
    inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'GDB session ID' }, instructions: { type: 'boolean', description: 'Step by instructions instead of source lines (optional)' } }, required: ['sessionId']
  • src/index.ts:219-235 (registration)
    Registration of gdb_step tool in the ListToolsRequestSchema response, including name, description, and input schema.
    { name: 'gdb_step', description: 'Step program execution', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'GDB session ID' }, instructions: { type: 'boolean', description: 'Step by instructions instead of source lines (optional)' } }, required: ['sessionId'] }
  • src/index.ts:377-378 (registration)
    Routing registration in CallToolRequestSchema handler switch statement that maps 'gdb_step' calls to the handleGdbStep method.
    case 'gdb_step': return await this.handleGdbStep(request.params.arguments);

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/signal-slot/mcp-gdb'

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