Beispiel #1
0
 IEnumerable <TreeNode> LazyGetChildNodes()
 {
     foreach (DebugParameterInfo par in stackFrame.MethodInfo.GetParameters())
     {
         string imageName;
         var    image      = ExpressionNode.GetImageForParameter(out imageName);
         var    expression = new ExpressionNode(this, image, par.Name, par.GetExpression());
         expression.ImageName = imageName;
         yield return(expression);
     }
     if (this.stackFrame.HasSymbols)
     {
         foreach (DebugLocalVariableInfo locVar in stackFrame.MethodInfo.GetLocalVariables(this.StackFrame.IP))
         {
             string imageName;
             var    image      = ExpressionNode.GetImageForLocalVariable(out imageName);
             var    expression = new ExpressionNode(this, image, locVar.Name, locVar.GetExpression());
             expression.ImageName = imageName;
             yield return(expression);
         }
     }
     else
     {
         WindowsDebugger debugger = (WindowsDebugger)DebuggerService.CurrentDebugger;
         if (debugger.debuggerDecompilerService != null)
         {
             int typeToken   = this.stackFrame.MethodInfo.DeclaringType.MetadataToken;
             int methodToken = this.stackFrame.MethodInfo.MetadataToken;
             foreach (var localVar in debugger.debuggerDecompilerService.GetLocalVariables(typeToken, methodToken))
             {
                 string imageName;
                 var    image      = ExpressionNode.GetImageForLocalVariable(out imageName);
                 var    expression = new ExpressionNode(this, image, localVar, ExpressionEvaluator.ParseExpression(localVar, SupportedLanguage.CSharp));
                 expression.ImageName = imageName;
                 yield return(expression);
             }
         }
     }
     if (stackFrame.Thread.CurrentException != null)
     {
         yield return(new ExpressionNode(this, null, "__exception", new IdentifierExpression("__exception")));
     }
 }
Beispiel #2
0
 IEnumerable <TreeNode> LazyGetChildNodes()
 {
     foreach (DebugParameterInfo par in stackFrame.MethodInfo.GetParameters())
     {
         string imageName;
         var    image      = ExpressionNode.GetImageForParameter(out imageName);
         var    expression = new ExpressionNode(image, par.Name, par.GetExpression());
         expression.ImageName = imageName;
         yield return(expression);
     }
     foreach (DebugLocalVariableInfo locVar in stackFrame.MethodInfo.GetLocalVariables(this.StackFrame.IP))
     {
         string imageName;
         var    image      = ExpressionNode.GetImageForLocalVariable(out imageName);
         var    expression = new ExpressionNode(image, locVar.Name, locVar.GetExpression());
         expression.ImageName = imageName;
         yield return(expression);
     }
     if (stackFrame.Thread.CurrentException != null)
     {
         yield return(new ExpressionNode(null, "__exception", new IdentifierExpression("__exception")));
     }
 }