Skip to content

Commit 87ece8a

Browse files
committed
More work to fix attach to process problems
1 parent d07fd5b commit 87ece8a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ await requestContext.SendError(
312312
return;
313313
}
314314

315-
// Stop the current read loop because the debugger
316-
// will start its own
317-
//this.editorSession.ConsoleService.CancelReadLoop();
318-
319315
// Execute the Debug-Runspace command but don't await it because it
320316
// will block the debug adapter initialization process. The
321317
// InitializedEvent will be sent as soon as the RunspaceChanged

src/PowerShellEditorServices/Console/ConsoleReadLine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ private void StartReadLoop()
397397
Task.Factory.StartNew(
398398
async () =>
399399
{
400-
// Set the thread's name to help with debugging
401-
Thread.CurrentThread.Name = "ConsoleReadLine Thread";
400+
// Set the thread's name to help with debugging
401+
Thread.CurrentThread.Name = "ConsoleReadLine Thread";
402402

403403
while (!this.readLoopCancellationToken.IsCancellationRequested)
404404
{

src/PowerShellEditorServices/Session/PowerShellContext.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,9 @@ private void OnDebuggerStop(object sender, DebuggerStopEventArgs e)
15391539
{
15401540
if (this.CurrentRunspace.Context == RunspaceContext.DebuggedRunspace)
15411541
{
1542+
// Notify listeners that the debugger has resumed
1543+
this.DebuggerResumed?.Invoke(this, DebuggerResumeAction.Stop);
1544+
15421545
// We're detached from the runspace now, send a runspace update.
15431546
this.PopRunspace();
15441547
}

0 commit comments

Comments
 (0)