Author: toshok
Date: 2005-02-25 17:12:32 -0500 (Fri, 25 Feb 2005)
New Revision: 41221

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backends/mono/MonoFundamentalObjectBase.cs
   trunk/debugger/backends/mono/MonoObject.cs
   trunk/debugger/backends/mono/MonoVariable.cs
   trunk/debugger/backends/native/NativeFundamentalObject.cs
   trunk/debugger/backends/native/NativeObject.cs
   trunk/debugger/frontend/Command.cs
   trunk/debugger/frontend/Expression.cs
   trunk/debugger/frontend/ScriptingContext.cs
   trunk/debugger/frontend/Style.cs
   trunk/debugger/interfaces/ITargetObject.cs
Log:
2005-02-25  Chris Toshok  <[EMAIL PROTECTED]>

        * interfaces/ITargetObject.cs (ITargetObject.TypeInfo): rename
        Type to TypeInfo, to better reflect the type of the property.
        Also, I was getting sick of seeing obj.Type.Type everywhere.

        * frontend/Command.cs, frontend/Expression.cs, frontend/Style.cs,
        frontend/ScriptingContext.cs, backends/native/NativeObject.cs,
        backends/native/NativeFundamentalObject.cs,
        backends/mono/MonoVariable.cs, backends/mono/MonoObject.cs,
        backends/mono/MonoFundamentalObjectBase.cs: deal with the fallout
        of the above change.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-02-25 21:59:19 UTC (rev 41220)
+++ trunk/debugger/ChangeLog    2005-02-25 22:12:32 UTC (rev 41221)
@@ -1,3 +1,16 @@
+2005-02-25  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * interfaces/ITargetObject.cs (ITargetObject.TypeInfo): rename
+       Type to TypeInfo, to better reflect the type of the property.
+       Also, I was getting sick of seeing obj.Type.Type everywhere.
+
+       * frontend/Command.cs, frontend/Expression.cs, frontend/Style.cs,
+       frontend/ScriptingContext.cs, backends/native/NativeObject.cs,
+       backends/native/NativeFundamentalObject.cs,
+       backends/mono/MonoVariable.cs, backends/mono/MonoObject.cs,
+       backends/mono/MonoFundamentalObjectBase.cs: deal with the fallout
+       of the above change.
+       
 2005-02-23  Chris Toshok  <[EMAIL PROTECTED]>
 
        Fix bug #72827.

