step_into
Execute debugging by stepping into function calls during PHP application debugging with Xdebug, allowing detailed inspection of code execution flow.
Instructions
Step into the next function call, or to the next line if not a function call. This follows execution into called functions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Session ID |
Implementation Reference
- src/tools/execution.ts:78-123 (handler)The handler function for the 'step_into' MCP tool. It resolves the debug session, calls session.stepInto(), and returns a formatted text response with status, file, line, or error.async ({ session_id }) => { const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } try { const result = await session.stepInto(); return { content: [ { type: 'text', text: JSON.stringify({ status: result.status, file: result.file, line: result.line, message: result.status === 'break' ? `Stepped to ${result.file}:${result.line}` : `Status: ${result.status}`, }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Step into failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; }
- src/tools/execution.ts:76-77 (schema)Input schema for the 'step_into' tool: optional session_id string.session_id: z.string().optional().describe('Session ID'), },
- src/tools/execution.ts:72-125 (registration)MCP server.tool registration for the 'step_into' tool, including name, description, schema, and handler.server.tool( 'step_into', 'Step into the next function call, or to the next line if not a function call. This follows execution into called functions.', { session_id: z.string().optional().describe('Session ID'), }, async ({ session_id }) => { const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } try { const result = await session.stepInto(); return { content: [ { type: 'text', text: JSON.stringify({ status: result.status, file: result.file, line: result.line, message: result.status === 'break' ? `Stepped to ${result.file}:${result.line}` : `Status: ${result.status}`, }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Step into failed', message: error instanceof Error ? error.message : String(error), }), }, ], }; } } );
- src/session/session.ts:292-295 (helper)DebugSession.stepInto() method: sends DBGP 'step_into' command and handles response.async stepInto(): Promise<{ status: DebugStatus; file?: string; line?: number }> { const response = await this.connection.sendCommand('step_into'); return this.handleStepResponse(response); }
- src/session/session.ts:316-334 (helper)Shared helper method to process responses from step commands, extracting status, file, and line.private handleStepResponse(response: DbgpResponse): { status: DebugStatus; file?: string; line?: number; } { const status = response.status || 'break'; this.status = status; if (response.message) { this.currentFile = response.message.filename; this.currentLine = response.message.lineno; } return { status, file: this.currentFile, line: this.currentLine, }; }