#include #include #include #include "cvconst.h" #include #define KEYGROUPNAME "Pdb debugger" #define KEYNAMESPACE PdbKeys #define KEYFILE #include using namespace PdbKeys; struct Pdb : Debugger, ParentCtrl { virtual void Stop(); virtual bool IsFinished(); virtual bool Key(dword key, int count); virtual void DebugBar(Bar& bar); virtual bool SetBreakpoint(const String& filename, int line, const String& bp); virtual bool RunTo(); virtual void Run(); virtual bool Tip(const String& exp, CodeEditor::MouseTip& mt); virtual void Serialize(Stream& s); struct ModuleInfo : Moveable { adr_t base; dword size; String path; bool symbols; ModuleInfo() { base = size = 0; symbols = false; } }; struct FilePos { String path; int line; adr_t address; operator bool() const { return !IsNull(path); } FilePos() {} FilePos(const String& p, int l) : path(p), line(l) {} }; struct MemPg : Moveable { char data[1024]; }; struct CdbHexView : HexView { Pdb *cdb; virtual int Byte(int64 addr) { return cdb->Byte((adr_t)addr); } CdbHexView() { SetTotal(0x80000000); } } memory; struct FnInfo { String name; adr_t address; dword size; dword pdbtype; FnInfo() { address = size = pdbtype = 0; } }; struct Val : Moveable { int type; int ref; bool array:1; bool rvalue:1; byte bitpos; byte bitcnt; union { adr_t address; int64 ival; double fval; }; Val() { rvalue = false; ref = 0; array = false; bitcnt = 0; address = 0; } }; struct NamedVal : Moveable { String name; Val val; }; enum { UNKNOWN = -99, BOOL1, SINT1, UINT1, SINT2, UINT2, SINT4, UINT4, SINT8, UINT8, FLT, DBL, PFUNC }; struct Type : Moveable { Type() : size(-1), vtbl_typeindex(-1) {} adr_t modbase; String name; int size; int vtbl_typeindex; int vtbl_offset; Vector base; VectorMap member; VectorMap static_member; }; struct Frame : Moveable { adr_t reip, rebp; FnInfo fn; VectorMap param; VectorMap local; }; struct VisualPart : Moveable { String text; Color ink; bool mark; }; struct Visual { int length; Vector part; void Cat(const String& text, Color ink = SColorText); void Cat(const char *text, Color ink = SColorText); String GetString() const; void Clear() { part.Clear(); length = 0; } Size GetSize() const; Visual() { length = 0; } }; struct VisualDisplay : Display { virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const; }; struct Thread { HANDLE hThread; adr_t sp; CONTEXT context; }; int lock; bool running; bool stop; HANDLE hProcess; DWORD processid; ArrayMap threads; bool terminated; bool refreshmodules; Vector module; DEBUG_EVENT event; HWND hWnd; VectorMap bp_set; CONTEXT context; Index invalidpage; VectorMap mempage; Index breakpoint; ArrayMap type; String disas_name; Array frame; String autotext; FrameBottom > regs; Vector regname; Vector