ObjectValue CreateObjectValue(string name, ResultData data) { string vname = data.GetValue("name"); string typeName = data.GetValue("type"); string value = data.GetValue("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"; } 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 override AssemblyLine[] OnDisassembleFile(string file) { List <AssemblyLine> lines = new List <AssemblyLine> (); int cline = 1; do { ResultData data = null; try { data = RunCommand("-data-disassemble", "-f", file, "-l", cline.ToString(), "--", "1"); } catch { break; } ResultData asm_insns = data.GetObject("asm_insns"); int newLine = cline; for (int n = 0; n < asm_insns.Count; n++) { ResultData src_and_asm_line = asm_insns.GetObject(n).GetObject("src_and_asm_line"); newLine = src_and_asm_line.GetInt("line"); ResultData line_asm_insn = src_and_asm_line.GetObject("line_asm_insn"); for (int i = 0; i < line_asm_insn.Count; i++) { ResultData asm = line_asm_insn.GetObject(i); long addr = long.Parse(asm.GetValue("address").Substring(2), NumberStyles.HexNumber); string code = asm.GetValue("inst"); lines.Add(new AssemblyLine(addr, code, newLine)); } } if (newLine <= cline) { break; } cline = newLine + 1; } while (true); return(lines.ToArray()); }
ObjectValue CreateObjectValue (string name, ResultData data) { string vname = data.GetValue ("name"); string typeName = data.GetValue ("type"); string value = data.GetValue ("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"; 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; }