diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2012-09-06 22:25:36 +0400 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2012-09-06 22:28:17 +0400 |
commit | f321cca2202e33c382d8439ead6097a799991741 (patch) | |
tree | d118e81f584bc4dfe1ec2bdd6287c1b62b88dc8f /main | |
parent | 6b34adb084b4555072879294a071f3fe78d8ab1f (diff) |
[Debugger] Correctly show expanders for List<>'s in the Locals pad
Fixes bug #6655.
Conflicts:
main/external/cecil
Diffstat (limited to 'main')
3 files changed, 26 insertions, 30 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs index 1e49259de6..c7ed63a2a8 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs @@ -488,8 +488,9 @@ namespace MonoDevelop.Debugger showExpanders = true; } } - - ShowExpanders = showExpanders; + + if (showExpanders) + ShowExpanders = true; if (AllowAdding) store.AppendValues (createMsg, "", "", null, true, true, null, disabledColor, disabledColor); @@ -700,14 +701,15 @@ namespace MonoDevelop.Debugger strval = strval.Replace (Environment.NewLine, " "); bool showViewerButton = DebuggingService.HasValueVisualizers (val); - + + bool hasChildren = val.HasChildren; string icon = GetIcon (val.Flags); store.SetValue (it, NameCol, name); store.SetValue (it, ValueCol, strval); store.SetValue (it, TypeCol, val.TypeName); store.SetValue (it, ObjectCol, val); - store.SetValue (it, ExpandedCol, !val.HasChildren); + store.SetValue (it, ExpandedCol, !hasChildren); store.SetValue (it, NameEditableCol, !hasParent && allowAdding); store.SetValue (it, ValueEditableCol, canEdit); store.SetValue (it, IconCol, icon); @@ -726,7 +728,7 @@ namespace MonoDevelop.Debugger if (RootPinAlwaysVisible && (!hasParent && PinnedWatch ==null && AllowPinning)) store.SetValue (it, PinIconCol, "md-pin-up"); - if (val.HasChildren) { + if (hasChildren) { // Add dummy node it = store.AppendValues (it, "", "", "", null, true); if (!ShowExpanders) diff --git a/main/src/core/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs b/main/src/core/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs index 4f74ee3221..4221d09b95 100644 --- a/main/src/core/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs +++ b/main/src/core/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs @@ -507,7 +507,7 @@ namespace Mono.Debugging.Client children.AddRange (cs); } catch (Exception ex) { if (parentFrame != null) - parentFrame.DebuggerSession.OnDebuggerOutput( true, ex.ToString()); + parentFrame.DebuggerSession.OnDebuggerOutput (true, ex.ToString ()); children.Add (CreateFatalError ("", ex.Message, ObjectValueFlags.ReadOnly)); } } diff --git a/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs b/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs index 34764a77da..685abb45a4 100644 --- a/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs +++ b/main/src/core/Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs @@ -412,26 +412,35 @@ namespace Mono.Debugging.Evaluation if (IsPrimitive (ctx, obj)) return false; - - bool showRawView = false; // If there is a proxy, it has to show the members of the proxy object proxy = obj; if (dereferenceProxy) { proxy = GetProxyObject (ctx, obj); - if (proxy != obj) { - type = GetValueType (ctx, proxy); - showRawView = true; - } + if (proxy != obj) + return true; } - TypeDisplayData tdata = GetTypeDisplayData (ctx, type); bool groupPrivateMembers = ctx.Options.GroupPrivateMembers && (ctx.Options.GroupUserPrivateMembers || IsExternalType (ctx, type)); BindingFlags flattenFlag = ctx.Options.FlattenHierarchy ? (BindingFlags)0 : BindingFlags.DeclaredOnly; - BindingFlags nonNonPublicFlag = groupPrivateMembers || showRawView ? (BindingFlags)0 : BindingFlags.NonPublic; BindingFlags staticFlag = ctx.Options.GroupStaticMembers ? (BindingFlags)0 : BindingFlags.Static; - BindingFlags access = BindingFlags.Public | BindingFlags.Instance | flattenFlag | nonNonPublicFlag | staticFlag; + + if (ctx.Options.GroupStaticMembers && HasMembers (ctx, type, proxy, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | flattenFlag)) + return true; + + if (groupPrivateMembers && HasMembers (ctx, type, proxy, BindingFlags.Instance | BindingFlags.NonPublic | flattenFlag | staticFlag)) + return true; + if (!ctx.Options.FlattenHierarchy) { + object baseType = GetBaseType (ctx, type, false); + if (baseType != null) + return true; + } + + BindingFlags nonNonPublicFlag = groupPrivateMembers ? (BindingFlags)0 : BindingFlags.NonPublic; + BindingFlags access = BindingFlags.Public | BindingFlags.Instance | flattenFlag | nonNonPublicFlag | staticFlag; + TypeDisplayData tdata = GetTypeDisplayData (ctx, type); + // Load all members to a list before creating the object values, // to avoid problems with objects being invalidated due to evaluations in the target, List<ValueReference> list = new List<ValueReference> (); @@ -456,21 +465,6 @@ namespace Mono.Debugging.Evaluation } } - if (IsArray (ctx, proxy)) - return true; - - if (ctx.Options.GroupStaticMembers && HasMembers (ctx, type, proxy, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | flattenFlag)) - return true; - - if (groupPrivateMembers && HasMembers (ctx, type, proxy, BindingFlags.Instance | BindingFlags.NonPublic | flattenFlag | staticFlag)) - return true; - - if (!ctx.Options.FlattenHierarchy) { - object baseType = GetBaseType (ctx, type, false); - if (baseType != null) - return true; - } - return false; } |