|
1 | 1 | import * as fs from "fs"; |
2 | 2 | import * as path from "path"; |
3 | | -import { CapabilitiesEvent, DebugSession, Event, InitializedEvent, OutputEvent, Scope, Source, StackFrame, StoppedEvent, TerminatedEvent } from "vscode-debugadapter"; |
| 3 | +import { DebugSession, Event, InitializedEvent, OutputEvent, Scope, Source, StackFrame, StoppedEvent, TerminatedEvent } from "vscode-debugadapter"; |
4 | 4 | import { DebugProtocol } from "vscode-debugprotocol"; |
5 | 5 | import { config } from "../extension/config"; |
6 | 6 | import { notUndefined } from "../extension/utils"; |
@@ -98,6 +98,7 @@ export class DartDebugSession extends DebugSession { |
98 | 98 | response.body.supportsConditionalBreakpoints = true; |
99 | 99 | response.body.supportsLogPoints = true; |
100 | 100 | response.body.supportsTerminateRequest = true; |
| 101 | + response.body.supportsRestartFrame = true; |
101 | 102 | response.body.exceptionBreakpointFilters = [ |
102 | 103 | { filter: "All", label: "All Exceptions", default: false }, |
103 | 104 | { filter: "Unhandled", label: "Uncaught Exceptions", default: true }, |
@@ -140,9 +141,6 @@ export class DartDebugSession extends DebugSession { |
140 | 141 | this.logFile = args.observatoryLogFile; |
141 | 142 | this.maxLogLineLength = args.maxLogLineLength; |
142 | 143 |
|
143 | | - if (args.previewDebuggerStepBack) |
144 | | - this.sendEvent(new CapabilitiesEvent({ supportsStepBack: true })); |
145 | | - |
146 | 144 | this.sendResponse(response); |
147 | 145 |
|
148 | 146 | this.childProcess = this.spawnProcess(args); |
@@ -1093,15 +1091,21 @@ export class DartDebugSession extends DebugSession { |
1093 | 1091 | }).catch((error) => this.errorResponse(response, `${error}`)); |
1094 | 1092 | } |
1095 | 1093 |
|
1096 | | - protected stepBackRequest(response: DebugProtocol.StepBackResponse, args: DebugProtocol.StepBackArguments): void { |
1097 | | - const thread = this.threadManager.getThreadInfoFromNumber(args.threadId); |
1098 | | - if (!thread) { |
1099 | | - this.errorResponse(response, `No thread with id ${args.threadId}`); |
| 1094 | + protected restartFrameRequest(response: DebugProtocol.RestartFrameResponse, args: DebugProtocol.RestartFrameArguments): void { |
| 1095 | + const frameId = args.frameId; |
| 1096 | + // const context: string = args.context; // "watch", "repl", "hover" |
| 1097 | + |
| 1098 | + if (!frameId) { |
| 1099 | + this.errorResponse(response, "global evaluation not supported"); |
1100 | 1100 | return; |
1101 | 1101 | } |
1102 | | - thread.resume("Rewind").then((_) => { |
| 1102 | + |
| 1103 | + const data = this.threadManager.getStoredData(frameId); |
| 1104 | + const thread = data.thread; |
| 1105 | + const frame: VMFrame = data.data as VMFrame; |
| 1106 | + |
| 1107 | + thread.resume("Rewind", frame.index).then((_) => { |
1103 | 1108 | this.sendResponse(response); |
1104 | | - this.requestCoverageUpdate("rewind"); |
1105 | 1109 | }).catch((error) => this.errorResponse(response, `${error}`)); |
1106 | 1110 | } |
1107 | 1111 |
|
|
0 commit comments