diff --git a/.vscode/launch.json b/.vscode/launch.json index 7a4e2d0..b4fc450 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "--extensionDevelopmentPath=${workspaceFolder}/extension", "${workspaceFolder}/sampleWorkspace" ], - "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "outFiles": ["${workspaceFolder}/extension/dist/**/*.js"], "preLaunchTask": "npm: watch" }, { diff --git a/src/debugSession.ts b/src/debugSession.ts index 4f58f52..f02f7b2 100644 --- a/src/debugSession.ts +++ b/src/debugSession.ts @@ -93,8 +93,13 @@ export class AvmDebugSession extends DebugSession { this._runtime.on(RuntimeEvents.stopOnStep, () => { this.sendEvent(new StoppedEvent('step', AvmDebugSession.threadID)); }); - this._runtime.on(RuntimeEvents.stopOnBreakpoint, () => { - this.sendEvent(new StoppedEvent('breakpoint', AvmDebugSession.threadID)); + this._runtime.on(RuntimeEvents.stopOnBreakpoint, (breakpointID: number) => { + const event = new StoppedEvent( + 'breakpoint', + AvmDebugSession.threadID, + ) as DebugProtocol.StoppedEvent; + event.body.hitBreakpointIds = [breakpointID]; + this.sendEvent(event); }); this._runtime.on(RuntimeEvents.stopOnException, (message) => { this.sendEvent( diff --git a/src/runtime.ts b/src/runtime.ts index d6e6f90..6c4a6d4 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -301,7 +301,7 @@ export class AvmRuntime extends EventEmitter { ); if (bps.length !== 0) { // send 'stopped' event - this.sendEvent(RuntimeEvents.stopOnBreakpoint); + this.sendEvent(RuntimeEvents.stopOnBreakpoint, bps[0].id); // the following shows the use of 'breakpoint' events to update properties of a breakpoint in the UI // if breakpoint is not yet verified, verify it now and send a 'breakpoint' update event