Modified: trunk/debugger/backends/mono/MonoFundamentalObjectBase.cs
===================================================================
--- trunk/debugger/backends/mono/MonoFundamentalObjectBase.cs   2005-02-25 
21:59:19 UTC (rev 41220)
+++ trunk/debugger/backends/mono/MonoFundamentalObjectBase.cs   2005-02-25 
22:12:32 UTC (rev 41221)
@@ -4,8 +4,8 @@
 {
        internal abstract class MonoFundamentalObjectBase : MonoObject, 
ITargetFundamentalObject
        {
-               public MonoFundamentalObjectBase (MonoTypeInfo type, 
TargetLocation location)
-                       : base (type, location)
+               public MonoFundamentalObjectBase (MonoTypeInfo type_info, 
TargetLocation location)
+                       : base (type_info, location)
                { }
 
                public bool HasObject {
@@ -24,8 +24,8 @@
                {
                        try {
                                ITargetMemoryReader reader;
-                               if (type.HasFixedSize)
-                                       reader = location.ReadMemory 
(type.Size);
+                               if (type_info.HasFixedSize)
+                                       reader = location.ReadMemory 
(type_info.Size);
                                else
                                        reader = GetDynamicContents (location, 
MaximumDynamicSize);
 

Modified: trunk/debugger/backends/mono/MonoObject.cs
===================================================================
--- trunk/debugger/backends/mono/MonoObject.cs  2005-02-25 21:59:19 UTC (rev 
41220)
+++ trunk/debugger/backends/mono/MonoObject.cs  2005-02-25 22:12:32 UTC (rev 
41221)
@@ -4,20 +4,20 @@
 {
        internal abstract class MonoObject : ITargetObject
        {
-               protected MonoTypeInfo type;
+               protected MonoTypeInfo type_info;
                protected TargetLocation location;
                protected bool is_valid;
 
-               public MonoObject (MonoTypeInfo type, TargetLocation location)
+               public MonoObject (MonoTypeInfo type_info, TargetLocation 
location)
                {
-                       this.type = type;
+                       this.type_info = type_info;
                        this.location = location;
                        is_valid = true;
                }
 
-               public ITargetTypeInfo Type {
+               public ITargetTypeInfo TypeInfo {
                        get {
-                               return type;
+                               return type_info;
                        }
                }
 
@@ -30,7 +30,7 @@
                public virtual byte[] RawContents {
                        get {
                                try {
-                                       return location.ReadBuffer (type.Size);
+                                       return location.ReadBuffer 
(type_info.Size);
                                } catch (TargetException ex) {
                                        is_valid = false;
                                        throw new LocationInvalidException (ex);
@@ -38,7 +38,7 @@
                        }
                        set {
                                try {
-                                       if (!type.HasFixedSize || (value.Length 
!= type.Size))
+                                       if (!type_info.HasFixedSize || 
(value.Length != type_info.Size))
                                                throw new ArgumentException ();
                                        location.WriteBuffer (value);
                                } catch (TargetException ex) {
@@ -56,12 +56,12 @@
 
                public virtual long DynamicSize {
                        get {
-                               if (type.HasFixedSize)
+                               if (type_info.HasFixedSize)
                                        throw new InvalidOperationException ();
 
                                try {
                                        TargetLocation dynamic_location;
-                                       ITargetMemoryReader reader = 
location.ReadMemory (type.Size);
+                                       ITargetMemoryReader reader = 
location.ReadMemory (type_info.Size);
                                        return GetDynamicSize (reader, 
location, out dynamic_location);
                                } catch (TargetException ex) {
                                        is_valid = false;
@@ -72,7 +72,7 @@
 
                public virtual byte[] GetRawDynamicContents (int max_size)
                {
-                       if (type.HasFixedSize)
+                       if (type_info.HasFixedSize)
                                throw new InvalidOperationException ();
 
                        try {
@@ -88,7 +88,7 @@
                {
                        try {
                                TargetLocation dynamic_location;
-                               ITargetMemoryReader reader = 
location.ReadMemory (type.Size);
+                               ITargetMemoryReader reader = 
location.ReadMemory (type_info.Size);
                                long size = GetDynamicSize (reader, location, 
out dynamic_location);
 
                                if ((max_size > 0) && (size > (long) max_size))
@@ -126,7 +126,7 @@
 
                public override string ToString ()
                {
-                       return String.Format ("{0} [{1}]", GetType (), Type);
+                       return String.Format ("{0} [{1}]", GetType (), 
TypeInfo);
                }
        }
 }

Modified: trunk/debugger/backends/mono/MonoVariable.cs
===================================================================
--- trunk/debugger/backends/mono/MonoVariable.cs        2005-02-25 21:59:19 UTC 
(rev 41220)
+++ trunk/debugger/backends/mono/MonoVariable.cs        2005-02-25 22:12:32 UTC 
(rev 41221)
@@ -133,7 +133,7 @@
 
                public void SetObject (StackFrame frame, ITargetObject obj)
                {
-                       if (obj.Type.Type != Type)
+                       if (obj.TypeInfo.Type != Type)
                                throw new InvalidOperationException ();
                        // TargetLocation location = GetLocation (frame);
                        // type.SetObject (location, (MonoObject) obj);

Modified: trunk/debugger/backends/native/NativeFundamentalObject.cs
===================================================================
--- trunk/debugger/backends/native/NativeFundamentalObject.cs   2005-02-25 
21:59:19 UTC (rev 41220)
+++ trunk/debugger/backends/native/NativeFundamentalObject.cs   2005-02-25 
22:12:32 UTC (rev 41221)
@@ -34,8 +34,8 @@
                {
                        try {
                                ITargetMemoryReader reader;
-                               if (type.HasFixedSize)
-                                       reader = location.ReadMemory 
(type.Size);
+                               if (type_info.HasFixedSize)
+                                       reader = location.ReadMemory 
(type_info.Size);
                                else
                                        reader = GetDynamicContents (location, 
MaximumDynamicSize);
 
@@ -50,7 +50,7 @@
                {
                        try {
                                byte [] data = CreateObject (obj);
-                               if (!type.HasFixedSize || (data == null) || 
(data.Length != type.Size))
+                               if (!type_info.HasFixedSize || (data == null) 
|| (data.Length != type_info.Size))
                                        throw new NotSupportedException ();
 
                                RawContents = data;
@@ -62,7 +62,7 @@
 
                protected object GetObject (ITargetMemoryReader reader, 
TargetLocation locaction)
                {
-                       switch (System.Type.GetTypeCode ((Type) 
type.Type.TypeHandle)) {
+                       switch (System.Type.GetTypeCode ((Type) 
type_info.Type.TypeHandle)) {
                        case TypeCode.Boolean:
                                return reader.BinaryReader.PeekByte () != 0;
 
@@ -106,7 +106,7 @@
 
                protected byte[] CreateObject (object obj)
                {
-                       switch (System.Type.GetTypeCode ((Type) 
type.Type.TypeHandle)) {
+                       switch (System.Type.GetTypeCode ((Type) 
type_info.Type.TypeHandle)) {
                        case TypeCode.Boolean:
                                return BitConverter.GetBytes (Convert.ToBoolean 
(obj));
 

Modified: trunk/debugger/backends/native/NativeObject.cs
===================================================================
--- trunk/debugger/backends/native/NativeObject.cs      2005-02-25 21:59:19 UTC 
(rev 41220)
+++ trunk/debugger/backends/native/NativeObject.cs      2005-02-25 22:12:32 UTC 
(rev 41221)
@@ -4,20 +4,20 @@
 {
        internal abstract class NativeObject : ITargetObject
        {
-               protected ITargetTypeInfo type;
+               protected ITargetTypeInfo type_info;
                protected TargetLocation location;
                protected bool is_valid;
 
-               public NativeObject (ITargetTypeInfo type, TargetLocation 
location)
+               public NativeObject (ITargetTypeInfo type_info, TargetLocation 
location)
                {
-                       this.type = type;
+                       this.type_info = type_info;
                        this.location = location;
                        is_valid = true;
                }
 
-               public ITargetTypeInfo Type {
+               public ITargetTypeInfo TypeInfo {
                        get {
-                               return type;
+                               return type_info;
                        }
                }
 
@@ -30,7 +30,7 @@
                public virtual byte[] RawContents {
                        get {
                                try {
-                                       return location.ReadBuffer (type.Size);
+                                       return location.ReadBuffer 
(type_info.Size);
                                } catch (TargetException ex) {
                                        is_valid = false;
                                        throw new LocationInvalidException (ex);
@@ -38,7 +38,7 @@
                        }
                        set {
                                try {
-                                       if (!type.HasFixedSize || (value.Length 
!= type.Size))
+                                       if (!type_info.HasFixedSize || 
(value.Length != type_info.Size))
                                                throw new ArgumentException ();
                                        location.WriteBuffer (value);
                                } catch (TargetException ex) {
@@ -56,12 +56,12 @@
 
                public virtual long DynamicSize {
                        get {
-                               if (type.HasFixedSize)
+                               if (type_info.HasFixedSize)
                                        throw new InvalidOperationException ();
 
                                try {
                                        TargetLocation dynamic_location;
-                                       ITargetMemoryReader reader = 
location.ReadMemory (type.Size);
+                                       ITargetMemoryReader reader = 
location.ReadMemory (type_info.Size);
                                        return GetDynamicSize (reader, 
location, out dynamic_location);
                                } catch (TargetException ex) {
                                        is_valid = false;
@@ -72,7 +72,7 @@
 
                public virtual byte[] GetRawDynamicContents (int max_size)
                {
-                       if (type.HasFixedSize)
+                       if (type_info.HasFixedSize)
                                throw new InvalidOperationException ();
 
                        try {
@@ -88,7 +88,7 @@
                {
                        try {
                                TargetLocation dynamic_location;
-                               ITargetMemoryReader reader = 
location.ReadMemory (type.Size);
+                               ITargetMemoryReader reader = 
location.ReadMemory (type_info.Size);
                                long size = GetDynamicSize (reader, location, 
out dynamic_location);
 
                                if ((max_size > 0) && (size > (long) max_size))
@@ -121,7 +121,7 @@
 
                public override string ToString ()
                {
-                       return String.Format ("{0} [{1}]", GetType (), Type);
+                       return String.Format ("{0} [{1}]", GetType (), 
TypeInfo);
                }
        }
 }

Modified: trunk/debugger/frontend/Command.cs
===================================================================
--- trunk/debugger/frontend/Command.cs  2005-02-25 21:59:19 UTC (rev 41220)
+++ trunk/debugger/frontend/Command.cs  2005-02-25 22:12:32 UTC (rev 41221)
@@ -347,7 +347,7 @@
 
                        case Format.Object:
                                ITargetObject obj = expression.EvaluateVariable 
(context);
-                               context.PrintType (obj.Type.Type);
+                               context.PrintType (obj.TypeInfo.Type);
                                break;
 
                        case Format.Current:
@@ -355,7 +355,7 @@
                                ITargetClassObject cobj = obj as 
ITargetClassObject;
                                if (cobj != null)
                                        obj = cobj.CurrentObject;
-                               context.PrintType (obj.Type.Type);
+                               context.PrintType (obj.TypeInfo.Type);
                                break;
 
                        default:

Modified: trunk/debugger/frontend/Expression.cs
===================================================================
--- trunk/debugger/frontend/Expression.cs       2005-02-25 21:59:19 UTC (rev 
41220)
+++ trunk/debugger/frontend/Expression.cs       2005-02-25 22:12:32 UTC (rev 
41221)
@@ -28,7 +28,7 @@
 
                protected virtual ITargetType DoEvaluateType (ScriptingContext 
context)
                {
-                       return EvaluateVariable (context).Type.Type;
+                       return EvaluateVariable (context).TypeInfo.Type;
                }
 
                public ITargetType EvaluateType (ScriptingContext context)
@@ -455,11 +455,11 @@
                        if (!var.CanWrite)
                                return false;
 
-                       if (var.Type != obj.Type.Type)
+                       if (var.Type != obj.TypeInfo.Type)
                                throw new ScriptingException (
                                        "Type mismatch: cannot assign 
expression of type " +
                                        "`{0}' to variable `{1}', which is of 
type `{2}'.",
-                                       obj.Type.Type.Name, Name, 
var.Type.Name);
+                                       obj.TypeInfo.Type.Name, Name, 
var.Type.Name);
 
                        var.SetObject (context.CurrentFrame.Frame, obj);
                        return true;
@@ -1542,7 +1542,7 @@
                static ITargetObject TryCast (ScriptingContext context, 
ITargetObject source,
                                              ITargetClassType target_type)
                {
-                       if (source.Type.Type == target_type)
+                       if (source.TypeInfo.Type == target_type)
                                return source;
 
                        ITargetClassObject sobj = source as ITargetClassObject;
@@ -1586,7 +1586,7 @@
                        if (obj == null)
                                return null;
 
-                       return obj.Type.Type;
+                       return obj.TypeInfo.Type;
                }
        }
 

Modified: trunk/debugger/frontend/ScriptingContext.cs
===================================================================
--- trunk/debugger/frontend/ScriptingContext.cs 2005-02-25 21:59:19 UTC (rev 
41220)
+++ trunk/debugger/frontend/ScriptingContext.cs 2005-02-25 22:12:32 UTC (rev 
41221)
@@ -939,9 +939,9 @@
 
                public string DumpObject (ITargetObject obj)
                {
-                       long dynamic = obj.Type.HasFixedSize ? -1 : 
obj.DynamicSize;
+                       long dynamic = obj.TypeInfo.HasFixedSize ? -1 : 
obj.DynamicSize;
                        return String.Format ("object:{0}:{1}:{2}", obj.IsValid,
-                                             dynamic, DumpType (obj.Type));
+                                             dynamic, DumpType (obj.TypeInfo));
                }
 
                public string DumpType (ITargetTypeInfo type)

Modified: trunk/debugger/frontend/Style.cs
===================================================================
--- trunk/debugger/frontend/Style.cs    2005-02-25 21:59:19 UTC (rev 41220)
+++ trunk/debugger/frontend/Style.cs    2005-02-25 22:12:32 UTC (rev 41221)
@@ -212,7 +212,7 @@
                        }
                        else if (obj is ITargetObject) {
                                ITargetObject tobj = (ITargetObject) obj;
-                               return String.Format ("({0}) {1}", 
tobj.Type.Type.Name,
+                               return String.Format ("({0}) {1}", 
tobj.TypeInfo.Type.Name,
                                                      FormatObject (tobj, 
false));
                        }
                        else {
@@ -451,11 +451,11 @@
 
                protected string DoFormatObjectRecursed (ITargetObject obj)
                {
-                       switch (obj.Type.Type.Kind) {
+                       switch (obj.TypeInfo.Type.Kind) {
                        case TargetObjectKind.Class:
                        case TargetObjectKind.Struct:
                                return String.Format (
-                                       "({0}) {1}", obj.Type.Type.Name, 
obj.Location.Address);
+                                       "({0}) {1}", obj.TypeInfo.Type.Name, 
obj.Location.Address);
 
                        default:
                                return obj.Print ();
@@ -464,7 +464,7 @@
 
                protected string DoFormatObject (ITargetObject obj)
                {
-                       switch (obj.Type.Type.Kind) {
+                       switch (obj.TypeInfo.Type.Kind) {
                        case TargetObjectKind.Array: {
                                ITargetArrayObject aobj = (ITargetArrayObject) 
obj;
                                StringBuilder sb = new StringBuilder ("[");
@@ -483,7 +483,7 @@
                                ITargetPointerObject pobj = 
(ITargetPointerObject) obj;
                                if (pobj.Type.IsTypesafe && 
pobj.HasDereferencedObject) {
                                        ITargetObject deref = 
pobj.DereferencedObject;
-                                       return String.Format ("&({0}) {1}", 
deref.Type.Type.Name,
+                                       return String.Format ("&({0}) {1}", 
deref.TypeInfo.Type.Name,
                                                              FormatObject 
(deref, false));
                                } else
                                        return pobj.Print ();

Modified: trunk/debugger/interfaces/ITargetObject.cs
===================================================================
--- trunk/debugger/interfaces/ITargetObject.cs  2005-02-25 21:59:19 UTC (rev 
41220)
+++ trunk/debugger/interfaces/ITargetObject.cs  2005-02-25 22:12:32 UTC (rev 
41221)
@@ -3,9 +3,9 @@
        public interface ITargetObject
        {
                // <summary>
-               //   The type of this object.
+               //   The type info of this object.
                // </summary>
-               ITargetTypeInfo Type {
+               ITargetTypeInfo TypeInfo {
                        get;
                }
 

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

Reply via email to