Skip to content

The debugger should not be disabled when you remove the last breakpoint if you are currently stepping through the debugger #9824

@KirkMunro

Description

@KirkMunro

The Remove-PSBreakpoint command has logic that disables the debugger when the last breakpoint is removed. As defined, this can happen even if you are currently stepping through the debugger, such that any subsequent step command (step into, step over, step out) is ignored and the script runs to completion.

The condition needs to also check to make sure that you are not currently stepping through the debugger. If you are, the debugger must not be disabled.

This issue is being fixed as part of PR #9825. I am simply adding it here for tracking purposes.

Steps to reproduce

& {
    $bp = Set-PSBreakpoint -Command Remove-PSBreakpoint
    Remove-PSBreakpoint -Breakpoint $bp
}
1 + 1

Expected behavior

Regardless of whether you use stepInto, stepOver, or stepOut, you should be able to step to the 1 + 1 command.

Actual behavior

You cannot step to the 1 + 1 command.

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.0
PSEdition                      Core
GitCommitId                    6.2.0
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-Debuggingdebugging PowerShell script

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions