Issue:
When application is finished, VSCode still hangs like it is debugging the
process. That happens because VSCode doesn't emit Disconnect when Exit
message is received and Terminated is never sent.
Now it is sent:
- on Disconnect when application is supposed to be detached;
- on application finish, together with exit event.
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
m_debugger.m_evaluator.NotifyEvalComplete(nullptr, nullptr);
m_debugger.m_protocol->EmitExitedEvent(ExitedEvent(0));
m_debugger.NotifyProcessExited();
+ m_debugger.m_protocol->EmitTerminatedEvent();
return S_OK;
}
}
if (!terminate)
- return DetachFromProcess();
-
- HRESULT Status = TerminateProcess();
- if (SUCCEEDED(Status))
- m_protocol->EmitTerminatedEvent();
+ {
+ HRESULT Status = DetachFromProcess();
+ if (SUCCEEDED(Status))
+ m_protocol->EmitTerminatedEvent();
+ return Status;
+ }
- return Status;
+ return TerminateProcess();
}
HRESULT ManagedDebugger::SetupStep(ICorDebugThread *pThread, Debugger::StepType stepType)