How to use the vscode-debugadapter.StoppedEvent function in vscode-debugadapter

To help you get started, we’ve selected a few vscode-debugadapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github indiejames / vscode-clojure-debug / src / clojureDebug.ts View on Github external
this._debuggerState = DebuggerState.LAUNCH_COMPLETE;
					var debug = this;
					this._connection.send({op: 'list-threads'}, (err: any, result: any) => {
						console.log(result);
						this.updateThreads(result[0]["threads"]);

						console.log("Got threads");

					});

					if (args.stopOnEntry) {
						this._currentLine = 1;
						this.sendResponse(response);

						// we stop on the first line - TODO need to figure out what thread this would be and if we even want to support this
						this.sendEvent(new StoppedEvent("entry", ClojureDebugSession.THREAD_ID));
					} else {
						// we just start to run until we hit a breakpoint or an exception
						this.continueRequest(response, { threadId: ClojureDebugSession.THREAD_ID });
					}
				}

				if (this._debuggerState == DebuggerState.DEBUGGER_ATTACHED) {
					this._debuggerState = DebuggerState.REPL_READY;
				}

				if (this._debuggerState == DebuggerState.REPL_STARTED) {
					this._debuggerState = DebuggerState.DEBUGGER_ATTACHED;
				}

				this.handleREPLOutput(output);
github DonJayamanne / pythonVSCode / src / client / debugger / vs / VSDebugger.ts View on Github external
private onPythonException(pyThread: IPythonThread, ex: IPythonException) {
        this.sendEvent(new StoppedEvent("exception", pyThread.Id, `${ex.TypeName}, ${ex.Description}`));
        this.sendEvent(new OutputEvent(`${ex.TypeName}, ${ex.Description}\n`, "stderr"));
        // this.sendEvent(new StoppedEvent("breakpoint", pyThread.Id));
    }
    private onPythonThreadExited(pyThread: IPythonThread) {
github microsoft / vscode-go / src / debugAdapter / goDebug.ts View on Github external
for (let goroutine of goroutines) {
					// ...but delete from list of threads to stop if we still see it
					needsToBeStopped.delete(goroutine.id);
					if (!this.threads.has(goroutine.id)) {
						// Send started event if it's new
						this.sendEvent(new ThreadEvent('started', goroutine.id));
					}
					this.threads.add(goroutine.id);
				}
				// Send existed event if it's no longer there
				needsToBeStopped.forEach(id => {
					this.sendEvent(new ThreadEvent('exited', id));
					this.threads.delete(id);
				});

				this.sendEvent(new StoppedEvent(reason, this.debugState.currentGoroutine.id));
				log('StoppedEvent("' + reason + '")');
			});
		}
github DonJayamanne / pythonVSCode / src / client / debugger / vs / VSDebugger.ts View on Github external
private onBreakpointHit(pyThread: IPythonThread, breakpointId: number) {
        if (this.registeredBreakpoints.has(breakpointId)) {
            this.sendEvent(new StoppedEvent("breakpoint", pyThread.Id));
        }
        else {
            this.pythonProcess.SendResumeThread(pyThread.Id);
        }
    }
    protected setBreakPointsRequest(response: DebugProtocol.SetBreakpointsResponse, args: DebugProtocol.SetBreakpointsArguments): void {
github otris / vscode-janus-debug / src / debugSession.ts View on Github external
private reportStopped(reason: string, contextId: number): void {
        log.debug(`sending 'stopped' to VS Code`);
        this.sendEvent(new StoppedEvent(reason, contextId));
    }
}
github hsu2017 / luaide-lite / src / debugger / LuaDebug.ts View on Github external
function callBackFun(isstep, isover) {
			if (isstep) {
				that.sendEvent(new StoppedEvent("step", 1))
			}
		}
		try {
github forcedotcom / salesforcedx-vscode / packages / salesforcedx-apex-replay-debugger / src / adapter / apexReplayDebug.ts View on Github external
this.sendResponse(response);
    const prevNumOfFrames = this.logContext.getNumOfFrames();
    while (this.logContext.hasLogLines()) {
      this.logContext.updateFrames();
      const curNumOfFrames = this.logContext.getNumOfFrames();
      if (
        (stepType === Step.Over &&
          curNumOfFrames !== 0 &&
          curNumOfFrames <= prevNumOfFrames) ||
        (stepType === Step.In && curNumOfFrames >= prevNumOfFrames) ||
        (stepType === Step.Out &&
          curNumOfFrames !== 0 &&
          curNumOfFrames < prevNumOfFrames)
      ) {
        return this.sendEvent(
          new StoppedEvent('step', ApexReplayDebug.THREAD_ID)
        );
      }
      if (this.shouldStopForBreakpoint()) {
        return;
      }
    }
    this.sendEvent(new TerminatedEvent());
  }
github Dart-Code / Dart-Code / src / debug / dart_debug_impl.ts View on Github external
await this.evaluateAndSendErrors(thread, printCommand);
					}
				}
			} else if (kind === "PauseBreakpoint") {
				reason = "step";
			} else if (kind === "PauseException") {
				reason = "exception";
				exceptionText =
					event.exception
						? await this.fullValueAsString(event.isolate, event.exception)
						: undefined;
			}

			thread.handlePaused(event.atAsyncSuspension, event.exception);
			if (shouldRemainedStoppedOnBreakpoint) {
				this.sendEvent(new StoppedEvent(reason, thread.num, exceptionText));
			} else {
				thread.resume();
			}
		}
	}
github facebookarchive / atom-ide-ui / modules / nuclide-debugger-vsps / vscode-ocaml / OCamlDebugger.js View on Github external
_handleBreakpointHitEvent(breakpointId: string): Promise {
    this.sendEvent(new StoppedEvent('Breakpoint hit', THREAD_ID));
    return Promise.resolve();
  }
github DonJayamanne / pythonVSCode / src / client / debugger / pdb / debuggerMain.ts View on Github external
if (Array.isArray(result.consoleOutput) && result.consoleOutput.length > 0) {
            this.sendEvent(new OutputEvent(result.consoleOutput.join("\n") + "\n"));
        }
        if (Array.isArray(result.errors) && result.errors.length > 0) {
            this.sendErrorResponse(response, 1, result.errors.join("\n"));
            this.sendEvent(new StoppedEvent("exception", PythonDebugSession.THREAD_ID));
            return;
        }
        if (result.completed === true) {
            this.sendResponse(response);
            this.sendEvent(new TerminatedEvent());
            return;
        }

        this.sendResponse(response);
        this.sendEvent(new StoppedEvent(commandName, PythonDebugSession.THREAD_ID));
    }