Author: martin
Date: 2005-03-09 21:14:31 -0500 (Wed, 09 Mar 2005)
New Revision: 41626

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/arch/DwarfReader.cs
   trunk/debugger/arch/StabsReader.cs
   trunk/debugger/backends/mono/MonoVariable.cs
   trunk/debugger/frontend/Expression.cs
   trunk/debugger/frontend/ScriptingContext.cs
   trunk/debugger/interfaces/IVariable.cs
Log:
2005-03-10  Martin Baulig  <[EMAIL PROTECTED]>

        * interfaces/IVariable.cs (IVariable.GetLocation): New method.

        * frontend/Expression.cs (VariableAccessExpression): Derive from
        PointerExpression, not just Expression.
        (AddressOfExpression.EvaluateAddress): If `expr' is a
        PointerExpression, call EvaluateAddress() on it.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-03-09 23:27:23 UTC (rev 41625)
+++ trunk/debugger/ChangeLog    2005-03-10 02:14:31 UTC (rev 41626)
@@ -1,3 +1,12 @@
+2005-03-10  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * interfaces/IVariable.cs (IVariable.GetLocation): New method.
+
+       * frontend/Expression.cs (VariableAccessExpression): Derive from
+       PointerExpression, not just Expression.
+       (AddressOfExpression.EvaluateAddress): If `expr' is a
+       PointerExpression, call EvaluateAddress() on it.
+
 2005-03-09  Martin Baulig  <[EMAIL PROTECTED]>
 
        * backends/mono/MonoLanguageBackend.cs (MonoLanguageBackend):

Modified: trunk/debugger/arch/DwarfReader.cs
===================================================================
--- trunk/debugger/arch/DwarfReader.cs  2005-03-09 23:27:23 UTC (rev 41625)
+++ trunk/debugger/arch/DwarfReader.cs  2005-03-10 02:14:31 UTC (rev 41626)
@@ -2422,7 +2422,7 @@
                                return true;
                        }
 
-                       protected TargetLocation GetAddress (StackFrame frame)
+                       public TargetLocation GetLocation (StackFrame frame)
                        {
                                int off;
 
@@ -2450,7 +2450,7 @@
 
                        public ITargetObject GetObject (StackFrame frame)
                        {
-                               TargetLocation location = GetAddress (frame);
+                               TargetLocation location = GetLocation (frame);
                                if (location == null)
                                        return null;
 

Modified: trunk/debugger/arch/StabsReader.cs
===================================================================
--- trunk/debugger/arch/StabsReader.cs  2005-03-09 23:27:23 UTC (rev 41625)
+++ trunk/debugger/arch/StabsReader.cs  2005-03-10 02:14:31 UTC (rev 41626)
@@ -849,7 +849,7 @@
                                return true;
                        }
 
-                       protected TargetLocation GetAddress (StackFrame frame)
+                       public TargetLocation GetLocation (StackFrame frame)
                        {
                                return new MonoVariableLocation (
                                        frame, true, (int) I386Register.EBP, 
offset,
@@ -858,7 +858,7 @@
 
                        public ITargetObject GetObject (StackFrame frame)
                        {
-                               TargetLocation location = GetAddress (frame);
+                               TargetLocation location = GetLocation (frame);
                                if (location == null)
                                        return null;
 

Modified: trunk/debugger/backends/mono/MonoVariable.cs
===================================================================
--- trunk/debugger/backends/mono/MonoVariable.cs        2005-03-09 23:27:23 UTC 
(rev 41625)
+++ trunk/debugger/backends/mono/MonoVariable.cs        2005-03-10 02:14:31 UTC 
(rev 41626)
@@ -83,7 +83,7 @@
                        get { return end_liveness; }
                }
 
-               TargetLocation GetLocation (StackFrame frame)
+               public TargetLocation GetLocation (StackFrame frame)
                {
                        if (info.Mode == VariableInfo.AddressMode.Register)
                                return new MonoVariableLocation (

Modified: trunk/debugger/frontend/Expression.cs
===================================================================
--- trunk/debugger/frontend/Expression.cs       2005-03-09 23:27:23 UTC (rev 
41625)
+++ trunk/debugger/frontend/Expression.cs       2005-03-10 02:14:31 UTC (rev 
41626)
@@ -420,7 +420,7 @@
                }
        }
 
-       public class VariableAccessExpression : Expression
+       public class VariableAccessExpression : PointerExpression
        {
                IVariable var;
 
@@ -450,6 +450,11 @@
                        return context.CurrentFrame.GetVariable (var);
                }
 
+               public override TargetLocation EvaluateAddress 
(ScriptingContext context)
+               {
+                       return context.CurrentFrame.GetVariableLocation (var);
+               }
+
                protected override bool DoAssign (ScriptingContext context, 
ITargetObject obj)
                {
                        if (!var.CanWrite)
@@ -1384,6 +1389,10 @@
 
                public override TargetLocation EvaluateAddress 
(ScriptingContext context)
                {
+                       PointerExpression pexpr = expr as PointerExpression;
+                       if (pexpr != null)
+                               return pexpr.EvaluateAddress (context);
+
                        ITargetObject obj = expr.EvaluateVariable (context);
                        if (!obj.Location.HasAddress)
                                throw new ScriptingException (

Modified: trunk/debugger/frontend/ScriptingContext.cs
===================================================================
--- trunk/debugger/frontend/ScriptingContext.cs 2005-03-09 23:27:23 UTC (rev 
41625)
+++ trunk/debugger/frontend/ScriptingContext.cs 2005-03-10 02:14:31 UTC (rev 
41626)
@@ -195,6 +195,11 @@
                        return var.GetObject (frame);
                }
 
+               public TargetLocation GetVariableLocation (IVariable var)
+               {
+                       return var.GetLocation (frame);
+               }
+
                public ILanguage Language {
                        get {
                                if (frame.Language == null)

Modified: trunk/debugger/interfaces/IVariable.cs
===================================================================
--- trunk/debugger/interfaces/IVariable.cs      2005-03-09 23:27:23 UTC (rev 
41625)
+++ trunk/debugger/interfaces/IVariable.cs      2005-03-10 02:14:31 UTC (rev 
41626)
@@ -40,6 +40,8 @@
                // </remarks>
                ITargetObject GetObject (StackFrame frame);
 
+               TargetLocation GetLocation (StackFrame frame);
+
                bool CanWrite {
                        get;
                }

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

Reply via email to