Skip to main content
Glama

gdb_finish

Execute until the current function returns in a GDB debugging session. Simplify debugging by automatically stepping through code to the end of the function without manual intervention.

Instructions

Execute until the current function returns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesGDB session ID

Implementation Reference

  • The main handler function for the 'gdb_finish' tool. It validates the session ID, retrieves the GDB session, executes the 'finish' GDB command via executeGdbCommand, and returns the output or error response.
    private async handleGdbFinish(args: any) { const { sessionId } = 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 { const output = await this.executeGdbCommand(session, "finish"); return { content: [ { type: 'text', text: `Finished current function\n\nOutput:\n${output}` } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: 'text', text: `Failed to finish function: ${errorMessage}` } ], isError: true }; } }
  • src/index.ts:255-268 (registration)
    Tool registration in the ListTools response. Defines the name 'gdb_finish', description, and input schema requiring 'sessionId'.
    { name: 'gdb_finish', description: 'Execute until the current function returns', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'GDB session ID' } }, required: ['sessionId'] } },
  • Input schema for 'gdb_finish' tool, specifying an object with required 'sessionId' string property.
    inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'GDB session ID' } }, required: ['sessionId'] }
  • src/index.ts:381-382 (registration)
    Registration/dispatch in the CallToolRequestHandler switch statement that routes 'gdb_finish' calls to the handleGdbFinish method.
    case 'gdb_finish': return await this.handleGdbFinish(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