Skip to content

Debugging breaks when a breakpoint is removed mid-execution #912

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
daleecc opened this issue Jun 22, 2017 · 2 comments
Closed

Debugging breaks when a breakpoint is removed mid-execution #912

daleecc opened this issue Jun 22, 2017 · 2 comments
Labels

Comments

@daleecc
Copy link

daleecc commented Jun 22, 2017

System Details

  • Operating system name and version: Windows 7 (64-bit)
PowerShell Integrated Console

PS C:\> code -v
1.13.1
379d2efb5539b09112c793d3d9a413017d736f89
PS C:\> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      0      0


PS C:\> code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When a breakpoint is removed while the debugger is active (not at a breakpoint), the debugger functionality breaks. I believe it is still hitting breakpoints but not displaying that they have been hit, and it hangs when attempting to debug again.

To reproduce:

  1. Open VSCode and save the script below.
$start = Get-Date
while ((New-Timespan -Start $start -end (get-date)).Seconds -lt 15) {
    Write-Host "Blah!" # <-- Set a breakpoint here
    Start-Sleep -Seconds 5
}
  1. Set a breakpoint as indicated and start debugging the script.
  2. When the breakpoint is hit, press F5 (continue) and remove the breakpoint before it is hit again.

After about 5 seconds, I noticed that the pause icon changed to a play icon and the "Hit Line breakpoint" message appeared in the terminal, but no breakpoint indication was present in the editor. Neither F5 or clicking the continue button resumed the script. Clicking the stop button a few times stopped the debugging. Attempting to re-run caused the debug controls to display, but debugging did not start and the execute command which usually appears in the terminal did not display.

Restarting the PowerShell session returned the debugger to normal.

Attached Logs

logs.zip

@daviwil
Copy link
Contributor

daviwil commented Jun 22, 2017

Thanks for filing this Dale, I think your assertion might be correct. I'll look into fixing this for the next patch update!

@daviwil daviwil added Area-Debugging Issue-Bug A bug to squash. labels Jun 22, 2017
@daviwil daviwil added this to the 1.4.1 milestone Jun 22, 2017
@daviwil daviwil modified the milestones: 1.4.2, 1.5.0 Aug 24, 2017
@daviwil daviwil modified the milestones: 1.5.0, Future Oct 26, 2017
@rjmholt
Copy link
Contributor

rjmholt commented May 6, 2019

Deduplicating this to #1494

@rjmholt rjmholt closed this as completed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants