Skip to content

Need to be able to disable the debugger when the debugging is done after ActionPreference.Break is hit #10380

Closed

Description

This is an issue tracking the review comment of #8205 (comment), which should be fixed in the follow-up PR of #8205.

The PR #8205 introduces ActionPreference.Break, which will result breaking into the debugger (enable the debugger) when an action (e.g. ErrorAction) is hit.

-ErrorAction break will set the debugger mode to be Enabled, and after that the debugger mode will stay Enabled. That means once a ActionPreference.Break is hit, the session will never be able to run script in optimized mode anymore.
This feels like a concern to me. I can imagine one scenario where people uses -ErrorAction Break -- I don't expect an error will be thrown but want to debug in case the unexpected happens, but after debugging (quit the debugger prompt), I would like the rest of my scripts continue to run as efficient as it can (in optimized mode). That scenario will be compromised as the debugger mode will always be Enabled after the -ErrorAction Break is hit, and thus the Compiler will generated unoptimized code for the rest time of the session.

There should be a way to disable the debugger after ActionPreference.Break is hit and the debugging session is done.

Activity

  1. added
    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a
    on Aug 19, 2019
  2. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  3. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  4. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  5. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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