提交 8236d1e9 编写于 作者: I isidor

debug: simplify transition to running state

上级 cc1d40a7
......@@ -490,7 +490,7 @@ export class Process implements debug.IProcess {
}
public getId(): string {
return this._session.getId();;
return this._session.getId();
}
public rawUpdate(data: debug.IRawModelUpdate): void {
......
......@@ -904,19 +904,8 @@ export class DebugService implements debug.IDebugService {
private transitionToRunningState(session: RawDebugSession, threadId?: number): void {
this.model.clearThreads(session.getId(), false, threadId);
// TODO@Isidor remove this mess
// Get a top stack frame of a stopped thread if there is any.
const process = this.model.getProcesses().filter(p => p.getId() === session.getId()).pop();
const stoppedThread = process && process.getAllThreads().filter(t => t.stopped).pop();
const callStack = stoppedThread ? stoppedThread.getCachedCallStack() : null;
const stackFrameToFocus = callStack && callStack.length > 0 ? callStack[0] : null;
if (!stoppedThread && process) {
this.setStateAndEmit(session.getId(), process.session.requestType === debug.SessionRequestType.LAUNCH_NO_DEBUG ? debug.State.RunningNoDebug : debug.State.Running);
}
this.setFocusedStackFrameAndEvaluate(stackFrameToFocus).done(null, errors.onUnexpectedError);
this.setStateAndEmit(session.getId(), session.requestType === debug.SessionRequestType.LAUNCH_NO_DEBUG ? debug.State.RunningNoDebug : debug.State.Running);
this.setFocusedStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError);
}
private getDebugStringEditorInput(process: debug.IProcess, source: Source, value: string, mtype: string): DebugStringEditorInput {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册