Skip to content

Commit b44e07c

Browse files
committed
Add pause functionality to debugging tools and handlers
1 parent 1955bb1 commit b44e07c

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/controlServer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ export class ControlServer {
9191
return this.handler.handleStepOut();
9292
case 'handleContinue':
9393
return this.handler.handleContinue();
94+
case 'handlePause':
95+
return this.handler.handlePause();
9496
case 'handleRestart':
9597
return this.handler.handleRestart();
9698
case 'handleAddBreakpoint':

src/debugMCPServer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,7 @@ export class DebugMCPServer {
259259
// Pause execution tool
260260
server.registerTool('pause_execution', {
261261
description: 'Interrupt a running program and stop at its current location, even when no breakpoint is set. Useful for busy loops or embedded/bare-metal targets running freely — then inspect variables or step from where it stopped.',
262-
}, async () => {
263-
const result = await this.debuggingHandler.handlePause();
264-
return { content: [{ type: 'text' as const, text: result }] };
265-
});
262+
}, async () => this.runTool('pause_execution', () => debuggingHandler.handlePause()));
266263

267264
// Restart debugging tool
268265
server.registerTool('restart_debugging', {

src/routingDebuggingHandler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ export class RoutingDebuggingHandler implements IDebuggingHandler {
190190
return this.forward('handleContinue', {});
191191
}
192192

193+
public handlePause(): Promise<string> {
194+
return this.forward('handlePause', {});
195+
}
196+
193197
public handleRestart(): Promise<string> {
194198
return this.forward('handleRestart', {});
195199
}

src/test/routing.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class RecordingHandler implements IDebuggingHandler {
2424
handleStepInto() { return this.record('stepInto', {}); }
2525
handleStepOut() { return this.record('stepOut', {}); }
2626
handleContinue() { return this.record('continue', {}); }
27+
handlePause() { return this.record('pause', {}); }
2728
handleRestart() { return this.record('restart', {}); }
2829
handleAddBreakpoint(args: any) { return this.record('addBp', args); }
2930
handleRemoveBreakpoint(args: any) { return this.record('removeBp', args); }

0 commit comments

Comments
 (0)