Skip to content

[wasm][debugger] Hide members from classes that don't have debug information #73982

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 6 commits into from
Aug 16, 2022

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented Aug 16, 2022

Do not show members from classes that don't have debug information if JMC is enabled.

Fixes #43184

@ghost
Copy link

ghost commented Aug 16, 2022

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

Do not show members from classes that don't have debug information if JMC is enabled.

Fixes #43184

Author: thaystg
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

Comment on lines 220 to 223
var typeInfo = await sdbHelper.GetTypeInfo(containerTypeId, token);
if (typeInfo.Info.IsNonUserCode && getCommandOptions.HasFlag(GetObjectCommandOptions.JustMyCode))
return fieldValues;

Copy link
Member

Choose a reason for hiding this comment

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

Can this be at line 215?

@@ -591,6 +594,11 @@ JObject GetNotAutoExpandableObject(int methodId, string propertyName, bool isSta
if (!getCommandType.HasFlag(GetObjectCommandOptions.WithProperties))
return GetMembersResult.FromValues(allMembers.Values, sortByAccessLevel);

var typeInfo = await sdbHelper.GetTypeInfo(typeId, token);

if (typeInfo.Info.IsNonUserCode && getCommandType.HasFlag(GetObjectCommandOptions.JustMyCode))
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this add fields for non-my-code types? Should it moved to the beginning of the loop?

System.Diagnostics.Debugger.Break();
}

public int myField;
Copy link
Member

Choose a reason for hiding this comment

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

Add custom, and autogenerated properties too.

@radical
Copy link
Member

radical commented Aug 16, 2022

Do not show members from classes that don't have debug information if JMC is enabled.

I'm not sure I understand. Is this correct? :

  • if JMC is not enabled, then all the members of the full hierarchy should be visible
    • What can we show if debug information is not present?
    • Why remove the stuff that we can show, if JMC is not enabled?

Also, this won't completely fix #43184, because this is still not returning the non-public members in privateProperties.

@radical
Copy link
Member

radical commented Aug 16, 2022

Other than the comments here, and some from discussion offline, this LGTM, assuming the tests pass 👍

Comment on lines 575 to 579
var typeInfo = await sdbHelper.GetTypeInfo(typeId, token);

if (typeInfo.Info.IsNonUserCode && getCommandType.HasFlag(GetObjectCommandOptions.JustMyCode))
break;

Copy link
Member

Choose a reason for hiding this comment

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

This can be right after int typeId = typeIdsIncludingParents[I];.

@@ -63,6 +64,7 @@

<WasmAssemblySearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)native"/>
<WasmAssemblySearchPaths Include="$(MicrosoftNetCoreAppRuntimePackRidDir)lib\$(NetCoreAppCurrent)"/>
<WasmAssemblySearchPaths Include="$(OutDir)"/>
Copy link
Member

Choose a reason for hiding this comment

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

Why was this needed?

thaystg and others added 2 commits August 16, 2022 00:07
Co-authored-by: Ankit Jain <radical@gmail.com>
@thaystg thaystg merged commit 481c056 into dotnet:main Aug 16, 2022
@thaystg
Copy link
Member Author

thaystg commented Aug 16, 2022

/backport to release/7.0-rc1

@github-actions
Copy link
Contributor

Started backporting to release/7.0-rc1: https://github.com/dotnet/runtime/actions/runs/2871012035

@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mono WASM debugger displays private members of base class alongside other properties
3 participants