-
Notifications
You must be signed in to change notification settings - Fork 500
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
Breakpoints cannot be removed when debugger isn't running #625
Comments
Yep, you'll need verbose logs on to see anything useful. |
I have the same issue. |
I have the same issue, and it looks like some kind of caching issue with the interactive console. As well as breakpoints still being hit, even after being removed, I also experience problems with edits to other files not being registered in the debugger. Maybe easier to explain what I've done. I have a module project I'm working on, and I create a new pester test for a new function. that checks to see if the command exists, I run the test through the Invoke-Pester launch spec: I also noticed a few days back, that I wrote a failing test for a new feature in a function, and then implemented that feature in my code and the test carried on failing as above. So I added a breakpoint in my function to see what was happening, and as I stepped through, it jumped over all the new code that I had added. Again, after a restart of vscode, it started working again. I'm not too keen on attaching the logs here, as it's a work related module I'm working on, but I can send them over email if you need them. |
Here is the logfile after doing the steps I mentioned in the issue description: https://paste.fedoraproject.org/paste/eSQSvfw~dM644dZXcIJnPV5M1UNdIGYhyRLivL9gydE=/raw |
Good catch! Just reproed this. For now the workaround is that you should only remove breakpoints when the debugger is running. If you remove them when the status bar isn't orange (debugging isn't active), they'll still be there the next time you debug. This issue is caused by how and when VS Code sends breakpoint information to the PowerShell debugger. Here's what's actually happening:
So the problem here is that I don't get notified of breakpoint changes when VS Code's debugger isn't running. I only get notified of the user's current breakpoints when the debugger is started again, and only if at least one breakpoint is active. The ultimate solution is to be more intelligent about breakpoint management on my side. With proper breakpoint state mapping, I can infer which breakpoints have been removed since the last time the debugger was started. This will take a bit of work so it might not come in 0.12.0 this week but potentially in a patch update in the following week. Sorry for the trouble! |
Before we start the debugger, we could clear all breakpoints in the session. That would fix this issue but would be problematic for the (corner) case of someone manually setting a breakpoint at the console. I guess this could be another setting - |
Would it be possible to have a breakpoint created in VSCode once someone sets one within integrated console? |
I don't think we need any extra configuration, we just need to be more aware of the breakpoints that are already set when debugging starts. I've got a design in mind that should make this pretty seamless, I'll give it a shot soon. Yep, breakpoints set in the console should show up in the VS Code UI, I'll make sure that happens too. |
Keep in mind that the VSCode Debug UI doesn't have a "data" breakpoint type yet which is one of the few reasons why you'd want to set a breakpoint in the console. |
And breakpoints removed via the console should be removed from the UI as well, right? How about breakpoints that are modified from the console? I guess that would just look like a |
Turns out that even if I implement the proper breakpoint sync logic on the server side, VS Code isn't capable of reacting to the BreakpointEvent that would allow me to update the editor's UI once the debugger starts. I'm going to submit a PR to VS Code to make this work then I'll merge the PSES work once VS Code is capable of handling that event correctly. The VS Code limitation is tracked here: microsoft/vscode#8642 |
I have the same issue. |
still in 1.43. Is the fix planned for 1.5.1? |
Yes, but there's no ETA for when 1.5 or 1.5.1 will be released. The team is busy on some internal compliance work right now so we won't have time to work on larger features or issues for a while. |
This change ensures that the breakpoints the user has in their runspace correspond to the list of breakpoints that are enabled in the debug adapter client. Resolves PowerShell/vscode-powershell#625
This change ensures that the breakpoints the user has in their runspace correspond to the list of breakpoints that are enabled in the debug adapter client. Resolves PowerShell/vscode-powershell#625
System Details
$PSVersionTable
:Issue Description
Somehow I still hit breakpoints even after I remove them and start debugging again.
For reproducing, I add a simple breakpoint:
Then I stop debugging, remove the breakpoint by clicking the red circle, and I start debugging again. I still hit the breakpoint:
Get-PSBreakPoint
shows that it still exists:Logs don't seem to contain any useful information, but if helpful I'll turn on verbose logging and attach those.Update: Log when repeating stepsThe text was updated successfully, but these errors were encountered: