@@ -238,6 +238,9 @@ public static async Task<JArray> ExpandFieldValues(
238238 JObject fieldValue = await ReadFieldValue ( sdbHelper , retDebuggerCmdReader , field , id . Value , typeInfo , valtype , isOwn , parentTypeId , getCommandOptions , token ) ;
239239 numFieldsRead ++ ;
240240
241+ if ( typeInfo . Info . IsNonUserCode && getCommandOptions . HasFlag ( GetObjectCommandOptions . JustMyCode ) && field . Attributes . HasFlag ( FieldAttributes . Private ) )
242+ continue ;
243+
241244 if ( ! Enum . TryParse ( fieldValue [ "__state" ] . Value < string > ( ) , out DebuggerBrowsableState fieldState )
242245 || fieldState == DebuggerBrowsableState . Collapsed )
243246 {
@@ -311,7 +314,7 @@ public static async Task<Dictionary<string, JObject>> ExpandPropertyValues(
311314 int typeId ,
312315 string typeName ,
313316 ArraySegment < byte > getterParamsBuffer ,
314- bool isAutoExpandable ,
317+ GetObjectCommandOptions getCommandOptions ,
315318 DotnetObjectId objectId ,
316319 bool isValueType ,
317320 bool isOwn ,
@@ -347,6 +350,10 @@ public static async Task<Dictionary<string, JObject>> ExpandPropertyValues(
347350 MethodAttributes getterAttrs = getterInfo . Info . Attributes ;
348351 MethodAttributes getterMemberAccessAttrs = getterAttrs & MethodAttributes . MemberAccessMask ;
349352 MethodAttributes vtableLayout = getterAttrs & MethodAttributes . VtableLayoutMask ;
353+
354+ if ( typeInfo . Info . IsNonUserCode && getCommandOptions . HasFlag ( GetObjectCommandOptions . JustMyCode ) && getterMemberAccessAttrs == MethodAttributes . Private )
355+ continue ;
356+
350357 bool isNewSlot = ( vtableLayout & MethodAttributes . NewSlot ) == MethodAttributes . NewSlot ;
351358
352359 typePropertiesBrowsableInfo . TryGetValue ( propName , out DebuggerBrowsableState ? state ) ;
@@ -454,7 +461,7 @@ async Task AddProperty(
454461 {
455462 string returnTypeName = await sdbHelper . GetReturnType ( getMethodId , token ) ;
456463 JObject propRet = null ;
457- if ( isAutoExpandable || ( state is DebuggerBrowsableState . RootHidden && IsACollectionType ( returnTypeName ) ) )
464+ if ( getCommandOptions . HasFlag ( GetObjectCommandOptions . AutoExpandable ) || getCommandOptions . HasFlag ( GetObjectCommandOptions . ForDebuggerProxyAttribute ) || ( state is DebuggerBrowsableState . RootHidden && IsACollectionType ( returnTypeName ) ) )
458465 {
459466 try
460467 {
@@ -568,10 +575,6 @@ public static async Task<GetMembersResult> GetObjectMemberValues(
568575 for ( int i = 0 ; i < typeIdsCnt ; i ++ )
569576 {
570577 int typeId = typeIdsIncludingParents [ i ] ;
571- var typeInfo = await sdbHelper . GetTypeInfo ( typeId , token ) ;
572-
573- if ( typeInfo . Info . IsNonUserCode && getCommandType . HasFlag ( GetObjectCommandOptions . JustMyCode ) )
574- continue ;
575578
576579 int parentTypeId = i + 1 < typeIdsCnt ? typeIdsIncludingParents [ i + 1 ] : - 1 ;
577580 string typeName = await sdbHelper . GetTypeName ( typeId , token ) ;
@@ -604,7 +607,7 @@ public static async Task<GetMembersResult> GetObjectMemberValues(
604607 typeId ,
605608 typeName ,
606609 getPropertiesParamBuffer ,
607- getCommandType . HasFlag ( GetObjectCommandOptions . ForDebuggerProxyAttribute ) ,
610+ getCommandType ,
608611 id ,
609612 isValueType : false ,
610613 isOwn ,
0 commit comments