Skip to content

Add debug emit docs #12411

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Nov 17, 2021
Merged

Add debug emit docs #12411

merged 7 commits into from
Nov 17, 2021

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Nov 16, 2021

This adds detailed docs about the whole topic of "Debug emit", trying to capture as much detail about what and how we do when emitting debug code.

@brettfo @KevinRansom @jonsequitur @vzarytovskii @TIHan @cartermp Please give this a careful read end-to-end - a passing knowledge of this area is pretty much essential


Breakpoints have two existences which must give matching behavior:

* At design-time, before debugging is launched, `ValidateBreakpointLocation` is called to validate every breakpoint. This operators on the SyntaxTree and forms a kind of "gold-standard" about the exact places where break points are valid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* At design-time, before debugging is launched, `ValidateBreakpointLocation` is called to validate every breakpoint. This operators on the SyntaxTree and forms a kind of "gold-standard" about the exact places where break points are valid.
* At design-time, when you set a breakpoint (either via clicking in the editor or a key binding), the IDE will call the language service, which will in turn call `ValidateBreakpointLocation`. This routine attempts to find the best match for a construct relative to where you set the breakpoint, and also asserts that there is a matching sequence point for the range of that construct. If there is no match, or there is a construct considered "invalid" by this routine, a breakpoint will not be set.

@KevinRansom KevinRansom merged commit 0458724 into dotnet:main Nov 17, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants