Skip to content

Break point 'breaks debugging' when disabled during execution #1166

@MiYanni

Description

@MiYanni

System Details

  • Operating system name and version: Windows 10
  • VS Code version: 1.19.1
  • PowerShell extension version: 1.5.1
  • Output from $PSVersionTable:
Major  Minor  Build  Revision
-----  -----  -----  --------
1      5      1      0

Name                           Value
----                           -----
PSVersion                      5.1.16299.98
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.98
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

While running a script, I remove a breakpoint. It seems that, sometimes, the debugger doesn't realize that breakpoint was removed. Steps and behavior:

  1. Remove a breakpoint during a debug session while code is executing/running. (Note: Should be a breakpoint you would encounter past current execution)
  2. Execution stops where the breakpoint used to be. Debugger buttons change to the 'stopped at breakpoint' state. Verbose logging shows "Hit Line Breakpoint on '######:###'" showing the line number where the breakpoint used to be. The integrated terminal allows input and shows the "[DBG]: [DBG]: " prefix before the input line.
  3. At this point, trying to hit the Play button or F5 does nothing. Execution cannot resume.
  4. If you hit the Stop button, the debugger UI is removed. However, the integrated console is still stuck in the debug state ("[DBG]: [DBG]: " prefix).
  5. Using any options in the Debug menu (in the menu bar for VSCode) does nothing. F5 does nothing. You can no longer debug or get out of this 'zombie' debug state. The only option is kill the integrated terminal (or restart VSCode) to allow debugging again.

Additional note: The code this most frequently happens on is a polling process with Start-Sleep in it. I'd recommend just making a loop with a 5 to 10 second sleep between each iteration. Then, try to remove a breakpoint outside (beyond) the loop.

Attached Logs

Let me know if you need logs for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions