gdb_list_sessions
List all active GDB debugging sessions on the MCP GDB Server to manage and monitor ongoing debugging processes efficiently.
Instructions
List all active GDB sessions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:642-657 (handler)Handler function that lists all active GDB sessions by converting the activeSessions Map to an array of session objects (id, target, workingDir) and returns a formatted text response with JSON stringified sessions.private async handleGdbListSessions() { const sessions = Array.from(activeSessions.entries()).map(([id, session]) => ({ id, target: session.target || 'No program loaded', workingDir: session.workingDir || process.cwd() })); return { content: [ { type: 'text', text: `Active GDB Sessions (${sessions.length}):\n\n${JSON.stringify(sessions, null, 2)}` } ] }; }
- src/index.ts:135-142 (schema)Tool schema definition including name, description, and empty input schema (no parameters required).{ name: 'gdb_list_sessions', description: 'List all active GDB sessions', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:367-368 (registration)Switch case registration in CallToolRequestSchema handler that routes 'gdb_list_sessions' tool calls to the handleGdbListSessions method.case 'gdb_list_sessions': return await this.handleGdbListSessions();