Skip to content
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

Consider adding debug points for boolean logic #11980

Closed
dsyme opened this issue Aug 16, 2021 · 4 comments
Closed

Consider adding debug points for boolean logic #11980

dsyme opened this issue Aug 16, 2021 · 4 comments
Labels
Area-Debug stepping, debug points, stacks and more Feature Improvement Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.

Comments

@dsyme
Copy link
Contributor

dsyme commented Aug 16, 2021

Complex boolean logic is quite common in F#, e.g. see examples below. It is really hard to debug.

I propose we add debug points on left and right of a && b and a || b so you can step through this logic and hit breakpoints.

C# doesn't allow breaking in boolean logic or any expression. However

  1. F# already steps through any match and if ... then .. else expressions so adding this seems natural enough.
  2. I believe complex boolean logic is more common in F# than C# because of the expression-oriented nature of the language

A possible downside is that of "too much stepping" so it takes too long to step through a function. However I've been frustrated by the lack of debugging for boolean logic enough that I think we should prefer the addditional debug points.

Examples

let isRecdOrStructTyconRefAssumedImmutable (g: TcGlobals) (tcref: TyconRef) =
    tcref.CanDeref &&
    not (isRecdOrUnionOrStructTyconRefDefinitelyMutable tcref) ||
    tyconRefEq g tcref g.decimal_tcr ||
    tyconRefEq g tcref g.date_tcr

or

MicrosoftTeams-image

@dsyme dsyme added Area-Debug stepping, debug points, stacks and more Feature Improvement labels Aug 16, 2021
@zanaptak
Copy link
Contributor

Better too many steps than too few, they at least can be mitigated with Run to Cursor or setting a later breakpoint.

@TIHan TIHan added the Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. label Aug 18, 2021
@dsyme
Copy link
Contributor Author

dsyme commented Feb 4, 2022

This is being implemented #12432

@dsyme
Copy link
Contributor Author

dsyme commented Feb 4, 2022

Example:

a.-.Microsoft.Visual.Studio.Administrator.2022-02-04.13-12-49.mp4

@dsyme
Copy link
Contributor Author

dsyme commented Feb 15, 2022

CLosing as completed in #12432

@dsyme dsyme closed this as completed Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debug stepping, debug points, stacks and more Feature Improvement Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
None yet
Development

No branches or pull requests

3 participants