GetObject() public method

Retrieve an instance of this variable from the stack-frame @frame. May only be called if Type.HasObject is true.
An instance of IVariable contains information about a variable (for instance a parameter of local variable of a method), but it's not bound to any particular target location. This also means that it won't get invalid after the target exited.
public GetObject ( StackFrame frame ) : TargetObject
frame StackFrame
return TargetObject
		public static AbstractVariable Create(TargetVariable variable, StackFrame stackFrame)
		{
			TargetObject obj;
			
			try {
				obj = variable.GetObject(stackFrame);
			} catch {
				return new ErrorVariable(variable.Name, "Can not get object");
			}
			
			return Create(variable.Name, obj, stackFrame);
		}
Example #2
0
        public void FormatVariable(StackFrame frame, TargetVariable variable)
        {
            TargetObject obj = null;

            Append ("{0} = ", variable.Name);

            if (!variable.IsAlive (frame.TargetAddress)) {
                Append ("<optimized out>");
                return;
            }

            try {
                obj = variable.GetObject (frame);
                if (obj != null)
                    Format (frame.Thread, obj);
                else
                    Append ("<cannot display object>");
            } catch {
                Append ("<cannot display object>");
            }
        }