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

EnC: Track documents that do not match the debuggee #38905

Merged
merged 6 commits into from
Oct 4, 2019
Merged

Conversation

tmat
Copy link
Member

@tmat tmat commented Sep 27, 2019

The current Project System design doesn't allow us to capture a solution snapshot at the start of a debug session that would reflect the exact content of the source files on disk the assembly was built with (dotnet/project-system#5457). Roslyn relies on file system watches to detect changes in the source files. Events from the watcher may be handled by Roslyn at any point in time after the debugging started or not at all, since the OS does not guarantee the events to be triggered.

The PR adds a source file content checksum validation before the EnC service starts computation that depends on the content of a document at the start of the debug session. The validation compares the checksum stored in the PDB by the compiler with the current content of the file on disk. Documents are considered out-of-sync until the EnC service observes file content with matching checksum.

Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/970821
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/992537

TODO:
To fix UWP apps 899910 we would need to implement #38954. UWP generates an .g.cs file with an empty class, so the file is not listed in the PDB and also when launched for the first time the document that's added to the workspace is empty. Since there is no checksum to compare to the EnC service considers the empty document a baseline document and then reports rude edit when the file gets updated to the empty class.

@tmat
Copy link
Member Author

tmat commented Sep 30, 2019

@jasonmalinowski @ivanbasov PTAL

@tmat tmat marked this pull request as ready for review September 30, 2019 15:59
@tmat tmat requested review from a team as code owners September 30, 2019 15:59
@tmat
Copy link
Member Author

tmat commented Sep 30, 2019

@dotnet/roslyn-compiler For compiler changes - simple refactoring so that we can share source hash algorithms with the IDE.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Compiler change LGTM Thanks (iteration 3)

@jcouv jcouv self-assigned this Sep 30, 2019
Copy link
Member

@cston cston left a comment

Choose a reason for hiding this comment

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

Compiler changes LGTM.

Copy link
Contributor

@ivanbasov ivanbasov left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Overall this matches what we've discussed in person as far as how this works. Not being familiar enough with the various implementation details of edit and continue I can't state if it's all correct I didn't see problems.

I found a few random "uh, this looks fishy" which are just local issues and a easy pass would clean things up.

@jinujoseph jinujoseph added this to the 16.4.P3 milestone Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants