镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix attach to process debugging - #1752

Merged
Andy Jordan (andyleejordan) merged 14 commits into
PowerShell:masterfrom
SeeminglyScience:SeeminglyScience/issue1736
Apr 18, 2022
Merged

Andy Jordan (andyleejordan) merged 14 commits into
PowerShell:masterfrom
SeeminglyScience:SeeminglyScience/issue1736

Conversation

@SeeminglyScience

@SeeminglyScience Patrick Meinecke (SeeminglyScience) commented Apr 11, 2022 •

Copy link
Copy Markdown
Collaborator

Fixes #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

Keeping as draft for now as I have to fix probably a lot of merge conflicts Way less than I expected

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
@ghost ghost added Area-Debugging Issue-Bug A bug to squash. labels Apr 11, 2022
@SeeminglyScience Patrick Meinecke (SeeminglyScience) changed the title WIP: Fix attach to process Fix attach to process Apr 12, 2022
@SeeminglyScience
Patrick Meinecke (SeeminglyScience) marked this pull request as ready for review April 12, 2022 13:57
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.
Comment thread PowerShellEditorServices.build.ps1
Comment thread src/PowerShellEditorServices/Server/PsesDebugServer.cs
Comment thread src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs Outdated
Comment thread src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs Outdated
&& (CurrentFrame.FrameType & PowerShellFrameType.Nested) is 0)
{
_shouldExit = false;
PopPowerShell();

Copy link
Copy Markdown
Member

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 🤕

Copy link
Copy Markdown
Collaborator Author

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@andyleejordan

Copy link
Copy Markdown
Member

Sorrrry for merge conflicts.

@andyleejordan

Copy link
Copy Markdown
Member

I'm excited to get this in!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@andyleejordan Andy Jordan (andyleejordan) changed the title Fix attach to process Fix attach to process debugging Apr 18, 2022
@andyleejordan
Andy Jordan (andyleejordan) merged commit 843d66d into PowerShell:master Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix attach to process debugging

2 participants