-
Notifications
You must be signed in to change notification settings - Fork 510
VSCode stops processing 'Start Debugging' #2175
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
Comments
Thanks for opening an issue @PrzemyslawKlys. Can I ask what you mean by "stopping" here? Would you be able to attach a GIF maybe of the process occurring? Is it a crash, or is debugging just ending unexpectedly? Or is it hanging? There's a strange sequence I've observed in some logs recently where VSCode sends us a debugger shutdown message. It's likely in response to something we do, but it's a new change in VSCode and we haven't worked out what's going on there yet. |
Generally it works in a way where I press F5 wait for script to finish, fix something, run again and again and randomly (sometimes after 2 minutes, sometimes after 2 hours) F5 just stops responding. Nothing is happening when pressed. You have to restart session to continue. But it's not crashed. Just not responding. To me it looks like I pressed F5 and it did register it and started executing in the background but it didn't inform the GUI and at that point The debug session is running on it's own. But that’s just a noob guess. |
Yeah that sounds familiar. Well @TylerLeonhardt's been working hard on some big changes here, so we should have something new to try in the next few weeks hopefully. |
I am also getting affected by this issue again; resulting in frequent "nostalgic" use of the ISE 😯 Is there a min version of PowerShell 5 we should be using? PSVersion 5.1.18362.145 |
PowerShell 5.1 should work. What version of the .NET Framework do you have installed just so we know? The next preview extension release will have the refactor that @rjmholt mentioned. I'd love to hear what you folks have to say when that drops. |
I can give it a go, however if it will have problems with PSReadline it's a bit useless. |
regedit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1033 it show for Release key: 528040 which is .NET framework 4.8 ( probably through windows update) . I am happy to test the refactor ( hopefully PSReadline support is stable) . At the end of the day I just want to get to the bottom of the debug "suspended animation" I like others seem to be experiencing |
Ok just took a look through the logs again and it's not clear just yet what the issue is. We're hoping to get the new version of debugging stack out soon as a preview release (it's just waiting on some upstream logging work so we can find bugs better) so when that's out it may well solve this issue |
Just to add a new version, preview one didn't fix the issue. I still press F5 and nothing happens. What's worse is that there's no progress anymore on PowerShell script (as in the bottom information that script is running is not there in preview - or at least it doesn't show very often). |
@PrzemyslawKlys you prompted me to test out PowerShell Preview 2019.110 and for the first time against a script with a breakpoint actually displays the top "step over / in" tool bar. I haven't seen that in weeks; even with two line scripts! Will still need to do a lot more testing as I am not convinced anything has changed. BTW nothing showing about the script running on footer toolbar in this scenario. |
Purpose of the release is explained here. @westerdaled are you experiencing the issue you describe here, or is it that you have completions and the integrated console but F5 doesn't work?
@PrzemyslawKlys do you mean F5 never works, or that it stops working after some time (as you reported initially). Can you both please load the preview extension, try F5 and send through the logs? |
It works, randomly stops. But it didnt change at all. |
Ok good to know. I think I just managed to reproduce this as well, so we are a step closer fixing it (if I can hit it again). |
Ok, I think my repro of this only happens when I artificially stop PSES in the debugger, get the PS extension to stop debugging, and resume PSES. I'm not sure how this would occur in a normal scenario, but I can't reproduce it without the debugger. When I did get it into that state, we don't even get to the point of handling the |
@westerdaled when you describe something showing the script running in the footer bar (VSCode's status bar) what do you mean? |
@rjmholt In stable there's a spinning arrow when a script is running: but preview doesn't show this: Interestingly it doesn't show that in 2019.9.0 either and apparently I never noticed it was missing. |
Btw. during debugging if you do some longer running code (press F9 on first Write-Host) and you let it go... it will not show running PowerShell progress anymore. It will silently continue. function Get-myTest {
[alias('Get-WinADGPOSysvol')]
[cmdletBinding()]
param(
$Test
)
Write-Host $Test
Start-Sleep -Seconds 15
Write-Host $Test
} |
@PrzemyslawKlys I'm pretty sure this is because the debugger is currently active... it's not clear with your theme and I'm guessing you disable the little pop up that shows up... Can you try with like the ISE theme or something? There's no way for us to really know when you've "stopped executing" so the experience is that you're dropped into the debugger and are in the debugger until you stop the debugger. |
Have you tried my reproduction steps? |
Yep. That's why I ask. I ran through the steps and the reason F5 didn't work was because the debugger was already on. |
Ok, I think we have a misunderstanding here.
I'm basically only using:
Nothing else. I understand now what you mean with colors (I always check for the progress bar in my theme - and missing during debugging). I also look at [DBG] in cmdline to see whether I'm during debugging or not. Not sure why would you get orange color after I press continue on Write-Host and than it waits for a long time until I actually use SHIFT+F5. |
If I'm reading new "colors" correctly is that when I press F5 the code enters debug. Then I press F5 it seems like console says "ok we're done), yet the orange color stays on and when I execute something again it's basically Debug within Debug within Debug at some point. So it would seem like Debugger doesn't detach properly when it's done and VScode is lost. |
Yeah this has been the case for the Interactive Session debugging for as long as I've been working on this project and it's not a perfect experience... Let me chat with @rjmholt and @SydneyhSmith about this behavior... but it's not a new problem. |
To be honest I don't really understand why would this behavior be like that. If I run code interactively it never goes out of debugging, yet the [DBG] is gone and the console acts as if it's done. Although the status bar still is orange. My understanding was that it will act like normal. If I press F5 and there are no more breakpoints it should finish up and stop. I have now changed color for my current theme to the orange status bar for debugging just to make sure it's visible what is happening. Hopefully, this will allow me to have fewer frustrations as I've been restarting PowerShell 50 times a day not knowing what is happening. Not sure if this is the only cause of my problems but this one I was able to pinpoint. |
I have to admit, the only way I debug and/or develop code is interactive. I never launch a script from the terminal. Maybe that's a result from being spoiled by the |
But I believe I have hit these errors also when developing in script pane only. I can't be really sure because I couldn't pinpoint it, but now that I know what to look for it may be a bit easier to spot & recover if possible. |
To step out of my maintainer boots for a moment... I always use |
My expectations would be:
There is inconsistency right now:
This makes it hard to understand what's going on. Why would debugger stay on if the command is finished? It's not like I did enter debugging manually and then run the script and wanted to stay within the debug session. Hopefully, I am not the only one complaining about this. Maybe I'm just misusing the tool 🤷♀️ |
Ok @TylerLeonhardt has explained this to me and I'll try my best to explain my understanding of the situation. It comes down to:
Users from the ISE expect the following scenario to work:
But once we drop out of debug mode, we never get an update from VSCode about breakpoints (since we don't control VSCode, that means we're blind to breakpoints set in it). That means any changes you make in breakpoints at that time won't get hit if you run something from the console. But even though F5 has become synonymous with "Run script", it really means "Run current debug configuration". When VSCode gets told this, it says "But I'm already in debug mode". See also: #2371, PowerShell/PowerShellEditorServices#1091 In reference to @PrzemyslawKlys's particular issues:
That means VSCode in debug mode and will send updates about breakpoints.
That's because you're not stopped in the debugger. You're in debug mode, but you're not currently in a nested debug prompt. When you see
This is likely because there's no script executing, the same reason for (2). You're in debug mode, but there's no script running. Ideally we could progress on this issue by either coming up with a clever workaround to the VSCode problem, or possibly coming up with a configuration where users can pick what behaviour they want. I suspect the two options are:
There's probably a bit of extra engineering we can do here, but I think the rest is best done with configuration so that everyone can have the experience they prefer with whatever compromises that might entail. |
Just to be clear - does it cover both scenarios I am using or just one of them?
|
This would work if we deactivate debugging after script completion. Pressing F5 a second time would run the script again.
That won't work if we deactivate debugging after a script completes. The breakpoints set in the function will be washed away. |
So,after a long read, just for my understanding of the problem I did a small test on the latest
@PrzemyslawKlys does this not cover your case? Maybe I misunderstood and you can write a simple test case. |
There is definitely a problem with the debugger in latest VSCode (1.72.0). When running multiple processes in the debugger (in my case node processes), I often see both processes appear to stop (hang, not terminate) - for no reason. I then am unable to start a new debug session, nor terminate the existing ones, and the only solution is to close the Code window. |
Thank you for your comment, but please note that this issue has been closed for over a week. For better visibility, consider opening a new issue with a link to this instead. |
Issue Description
I am experiencing a problem with... F5 ('Start Debugging') stopping to work very often. Last few weeks it has been stopping all the time. I am not sure if the logs are of any help thou. I have to restart PowerShell session or use F8.
Attached Logs
Follow the instructions in the README about
capturing and sending logs.
1568380290-e5000958-344d-442c-be6c-5a263b8675e61568354258606.zip
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: