ObjectValue CreateObjectValue (string name, ResultData data) { string vname = data.GetValueString("name"); string typeName = data.GetValueString ("type"); string value = data.GetValueString ("value"); int nchild = data.GetInt ("numchild"); ObjectValue val; ObjectValueFlags flags = ObjectValueFlags.Variable; // There can be 'public' et al children for C++ structures if (typeName == null) typeName = "none"; Console.WriteLine (name + " : "+typeName); if (typeName.EndsWith ("]")) { val = ObjectValue.CreateArray (this, new ObjectPath (vname), typeName, nchild, flags, null); } else if (value == "{...}" || typeName.EndsWith ("*") || nchild > 0) { val = ObjectValue.CreateObject (this, new ObjectPath (vname), typeName, value, flags, null); } else { val = ObjectValue.CreatePrimitive (this, new ObjectPath (vname), typeName, new EvaluationResult (value), flags); } val.Name = name; return val; }
protected virtual StackFrame CreateFrame (ResultData frameData) { string lang = "Native"; string func = frameData.GetValueString ("func"); string sadr = frameData.GetValueString ("addr"); if (func == "??" && session.IsMonoProcess) { // Try to get the managed func name try { var data = session.RunCommand ("-data-evaluate-expression", "mono_pmip(" + sadr + ")"); string val = data.GetValueString ("value"); if (val != null) { int i = val.IndexOf ('"'); if (i != -1) { func = val.Substring (i).Trim ('"',' '); lang = "Mono"; } } } catch { } } int line = -1; string sline = frameData.GetValueString ("line"); if (sline != null) line = int.Parse (sline); string sfile = frameData.GetValueString ("fullname"); if (sfile == null) sfile = frameData.GetValueString ("file"); if (sfile == null) sfile = frameData.GetValueString ("from"); SourceLocation loc = new SourceLocation (func ?? "?", sfile, line); long addr; if (!string.IsNullOrEmpty (sadr)) addr = long.Parse (sadr.Substring (2), NumberStyles.HexNumber); else addr = 0; return new StackFrame (addr, loc, lang); }
protected override StackFrame CreateFrame(ResultData frameData) { string lang = "D"; string func = frameData.GetValueString("func"); string sadr = frameData.GetValueString("addr"); int line; int.TryParse(frameData.GetValueString("line"),out line); string sfile = frameData.GetValueString("fullname"); if (sfile == null) sfile = frameData.GetValueString("file"); if (sfile == null) sfile = frameData.GetValueString("from"); if (sfile != null) { var m = mixinInlineRegex.Match (sfile); if (m.Success) { sfile = sfile.Substring (0, m.Index); int.TryParse (m.Groups ["line"].Value, out line); } } // demangle D function/method name stored in func var typeDecl = Demangler.DemangleQualifier(func); if (typeDecl != null) func = typeDecl.ToString(); long addr = 0; if (!string.IsNullOrEmpty(sadr)) addr = long.Parse(sadr.Substring(2), System.Globalization.NumberStyles.HexNumber); return new StackFrame(addr, new SourceLocation(func ?? "<undefined>", sfile, line), lang); }