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
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | GDB session ID |
Implementation Reference
- src/index.ts:936-976 (handler)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'] } },
- src/index.ts:258-267 (schema)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);