Skip to content

Commit 50e1f14

Browse files
Заглушка при отсутствии процесса на attach
1 parent fc8c610 commit 50e1f14

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/VSCode.DebugAdapter/DebugeeProcess.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ public void Start()
8787
public void InitAttached()
8888
{
8989
var pid = _debugger.GetProcessId();
90-
_process = Process.GetProcessById(pid);
90+
91+
try
92+
{
93+
_process = Process.GetProcessById(pid);
94+
}
95+
catch (ArgumentException ex) when (ex.Message.Contains("is not running"))
96+
{
97+
_process = Process.GetCurrentProcess();
98+
}
99+
91100
_attachMode = true;
92101
_process.EnableRaisingEvents = true;
93102
_process.Exited += Process_Exited;

0 commit comments

Comments
 (0)