Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adding fields that are from non-user-code as private
  • Loading branch information
thaystg authored and github-actions committed Aug 16, 2022
commit bc2dffc96041664b2e9b201f9f38048491eff8b3
12 changes: 10 additions & 2 deletions src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ internal sealed class TypeInfo
internal int Token { get; }
internal string Namespace { get; }
internal bool IsCompilerGenerated { get; }
internal bool NonUserCode { get; }
public string FullName { get; }
public List<MethodInfo> Methods { get; } = new();
public Dictionary<string, DebuggerBrowsableState?> DebuggerBrowsableFields = new();
Expand Down Expand Up @@ -769,8 +770,15 @@ internal TypeInfo(AssemblyInfo assembly, TypeDefinitionHandle typeHandle, TypeDe
continue;
var container = metadataReader.GetMemberReference((MemberReferenceHandle)ctorHandle).Parent;
var attributeName = assembly.EnCGetString(metadataReader.GetTypeReference((TypeReferenceHandle)container).Name);
if (attributeName == nameof(CompilerGeneratedAttribute))
IsCompilerGenerated = true;
switch (attributeName)
{
case nameof(CompilerGeneratedAttribute):
IsCompilerGenerated = true;
break;
case nameof(DebuggerNonUserCodeAttribute):
NonUserCode = true;
break;
}
}

void AppendToBrowsable(Dictionary<string, DebuggerBrowsableState?> dict, CustomAttributeHandleCollection customAttrs, string fieldName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ private static async Task<JObject> ReadFieldValue(
FieldAttributes.Public => "result",
_ => "internal"
};

if (!isOwn && typeInfo.Info.NonUserCode && getObjectOptions.HasFlag(GetObjectCommandOptions.JustMyCode))
fieldValue["__section"] = "private";

if (field.IsBackingField)
{
fieldValue["__isBackingField"] = true;
Expand Down
2 changes: 2 additions & 0 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ internal async Task<ValueOrError<GetMembersResult>> RuntimeGetObjectMembers(Sess
if (args["forDebuggerDisplayAttribute"]?.Value<bool>() == true)
getObjectOptions |= GetObjectCommandOptions.ForDebuggerDisplayAttribute;
}
if (JustMyCode)
getObjectOptions |= GetObjectCommandOptions.JustMyCode;
try
{
switch (objectId.Scheme)
Expand Down
3 changes: 2 additions & 1 deletion src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ internal enum GetObjectCommandOptions
OwnProperties = 4,
ForDebuggerProxyAttribute = 8,
ForDebuggerDisplayAttribute = 16,
WithProperties = 32
WithProperties = 32,
JustMyCode = 64
}

internal enum CommandSet {
Expand Down