ide: Pdb debugger cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@7594 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-08-19 21:12:04 +00:00
parent 70942acead
commit efdd51b714
4 changed files with 18 additions and 10 deletions

View file

@ -73,7 +73,9 @@ void Pdb::Sync()
for(int i = 0; i < reg.GetCount(); i++) {
const CpuRegister& r = reg[i];
if(r.name)
cpu.Add(String().Cat() << r.name << "|0x" << Hex(GetCpuRegister(ctx, r.sym)));
cpu.Add(String().Cat() << " " << r.name << "|"
<< Hex(GetCpuRegister(ctx, r.sym)) << "|"
<< int(i & 1));
}
SetFrame();
IdeActivateBottom();

View file

@ -172,16 +172,23 @@ void Pdb::SerializeSession(Stream& s)
struct CpuRegisterDisplay : Display {
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const
{
w.DrawRect(r, paper);
static int cx1 = GetTextSize("EFLAGS12", StdFont().Bold()).cx +
GetTextSize("0x0000000000000000", StdFont()).cx;
Font fnt = Courier(Ctrl::HorzLayoutZoom(12));
static int cx1 = GetTextSize("EFLAGS12", fnt().Bold()).cx +
GetTextSize("0000 0000 0000 0000", fnt).cx;
String name;
String value;
SplitTo((String)q, '|', name, value);
Size tsz = GetTextSize(value, StdFont());
String odd;
SplitTo((String)q, '|', name, value, odd);
w.DrawRect(r, odd != "1" || (style & CURSOR) ? paper : Blend(SColorMark, SColorPaper, 220));
int i = value.GetLength() - 4;
while(i > 0) {
value.Insert(i, ' ');
i -= 4;
}
Size tsz = GetTextSize(value, fnt);
int tt = r.top + max((r.Height() - tsz.cy) / 2, 0);
w.DrawText(r.left, tt, name, StdFont().Bold(), ink);
w.DrawText(r.left + cx1 - tsz.cx, tt, value, StdFont(), ink);
w.DrawText(r.left, tt, name, fnt().Bold(), ink);
w.DrawText(r.left + cx1 - tsz.cx, tt, value, fnt, ink);
}
};
@ -247,6 +254,7 @@ Pdb::Pdb()
tab.Add(memory.SizePos(), "Memory");
cpu.Columns(4);
cpu.ItemHeight(Courier(Ctrl::HorzLayoutZoom(12)).GetCy());
cpu.SetDisplay(Single<CpuRegisterDisplay>());
memory.cdb = this;

View file

@ -293,7 +293,6 @@ struct Pdb : Debugger, ParentCtrl {
dword GetSymInfo(adr_t modbase, dword typeindex, IMAGEHLP_SYMBOL_TYPE_INFO info);
const Type& GetType(int ti);
int GetTypeIndex(adr_t modbase, dword typeindex);
const Type& GetTypeId(adr_t modbase, dword typeindex) { return GetType(GetTypeIndex(modbase, typeindex)); }
Val GetGlobal(const String& name);
adr_t GetAddress(FilePos p);

View file

@ -131,7 +131,6 @@ void Pdb::TypeVal(Pdb::Val& v, int typeId, adr_t modbase)
tag = GetSymInfo(modbase, typeId, TI_GET_SYMTAG);
if(tag == SymTagPointerType) {
v.ref++;
const Type& tptr = GetTypeId(modbase, typeId); // What is this?
}
else
if(tag == SymTagArrayType)