-
Notifications
You must be signed in to change notification settings - Fork 497
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
PowerShell attach removes existing breakpoints in attached session #4489
Comments
Unfortunately that's currently just how it works until we finish #4065. So consider this in progress! |
@andschwa Noted, thank you. Looking forward to the progress and improvements. FWIW, I believe (strongly) it used to work fine, breakpoints were not removed. That was my usual workflow - set breakpoints in the app, then start VSCode debugging. Granted, it was some time ago. Maybe newer versions are "not supposed to work" due to their new tech issues. |
Hard to say if/when the behavior changed. As far as I remember the debugger has always issued a "clear breakpoints" command on startup, but it's a project with a looong history. |
Some sort of proof, my user manual -- https://github.com/nightroman/FarNet/tree/main/PowerShellFar#debugging
|
Updated the manual and gave the users some hope :)
|
Yes I think at one point it "worked" in that it just didn't try to manage breakpoints in the remote session at all. Or at most just repeatedly set the same breakpoints every time you attached. I know it's not the best for your scenario but the old behavior leads to some pretty wonky UX if you are trying to set breakpoints in the UI. As Andy said though, #4065 should make the behavior more consistent (and I'll be returning to it shortly). I don't think I touch existing breakpoints in remote sessions. |
FWIW, PowerShellFar (Far Manager PS host) takes care of breakpoint updates via events, i.e. breakpoints set by a user in UI, or by commands, or, as I can see, even set in VSCode after attaching the debugger. |
Then once that PR is in, breakpoints should automatically sync in both UI's regardless of where they're added 🤞 |
Anyway, it's good to know that issue is known and addressed, one way or another. I'll adjust. |
Hello, with the recent development on fixing the debugger (https://github.com/PowerShell/vscode-powershell/releases/tag/v2024.3.0-preview), is there any chance this issue gets some progress? |
That work is happening with #4065 which is still in progress. |
@andyleejordan It looks a little stagnated though, for a not involved observer. But I hope that "in progress" is the true status and I look forward for the fix. This is needed for some known practical scenarios, when BPs are set in a custom IDE before starting VSCode debugging. |
FWIW, not complaining about anything, but please take a look at the manual for my users on using VSCode PowerShell debugger. You might and should be interested in the section "Known issues" (4). It's a lot of pain to make it working, apart from configuring, and IMHO many users will never enjoy VSCode PowerShell debugging by attaching (which actually works at this point, wow!). https://github.com/nightroman/FarNet/wiki/PowerShellFar-debugging |
@nightroman it's a very tricky PR and @SeeminglyScience who owns it has been on leave for a bit. It is moving forward however. |
|
{ |
Prerequisites
Summary
I use VSCode PowerShell debugger by attaching to a process hosting PowerShell.
Attaching removes breakpoints that I have already set in my session.
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
(1) Invoke the below script
test1.ps1
in some PowerShell session. E.g. I used and saw the problem in powershell and pwsh consoles and in my application hosting PowerShell as well.(2) Run
Get-PSBreakpoint
-- see 2 breakpoints(3) In VSCode, launch/attach PowerShell debugger configured as below.
Select the target process where we have set 2 breakpoints.
(4) With the debugger attached, run
Get-PSBreakpoint
again -- see that breakpoints are gone.Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: