#ifndef __Debuggers__ #define __Debuggers__ #include #include #define IMAGECLASS DbgImg #define IMAGEFILE #include #define LAYOUTFILE #include 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 code; String args; }; ScrollBar sb; Vector inst; Index taddr; int codecx; dword low, high; int cursor; int ip; Image ipimg; Size GetBox() const; void Scroll(); typedef DbgDisas CLASSNAME; public: Callback WhenCursor; Callback WhenFocus; void Clear(); void Add(dword adr, const String& code, const String& args); void AddT(dword tadr) { taddr.Add(tadr); } void WriteClipboard(); void Set(const String& s); bool InRange(dword adr) { return addr.Find(adr) >= 0; } void SetCursor(dword adr); dword GetCursor() const { return cursor >= 0 ? addr[cursor] : 0; } void SetIp(dword adr, const Image& img); DbgDisas(); }; struct Dbg : Debugger, Ctrl { virtual void Stop(); virtual bool IsFinished(); One host; One dbg; FrameBottom > regs; Vector regname; Vector