TreeNodeWrapper UpdateNode(TreeNodeWrapper node) { try { LoggingService.Info("Evaluating: " + (string.IsNullOrEmpty(node.Node.Name) ? "is null or empty!" : node.Node.Name)); var nodExpression = debugger.GetExpression(node.Node.Name); //Value val = ExpressionEvaluator.Evaluate(nod.Name, nod.Language, debuggedProcess.SelectedStackFrame); ExpressionNode valNode = new ExpressionNode(null, null, node.Node.Name, nodExpression); return(valNode.ToSharpTreeNode()); } catch (GetValueException) { string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), node.Node.Name); ErrorInfoNode infoNode = new ErrorInfoNode(node.Node.Name, error); return(infoNode.ToSharpTreeNode()); } }
public override void RefreshPad() { if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) { return; } using (new PrintTimes("Watch Pad refresh")) { try { watchList.BeginUpdate(); Utils.DoEvents(debuggedProcess); List <TreeViewVarNode> nodes = new List <TreeViewVarNode>(); foreach (var nod in watches) { try { LoggingService.Info("Evaluating: " + (string.IsNullOrEmpty(nod.Name) ? "is null or empty!" : nod.Name)); Value val = AstEvaluator.Evaluate(nod.Name, SupportedLanguage.CSharp, debuggedProcess.SelectedStackFrame); ValueNode valNode = new ValueNode(val); valNode.SetName(nod.Name); nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, valNode)); } catch (GetValueException) { string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Name); ErrorInfoNode infoNode = new ErrorInfoNode(nod.Name, error); nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, infoNode)); } } watchList.Root.Children.Clear(); foreach (TreeViewVarNode nod in nodes) { watchList.Root.Children.Add(nod); } } catch (AbortedBecauseDebuggeeResumedException) { } catch (Exception ex) { if (debuggedProcess == null || debuggedProcess.HasExited) { // Process unexpectedly exited } else { MessageService.ShowError(ex); } } } watchList.EndUpdate(); }
public override void RefreshPad() { if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) { return; } using (new PrintTimes("Watch Pad refresh")) { try { Utils.DoEvents(debuggedProcess); List <TreeNode> nodes = new List <TreeNode>(); foreach (var nod in watchList.WatchItems) { try { LoggingService.Info("Evaluating: " + (string.IsNullOrEmpty(nod.Name) ? "is null or empty!" : nod.Name)); var nodExpression = debugger.GetExpression(nod.Name); //Value val = ExpressionEvaluator.Evaluate(nod.Name, nod.Language, debuggedProcess.SelectedStackFrame); ExpressionNode valNode = new ExpressionNode(null, nod.Name, nodExpression); nodes.Add(valNode); } catch (GetValueException) { string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Name); ErrorInfoNode infoNode = new ErrorInfoNode(nod.Name, error); nodes.Add(infoNode); } } // rebuild list watchList.WatchItems.Clear(); foreach (var nod in nodes) { watchList.WatchItems.Add(nod); } } catch (AbortedBecauseDebuggeeResumedException) { } catch (Exception ex) { if (debuggedProcess == null || debuggedProcess.HasExited) { // Process unexpectedly exited } else { MessageService.ShowException(ex); } } } }
public override void RefreshPad() { if (debuggedProcess == null || debuggedProcess.IsRunning) return; using(new PrintTimes("Watch Pad refresh")) { try { Utils.DoEvents(debuggedProcess); List<TreeNode> nodes = new List<TreeNode>(); foreach (var node in watchList.WatchItems) { try { LoggingService.Info("Evaluating: " + (string.IsNullOrEmpty(node.Name) ? "is null or empty!" : node.Name)); var nodExpression = debugger.GetExpression(node.Name); //Value val = ExpressionEvaluator.Evaluate(nod.Name, nod.Language, debuggedProcess.SelectedStackFrame); ExpressionNode valNode = new ExpressionNode(null, node.Name, nodExpression); nodes.Add(valNode); } catch (GetValueException) { string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), node.Name); ErrorInfoNode infoNode = new ErrorInfoNode(node.Name, error); nodes.Add(infoNode); } } // rebuild list watchList.WatchItems.Clear(); foreach (var node in nodes) watchList.WatchItems.Add(node); } catch(AbortedBecauseDebuggeeResumedException) { } catch(Exception ex) { if (debuggedProcess == null || debuggedProcess.HasExited) { // Process unexpectedly exited } else { MessageService.ShowException(ex); } } } }
TreeNodeWrapper UpdateNode(TreeNodeWrapper node) { try { LoggingService.Info("Evaluating: " + (string.IsNullOrEmpty(node.Node.Name) ? "is null or empty!" : node.Node.Name)); var nodExpression = debugger.GetExpression(node.Node.Name); //Value val = ExpressionEvaluator.Evaluate(nod.Name, nod.Language, debuggedProcess.SelectedStackFrame); ExpressionNode valNode = new ExpressionNode(null, null, node.Node.Name, nodExpression); return valNode.ToSharpTreeNode(); } catch (GetValueException) { string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), node.Node.Name); ErrorInfoNode infoNode = new ErrorInfoNode(node.Node.Name, error); return infoNode.ToSharpTreeNode(); } }
public override void RefreshPad() { if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) return; using(new PrintTimes("Watch Pad refresh")) { try { watchList.BeginUpdate(); Utils.DoEvents(debuggedProcess); List<TreeViewVarNode> nodes = new List<TreeViewVarNode>(); foreach (var nod in watches) { try { LoggingService.Info("Evaluating: " + (string.IsNullOrEmpty(nod.Name) ? "is null or empty!" : nod.Name)); Value val = AstEvaluator.Evaluate(nod.Name, SupportedLanguage.CSharp, debuggedProcess.SelectedStackFrame); ValueNode valNode = new ValueNode(val); valNode.SetName(nod.Name); nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, valNode)); } catch (GetValueException) { string error = String.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.InvalidExpression}"), nod.Name); ErrorInfoNode infoNode = new ErrorInfoNode(nod.Name, error); nodes.Add(new TreeViewVarNode(debuggedProcess, watchList, infoNode)); } } watchList.Root.Children.Clear(); foreach (TreeViewVarNode nod in nodes) watchList.Root.Children.Add(nod); } catch(AbortedBecauseDebuggeeResumedException) { } catch(Exception ex) { if (debuggedProcess == null || debuggedProcess.HasExited) { // Process unexpectedly exited } else { MessageService.ShowError(ex); } } } watchList.EndUpdate(); }