( debuggerManager: DebuggerToolContext['debugger'], )
| 149 | } |
| 150 | |
| 151 | export function createDebugStackExecutor( |
| 152 | debuggerManager: DebuggerToolContext['debugger'], |
| 153 | ): NonStreamingExecutor<DebugStackParams, DebugStackResult> { |
| 154 | return async (params) => { |
| 155 | try { |
| 156 | const output = await debuggerManager.getStack(params.debugSessionId, { |
| 157 | threadIndex: params.threadIndex, |
| 158 | maxFrames: params.maxFrames, |
| 159 | }); |
| 160 | |
| 161 | return createDebugStackResult({ |
| 162 | didError: false, |
| 163 | threads: parseStackOutput(output, params), |
| 164 | }); |
| 165 | } catch (error) { |
| 166 | const diagnosticMessage = toErrorMessage(error); |
| 167 | return createDebugStackResult({ |
| 168 | didError: true, |
| 169 | error: 'Failed to get stack.', |
| 170 | diagnosticMessage, |
| 171 | }); |
| 172 | } |
| 173 | }; |
| 174 | } |
| 175 | |
| 176 | export async function debug_stackLogic( |
| 177 | params: DebugStackParams, |
no test coverage detected