PowerShell / PowerShell/PowerShellEditorServices

Foreach -Parallel Breakpoints?

Open
#1,689 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Debugging Issue-Discussion
Dominant language
C#
Stars
767
Forks
266
Avg merge
3d 16h
Merged PRs (30d)
1

Description

Just thought I'd throw this discussion point out there.

If we know by the AST that someone is doing foreach -parallel, we are going to know the behavior. Can we hook into those created runspaces and drop breakpoints there, and then maybe monitor for them to go into InBreakpoint state and trigger the debugger there?

The net effect would be that users could put breakpoints in a Foreach -Parallel loop and expect it to break there for troubleshooting parallel runs, rather than the current procedure of removing -Parallel and any $USING references in order to debug.

Probably not feasible, lots of issues:

  1. How do we pause the other runspaces at the same time
  2. Have to fetch all the state and ensure it works the same thru all the existing tests
  3. etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. First determine where Foreach -Parallel creates and manages runspaces and how breakpoint and InBreakpoint state are handled. Done would require a defined design that supports breakpoints inside parallel loops while coordinating other runspaces and preserving existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.