Beispiel #1
0
        string Evaluate(string code)
        {
            Process    process = WindowsDebugger.CurrentProcess;
            StackFrame frame   = WindowsDebugger.CurrentStackFrame;

            if (process == null)
            {
                return("No process is being debugged");
            }
            if (process.IsRunning)
            {
                return("The process is running");
            }
            if (frame == null)
            {
                return("No current execution frame");
            }

            try {
                var val = WindowsDebugger.Evaluate(code, allowSetValue: true);
                return(ExpressionEvaluationVisitor.FormatValue(WindowsDebugger.EvalThread, val));
            } catch (GetValueException e) {
                return(e.Message);
            }
        }
Beispiel #2
0
        SharpTreeNodeAdapter MakeNode(string name)
        {
            LoggingService.Info("Evaluating watch: " + name);
            TreeNode node = null;

            try {
                node = new ValueNode(null, name,
                                     () => {
                    if (string.IsNullOrWhiteSpace(name))
                    {
                        return(null);
                    }
                    return(WindowsDebugger.Evaluate(name));
                });
            } catch (GetValueException e) {
                node = new TreeNode(null, name, e.Message, string.Empty, null);
            }
            node.CanDelete        = true;
            node.CanSetName       = true;
            node.PropertyChanged += (s, e) => {
                if (e.PropertyName == "Name")
                {
                    WindowsDebugger.RefreshPads();
                }
            };
            return(node.ToSharpTreeNode());
        }