-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm][debugger] Fix DebuggerTypeProxy for structs and for classes with multiple constructors #77039
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
Merged
Merged
[wasm][debugger] Fix DebuggerTypeProxy for structs and for classes with multiple constructors #77039
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1e34ad2
Adding any new constructor breaks UsingDebuggerTypeProxy test.
ilonatommy 95ff171
Fix: now objects won't get identified as valueTypes by a mistake.
ilonatommy 78e9072
Test logic fix: rely on comparison with fixed entities only.
ilonatommy bf51e21
Fix: choosing proxy's matching constructor works.
ilonatommy 8e02c8d
Merge branch 'main' into fix-root-hidden-tests
ilonatommy 29488c8
Support DebuggerProxy in valueTypes.
ilonatommy f6a4028
Fix test to not rely on `testPropertiesNone`.
ilonatommy a883b9e
Fix tests.
ilonatommy a25f90b
Fix tests.
ilonatommy 6b72197
Edit and disable rootHidden test.
ilonatommy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases(example code) would we be executing this block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All cases in DebuggerTests.EvaluateOnCallFrameTests.EvaluateBrowsableRootHidden because
This PR fixes only the problem with
Itemsvs_items(now it's alwaysItems). But it does not fix the fact that they need to get expanded manually - rootHidden info does not exist on them and cannot be easily extracted. The issue where we address it is this one: #76876.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is my understanding here correct?:
List<T>has[DebuggerTypeProxy(typeof(ICollectionDebugView<>))], so we look at the proxyItemspropertyItemshas[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)], which isn't working yet ([wasm][debugger] RootHidden is not working correctly in DebuggerTypeProxy #76876)Itemshere to work specifically forList<T>?If so, then is this only to get
EvaluateBrowsableRootHiddenpassing?Also, does #76876 still happen after the DebuggerTypeProxy fix here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at it, and (4) is true. The test for
listRootHiddenshould be disabled for now, and a comment mentioning the issue. And we can remove this incorrect hack.And in a follow up PR, the root hidden issue can be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say it's a misunderstanding caused by me not deleting the dependency on non-fixed values in the tests properly. Manual expansion was not done on an object decorated with
RootHiddenbut ontestPropertiesNone. Theelseblock is not to make the tests pass, it is necessary tillRootHiddenonItemswill be received correctly by Proxy. It was the test that was not 100% logical.I think now it will make more sense after the last commit.
Yes, the issue is still here. Proxy is not receiving any DebuggerAttributes assigned to
Items, so it does not know it's of rootHidden type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this comment did not display for me when I was investigating. I don't agree. This will break mechanism for all Collections that are in rootHidden objects. The
elseblock can be removed when we have the fix already, so that we won't be changing the behavior from working to not working.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runtime/src/mono/wasm/debugger/BrowserDebugProxy/MemberObjectsExplorer.cs
Lines 149 to 161 in 8064bfe
This code is very explicitly looking for a
Itemsmember which is anarray. So, theelsearm is affecting only the very specific types that have such a member, which is the case forList<T>. The proxy, or the debugger agent aren't populating it as an extra thing.I agree that we shouldn't break the behavior in this PR. But it is incorrect. We want to avoid depending on magic like that, especially when proper mechanisms are available to get the information -
DebuggerTypeProxyin this case.The rootHidden issue is in addition to this, and that's fine to fix separately.