#ifndef __Debuggers__ #define __Debuggers__ #define DR_LOG(x) // RLOG(x) #include #include #define IMAGECLASS DbgImg #define IMAGEFILE #include #define LAYOUTFILE #include typedef uint64 adr_t; String CreateDebugTTY(); void KillDebugTTY(); bool TTYQuit(); String GdbCommand(bool console); int CharFilterReSlash(int c); class DbgDisas : public Ctrl { public: virtual void Paint(Draw& w); virtual void Layout(); virtual void LeftDown(Point p, dword); virtual void MouseWheel(Point, int zdelta, dword); virtual bool Key(dword key, int); virtual void GotFocus(); virtual void LostFocus(); private: Index addr; struct Inst : Moveable { String bytes; String code; String args; }; ScrollBar sb; Vector inst; Index taddr; int codecx; adr_t low, high; int cursor; int ip; Image ipimg; bool mode64; Font opfont; Size GetBox() const; void Scroll(); typedef DbgDisas CLASSNAME; public: Callback WhenCursor; Callback WhenFocus; void Clear(); void Add(adr_t adr, const String& code, const String& args, const String& bytes = Null); void AddT(adr_t tadr) { taddr.Add(tadr); } void WriteClipboard(); void Set(const String& s); bool InRange(adr_t adr) { return addr.Find(adr) >= 0; } void SetCursor(adr_t adr); adr_t GetCursor() const { return cursor >= 0 ? addr[cursor] : 0; } void SetIp(adr_t adr, const Image& img); void Mode64(bool b) { mode64 = b; } DbgDisas(); }; struct Dbg : Debugger, ParentCtrl { virtual void Stop(); virtual bool IsFinished(); One host; One dbg; FrameBottom > regs; Vector regname; Vector