Mono.Debugger.Languages.TargetVariable.IsAlive C# (CSharp) Method

IsAlive() public abstract method

Checks whether the variable is alive at @address, but without actually trying to access the variable. The implementation just checks the data from the symbol file and - if appropriate - from the JIT to find out whether the specified address is within the variable's live range.
public abstract IsAlive ( TargetAddress address ) : bool
address TargetAddress
return bool
        public abstract bool IsAlive(TargetAddress address);

Usage Example

Exemplo n.º 1
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>");
            }
        }