public override AssemblyLine[] GetLines(long startAddr, long endAddr) { try { ResultData data = session.RunCommand("-data-disassemble", "-s", startAddr.ToString(), "-e", endAddr.ToString(), "--", "0"); ResultData ins = data.GetObject("asm_insns"); AssemblyLine[] alines = new AssemblyLine [ins.Count]; for (int n = 0; n < ins.Count; n++) { ResultData aline = ins.GetObject(n); long addr = long.Parse(aline.GetValue("address").Substring(2), NumberStyles.HexNumber); AssemblyLine line = new AssemblyLine(addr, aline.GetValue("inst")); alines [n] = line; } return(alines); } catch { return(new AssemblyLine [0]); } }
public StackFrame[] GetStackFrames(int firstIndex, int lastIndex) { List <StackFrame> frames = new List <StackFrame> (); if (firstIndex == 0 && firstFrame != null) { frames.Add(firstFrame); firstIndex++; } if (lastIndex >= fcount) { lastIndex = fcount - 1; } if (firstIndex > lastIndex) { return(frames.ToArray()); } session.SelectThread(threadId); GdbCommandResult res = session.RunCommand("-stack-list-frames", firstIndex.ToString(), lastIndex.ToString()); ResultData stack = res.GetObject("stack"); for (int n = 0; n < stack.Count; n++) { ResultData frd = stack.GetObject(n); frames.Add(CreateFrame(frd.GetObject("frame"))); } return(frames.ToArray()); }