Author: toshok
Date: 2005-07-05 20:06:12 -0400 (Tue, 05 Jul 2005)
New Revision: 46982

Added:
   trunk/debugger/backends/native/NativeEnumObject.cs
   trunk/debugger/backends/native/NativeEnumType.cs
Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backends/native/Makefile.am
Log:
2005-07-05  Chris Toshok  <[EMAIL PROTECTED]>

        * backends/native/Makefile.am (EXTRA_DIST): add
        NativeEnum{Object,Type}.cs

        * backends/native/NativeEnumObject.cs,
        backends/native/NativeEnumType.cs: barebones native support for
        enumerated types.

        * arch/DwarfReader.cs: add support for enumerator and
        enumeration_type DIE's.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-07-05 23:32:03 UTC (rev 46981)
+++ trunk/debugger/ChangeLog    2005-07-06 00:06:12 UTC (rev 46982)
@@ -1,5 +1,17 @@
 2005-07-05  Chris Toshok  <[EMAIL PROTECTED]>
 
+       * backends/native/Makefile.am (EXTRA_DIST): add
+       NativeEnum{Object,Type}.cs
+
+       * backends/native/NativeEnumObject.cs,
+       backends/native/NativeEnumType.cs: barebones native support for
+       enumerated types.
+
+       * arch/DwarfReader.cs: add support for enumerator and
+       enumeration_type DIE's.
+
+2005-07-05  Chris Toshok  <[EMAIL PROTECTED]>
+
        * backends/mono/MonoArrayTypeInfo.cs: remove unused using.
 
        * backends/mono/MonoClassInfo.cs: remove the MonoClassType. prefix

Modified: trunk/debugger/backends/native/Makefile.am
===================================================================
--- trunk/debugger/backends/native/Makefile.am  2005-07-05 23:32:03 UTC (rev 
46981)
+++ trunk/debugger/backends/native/Makefile.am  2005-07-06 00:06:12 UTC (rev 
46982)
@@ -1,5 +1,5 @@
 EXTRA_DIST = \
-       NativeArrayObject.cs NativeArrayType.cs NativeFunctionObject.cs 
NativeFunctionType.cs NativeFundamentalObject.cs \
-       NativeFundamentalType.cs NativeLanguage.cs NativeObject.cs 
NativeOpaqueObject.cs NativeOpaqueType.cs \
+       NativeArrayObject.cs NativeArrayType.cs NativeEnumObject.cs 
NativeEnumType.cs NativeFunctionObject.cs NativeFunctionType.cs \
+       NativeFundamentalObject.cs NativeFundamentalType.cs NativeLanguage.cs 
NativeObject.cs NativeOpaqueObject.cs NativeOpaqueType.cs \
        NativePointerObject.cs NativePointerType.cs NativeStringObject.cs 
NativeStringType.cs NativeStructObject.cs \
        NativeStructType.cs NativeType.cs NativeTypeAlias.cs

Added: trunk/debugger/backends/native/NativeEnumObject.cs
===================================================================
--- trunk/debugger/backends/native/NativeEnumObject.cs  2005-07-05 23:32:03 UTC 
(rev 46981)
+++ trunk/debugger/backends/native/NativeEnumObject.cs  2005-07-06 00:06:12 UTC 
(rev 46982)
@@ -0,0 +1,34 @@
+using System;
+
+namespace Mono.Debugger.Languages.Native
+{
+       internal class NativeEnumObject : NativeObject, ITargetEnumObject
+       {
+               NativeEnumType type;
+
+               public NativeEnumObject (NativeEnumType type, TargetLocation 
location)
+                       : base (type, location)
+               {
+                       this.type = type;
+               }
+
+               public ITargetEnumType Type {
+                       get {
+                               return type;
+                       }
+               }
+
+               public ITargetObject Value {
+                       get {
+                               return type.GetObject (location);
+                       }
+               }
+
+               protected override long GetDynamicSize (ITargetMemoryReader 
reader,
+                                                       TargetLocation location,
+                                                       out TargetLocation 
dynamic_location)
+               {
+                       throw new InvalidOperationException ();
+               }
+       }
+}

Added: trunk/debugger/backends/native/NativeEnumType.cs
===================================================================
--- trunk/debugger/backends/native/NativeEnumType.cs    2005-07-05 23:32:03 UTC 
(rev 46981)
+++ trunk/debugger/backends/native/NativeEnumType.cs    2005-07-06 00:06:12 UTC 
(rev 46982)
@@ -0,0 +1,55 @@
+using System;
+
+namespace Mono.Debugger.Languages.Native
+{
+  internal class NativeEnumType : NativeType, ITargetEnumType
+  {
+       string[] element_names;
+       int[] element_values;
+
+       NativeFieldInfo[] members;
+       NativeFieldInfo value;
+
+       public NativeEnumType (string name, int size, string[] element_names, 
int[] element_values)
+               : base (name, TargetObjectKind.Enum, size, true)
+       {
+               this.element_names = element_names;
+               this.element_values = element_values;
+
+               members = new NativeFieldInfo [element_names.Length];
+               int i;
+               for (i = 0; i < element_names.Length; i ++) {
+                       members[i] = new NativeFieldInfo (this, 
element_names[i], i, 0);
+               }
+       }
+
+
+       public ITargetFieldInfo Value {
+               get {
+                       return value;
+               }
+       }
+
+       public ITargetFieldInfo[] Members {
+               get {
+                       return members;
+               }
+       }
+
+       public ITargetObject GetMember (StackFrame frame, int index)
+       {
+               return null;
+       }
+
+       public override bool IsByRef {
+               get {
+                       return false;
+               }
+       }
+
+       public override NativeObject GetObject (TargetLocation location)
+       {
+               return new NativeEnumObject (this, location);
+       }
+  }
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to