Author: martin
Date: 2008-02-19 08:14:15 -0500 (Tue, 19 Feb 2008)
New Revision: 96133

Modified:
   branches/martin/debugger-terrania/debugger/ChangeLog
   branches/martin/debugger-terrania/debugger/frontend/Expression.cs
   branches/martin/debugger-terrania/debugger/languages/TargetClassType.cs
   branches/martin/debugger-terrania/debugger/languages/mono/MonoClassInfo.cs
   branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs
   
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs
Log:
2008-02-19  Martin Baulig  <[EMAIL PROTECTED]>

        * languages/TargetClassType.cs
        (TargetClassType.IsCompilerGenerated): New public abstract property.

        * frontend/Expression.cs
        (Expression.DoEvaluateObject): Don't use the result of
        TargetStructObject.GetCurrentObject() if it's a compiler generated
        class; this should fix iterators and print the `IEnumerable<T>'
        interface instead.



Modified: branches/martin/debugger-terrania/debugger/ChangeLog
===================================================================
--- branches/martin/debugger-terrania/debugger/ChangeLog        2008-02-19 
12:59:42 UTC (rev 96132)
+++ branches/martin/debugger-terrania/debugger/ChangeLog        2008-02-19 
13:14:15 UTC (rev 96133)
@@ -1,5 +1,16 @@
 2008-02-19  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * languages/TargetClassType.cs
+       (TargetClassType.IsCompilerGenerated): New public abstract property.
+
+       * frontend/Expression.cs
+       (Expression.DoEvaluateObject): Don't use the result of
+       TargetStructObject.GetCurrentObject() if it's a compiler generated
+       class; this should fix iterators and print the `IEnumerable<T>'
+       interface instead.
+
+2008-02-19  Martin Baulig  <[EMAIL PROTECTED]>
+
        * languages/mono/MonoSymbolFile.cs
        (MonoSymbolFile.GetMethodName): Use a format which is compatible
        with mcs's GetSignatureForError().

Modified: branches/martin/debugger-terrania/debugger/frontend/Expression.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/frontend/Expression.cs   
2008-02-19 12:59:42 UTC (rev 96132)
+++ branches/martin/debugger-terrania/debugger/frontend/Expression.cs   
2008-02-19 13:14:15 UTC (rev 96133)
@@ -6,6 +6,7 @@
 using System.Globalization;
 using Mono.Debugger;
 using Mono.Debugger.Languages;
+using Mono.Debugger.Languages.Mono;
 
 namespace Mono.Debugger.Frontend
 {
@@ -255,7 +256,13 @@
                                } catch {
                                        current = null;
                                }
-                               if (current != null)
+                               if (current == null)
+                                       return obj;
+
+                               TargetClassObject scurrent = current as 
TargetClassObject;
+                               if ((scurrent != null) && 
scurrent.Type.IsCompilerGenerated)
+                                       return obj;
+                               else
                                        return current;
                        }
 

Modified: 
branches/martin/debugger-terrania/debugger/languages/TargetClassType.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/languages/TargetClassType.cs     
2008-02-19 12:59:42 UTC (rev 96132)
+++ branches/martin/debugger-terrania/debugger/languages/TargetClassType.cs     
2008-02-19 13:14:15 UTC (rev 96133)
@@ -6,6 +6,10 @@
                        : base (language, kind)
                { }
 
+               public abstract bool IsCompilerGenerated {
+                       get;
+               }
+
                public abstract TargetFieldInfo[] Fields {
                        get;
                }

Modified: 
branches/martin/debugger-terrania/debugger/languages/mono/MonoClassInfo.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/languages/mono/MonoClassInfo.cs  
2008-02-19 12:59:42 UTC (rev 96132)
+++ branches/martin/debugger-terrania/debugger/languages/mono/MonoClassInfo.cs  
2008-02-19 13:14:15 UTC (rev 96133)
@@ -336,6 +336,8 @@
                void get_parent (TargetMemoryAccess target)
                {
                        parent_klass = MonoRuntime.MonoClassGetParent (target, 
KlassAddress);
+                       if (parent_klass.IsNull)
+                               return;
 
                        parent_info = ReadClassInfo (SymbolFile.MonoLanguage, 
target, parent_klass);
                }

Modified: 
branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs
===================================================================
--- branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs  
2008-02-19 12:59:42 UTC (rev 96132)
+++ branches/martin/debugger-terrania/debugger/languages/mono/MonoClassType.cs  
2008-02-19 13:14:15 UTC (rev 96133)
@@ -44,6 +44,7 @@
                Hashtable load_handlers;
                int load_handler_id;
 
+               bool is_compiler_generated;
                string full_name;
 
                public MonoClassType (MonoSymbolFile file, Cecil.TypeDefinition 
type)
@@ -64,6 +65,12 @@
                                full_name = sb.ToString ();
                        } else
                                full_name = type.FullName;
+
+                       foreach (Cecil.CustomAttribute cattr in 
type.CustomAttributes) {
+                               string cname = 
cattr.Constructor.DeclaringType.FullName;
+                               if (cname == 
"System.Runtime.CompilerServices.CompilerGeneratedAttribute")
+                                       is_compiler_generated = true;
+                       }
                }
 
                public MonoClassType (MonoSymbolFile file, Cecil.TypeDefinition 
typedef,
@@ -85,6 +92,10 @@
                        get { return type; }
                }
 
+               public override bool IsCompilerGenerated {
+                       get { return is_compiler_generated; }
+               }
+
                public override string Name {
                        get { return full_name; }
                }

Modified: 
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs
===================================================================
--- 
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs 
    2008-02-19 12:59:42 UTC (rev 96132)
+++ 
branches/martin/debugger-terrania/debugger/languages/native/NativeStructType.cs 
    2008-02-19 13:14:15 UTC (rev 96133)
@@ -115,6 +115,10 @@
                        this.fields = fields;
                }
 
+               public override bool IsCompilerGenerated {
+                       get { return false; }
+               }
+
                public override string BaseName {
                        get { return name; }
                }

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to