Example #1
0
        internal Exception(Thread thread)
        {
            creationTime  = DateTime.Now;
            this.process  = thread.Process;
            this.thread   = thread;
            corValue      = thread.CorThread.CurrentException;
            exceptionType = thread.CurrentExceptionType;
            Value runtimeValue = new Value(process,
                                           new IExpirable[] { process.PauseSession },
                                           new IMutable[] {},
                                           delegate { return(corValue); });
            NamedValue nv = runtimeValue.GetMember("_message");

            if (!nv.IsNull)
            {
                message = nv.AsString;
            }
            else
            {
                message = runtimeValue.Type.FullName;
            }
            if (thread.LastFunctionWithLoadedSymbols != null)
            {
                location = thread.LastFunctionWithLoadedSymbols.NextStatement;
            }

            callstack = "";
            int callstackItems = 0;

            if (!nv.IsNull)
            {
                foreach (Function function in thread.Callstack)
                {
                    if (callstackItems >= 100)
                    {
                        callstack += "...\n";
                        break;
                    }

                    SourcecodeSegment loc = function.NextStatement;
                    callstack += function.Name + "()";
                    if (loc != null)
                    {
                        callstack += " - " + loc.SourceFullFilename + ":" + loc.StartLine + "," + loc.StartColumn;
                    }
                    callstack += "\n";
                    callstackItems++;
                }
            }

            type = runtimeValue.Type.FullName;
        }
Example #2
0
 public ArrayValueItem(NamedValue val, DebugType type, Value arr, Value sz_arr, int ind):base(val,type)
 {
     this.arr = arr;
     this.ind = ind;
     System.Reflection.FieldInfo tmp_fi = AssemblyHelper.GetType(arr.Type.FullName).GetField("LowerIndex");
     if (!tmp_fi.FieldType.IsEnum)
         low_bound = tmp_fi.GetRawConstantValue();
     else
         low_bound = tmp_fi.GetValue(sz_arr);
 }
Example #3
0
 public void AddArrayVariable(NamedValue lv)
 {
     //dgLocalVars.Rows.Add(lv.Name, lv.AsString);
 }
Example #4
0
        public ValueItem(NamedValue val, DebugType declaringType)
        {
            this.val = val;
			this.declaringType = declaringType;
			
			try
            {
				//this.primitive = val.IsPrimitive;
            }
			catch(System.Exception e)
            {
                if (val.Type.IsByRef()) this.primitive = false;
            }
            val.Changed += delegate { OnChanged(new ListItemEventArgs(this)); };
        }
Example #5
0
 public void AddObjectVariable(NamedValue lv)
 {
     if (lv.IsArray)
     {
         AddArrayVariable(lv);
         return;
     }
     NamedValueCollection nvc = lv.GetMembers();
     //System.Windows.Forms.TreeView obj = new System.Windows.Forms.TreeView();
     //obj.Nodes.Add(
     // dgLocalVars.Rows.Add(lv.Name, "<object>");
 }