Skip to content

Debugging session does not end, even after selecting "Stop Debugging" #1022

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

Closed
anthony-gregg opened this issue Sep 5, 2017 · 10 comments
Closed
Labels
Area-Debugging Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.

Comments

@anthony-gregg
Copy link

System Details

  • Operating system name and version: Windows 10 Creator (15063.540)
  • VS Code version: 1.15.1
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:

Name Value


PSVersion 5.1.15063.502
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.502
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v
1.15.1
41abd21afdf7424c89319ee7cb0445cc6f376959

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0

code --list-extensions --show-versions
[email protected]

$PSVersionTable
See above

Issue Description

I am experiencing a problem with... ending a debugging session. I do the following steps (assuming a powershell script is already loaded and a breakpoint has been applied):

  1. Go to the Debug menu and select start debugging.
  2. My script in this case is one large main function with many sub functions. So I call the function from the "Terminal" screen. In this case it is: . ./Get-TFSUsers.ps1
  3. I then pass the needed parameters to the function. I pass up to 4 parameters. An example is as follows:
    Get-TFSGroupMembership http://TFSEnterprise:8080/tfs/Services Plugin -WriteOnly
    So this is the function name, the collection URL, the Project I want to get users from and the last is a switch to tell the script to get "writeonly" users. There is a second switch which is not shown here and I have not typically used.
  4. So my program now executes successfully and hits the breakpoint successfully.
  5. I will then F11 or F10 for a while and then decide I am done debugging as I have now what I need.
  6. I will then go to the Debug menu and select "Stop Debugging".
  7. I will then go and select from the Debug menu "Remove all breakpoints"
  8. The breakpoints all go away.
  9. I can then either decide to make some changes to the script or just decide to run the script again. Either way it does not matter. The same result occurs.
  10. I now execute my script again from the "Terminal" screen and even if no breakpoint now exists, it will break at the location where my old breakpoints used to be.

I have tried all sorts of things to end the debug session, but nothing ends it. I have read all the tutorials on the VS Code debugger and nothing indicates that I am doing anything wrong or missing a step (so it seems). If there is something missing I could not for the life of me find it.

Finally the only way I could get the debugging session to end was to close out of VS Code and restart it again. This terminated the debug session. Otherwise, every time I ran the script it would continue to break at the non-existent breakpoint. If I added the breakpoint back and removed it again, this did not change a thing. I showed this to a couple of other VS Code users in my company and they also thought this was a bug. I am however skeptical that it is as I would think someone for sure would have seen this by now. However I could not see any mention of it. It seems like an in your face problem that would be noticed by everyone. So I am thinking I have done something wrong. I thought I would submit it anyway and see where it goes.

Attached Logs

I am not having any errors or crashes that exhibit this problem therefore I have not included any logs based on the URL given below. If however you need me to do so, I can follow your guidance as necessary to capture any information you may need.

Follow the instructions in the README about capturing and sending logs.

@christianacca
Copy link

Same problem for me - really frustrating

@daviwil daviwil added Area-Debugging Issue-Bug A bug to squash. labels Oct 26, 2017
@daviwil
Copy link
Contributor

daviwil commented Oct 26, 2017

This sounds like issue #625 to me. If you don't try removing the breakpoints, does everything work as expected for you? Trying to determine whether it's actually an issue of the debugger not stopping or the breakpoints still sticking around for the next debugger run.

@anthony-gregg
Copy link
Author

anthony-gregg commented Oct 26, 2017 via email

@anthony-gregg
Copy link
Author

anthony-gregg commented Nov 1, 2017 via email

@rkeithhill
Copy link
Contributor

@anthony-gregg Can you zip and attach your log files here?

As for the original issue, you can request that the PowerShell extension for VSCode uses a new, temporary session during debugging. This ensures you start with a fresh session when you start debugging. To enable this, add this setting to your user settings file:

  "powershell.debugging.createTemporaryIntegratedConsole": true

@shahidmau
Copy link

I am getting exactly same issue on mac with Version 1.18.0
I am not able to stop debugging session.

@bobbytreed
Copy link

Mine too. In fact even though you select Stop-Debugging, I noticed the [DBG] prompt never went away. Subsequent debugging entered further and futher nested prompts until breakpoints were outright ignored.

Had to type 'q' in the console window to exit out of all sessions

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 1, 2020
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Apr 2, 2020
@JustinGrote
Copy link
Collaborator

JustinGrote commented Apr 22, 2020

@SydneyhSmith @TylerLeonhardt this is more specifically covered in #2371 in terms of the larger conversation of whether to cleanup breakpoints for users.

Some documentation around having multiple debug sessions in the queue may be useful for visibility of "hung" debug sessions, though the newest vscode makes this MUCH easier to view, troubleshoot, and cleanup in the "Call Stack" Pane:
image

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 22, 2020
@SydneyhSmith
Copy link
Collaborator

Thanks @JustinGrote I will mark this issue as a duplicate and we can refer to #2371 going forward.

Your comment around documentation is valid and is likely something we should consider- Thanks!

@SydneyhSmith SydneyhSmith added Community-Help Resolution-Duplicate Will close automatically. and removed Needs: Maintainer Attention Maintainer attention needed! labels Apr 23, 2020
@ghost
Copy link

ghost commented Apr 24, 2020

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Apr 24, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debugging Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

8 participants