-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Enable breakpoints on branching expressions (conditional and short-circuiting) #43092
Comments
This is an absolutely excellent suggestion; that at minimum holds up the future outlook! 🤓 Granular progress on branches! Very nice sir! |
The potential downside of doing this is that single-stepping may have many more intermediate steps. I'm proposing to implement this as an experimental compiler feature (enabled with a feature flag) to gather some experience with it. |
Isn't experience better gathered by making the feature as available as possible? The agile world is long into the framework. I felt that the configuration would be a type of hassle; and limit the casual usage arbitrarily too. |
I don't think it would be a good idea to subject all of our customers to a possibly failing experiment. We'd prefer to keep our customers productive. |
Linked issue: #21781 , also suggests using a new compiler flag for this and leave the default behavior as is. |
This is coming from a developer without any compiler/IL knowledge so this might very well be "rewrite everthing" land. But I looked at formal proposal in the linked issue (#21781) and instead of having a compiler switch to add more or less "sequence points", couldn't different types of sequence point be added at those levels? That would let the developer choose at debug time what kind of granularity they want to step by. For instance F10 would be stepping by the old kind of sequence points "coarse" and Ctrl+F10 would step by the new granularity "Fine" which will let the developer step into ternarys/lambdas/conditions/propinitalizers/whatnot. Combine that with a hotkey toggle that let you switch around the behaviour of F10 / Ctrl+F10 and I for one would be a happy camper. |
This would be in the same vein as #22016 which added breakpoints for the arms of a switch expression. Filed as asked by @gafter.
Please add sequence points to enable setting breakpoints on:
&&
,||
, and??
?.
and?[
When you're in the middle of debugging, it's too late to refactor expressions to statements. Sometimes you can set a breakpoint on the whole statement and duplicate the effective condition using the breakpoint condition feature, but this expression may be nested inside other expressions. It's frustrating to put together even when you can duplicate the condition without side effects.
A benefit of more granular expression sequence points is that code coverage tools will begin to recognize conditional expressions and short-circuiting operators as branches. All the code coverage tools that I've looked into or heard from are dependent on debugger sequence points. I'm hoping for a world where things like
&&
and?.
are tracked as branching by Live Unit Testing and third-party tools.The text was updated successfully, but these errors were encountered: