-
Notifications
You must be signed in to change notification settings - Fork 234
Fix attach to process debugging #1752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix attach to process debugging #1752
Conversation
Fixes PowerShell#1736 - Add a new context frame for runspace entrance and REPL loops - Ensure runspace access is not attempted on a broken runspace - When a remote runspace hits a debugger stop, ensure that the origin pipeline thread does not run a REPL concurrently - Fix many race conditions
If multiple Write-Host's exist then this test will fail. FilterText contains the module qualified name when dupes are present.
If the testing machine has a pester template installed the collection will have an extra item.
src/PowerShellEditorServices/Services/DebugAdapter/Handlers/LaunchAndAttachHandler.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/DebugAdapter/Handlers/LaunchAndAttachHandler.cs
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Execution/SynchronousPowerShellTask.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
&& (CurrentFrame.FrameType & PowerShellFrameType.Nested) is 0) | ||
{ | ||
_shouldExit = false; | ||
PopPowerShell(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we'll need to walk through the logic here and above together, it hurt my head 🤕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It hurt my head to write it if it makes you feel any better 😁
For real though, a lot of what made PSES complicated before was controlling for scenarios like this. One runspace is pretty easy, multiple is a lot harder. It's also what made it prone to dead locks and slowness.
The difference this time though is I wrote it in a way where the extra complexity only really has an effect when it has to. So the normal everyday debugging loop should be completely unaffected but we still get reliable attach debugging. Thankfully Rob's work made it much easier to write in this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Show resolved
Hide resolved
Sorrrry for merge conflicts. |
I'm excited to get this in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #1736
Keeping as draft for now as I have to fix probably a lot of merge conflictsWay less than I expected