diff --git a/uppsrc/ide/Debuggers/Pdb.h b/uppsrc/ide/Debuggers/Pdb.h index 2aaf0c1e2..f3f2d2289 100644 --- a/uppsrc/ide/Debuggers/Pdb.h +++ b/uppsrc/ide/Debuggers/Pdb.h @@ -384,7 +384,6 @@ struct Pdb : Debugger, ParentCtrl { Val At(Pdb::Val val, int i); Val At(Pdb::Val record, const char *id, int i); int IntAt(Pdb::Val record, const char *id, int i); - String IntFormat(int64 i, dword flags = 0); void CatInt(Visual& result, int64 val, dword flags = 0); enum { MEMBER = 1, RAW = 2 }; diff --git a/uppsrc/ide/Debuggers/Pretty.cpp b/uppsrc/ide/Debuggers/Pretty.cpp index 9dd72f4f2..467ede4e8 100644 --- a/uppsrc/ide/Debuggers/Pretty.cpp +++ b/uppsrc/ide/Debuggers/Pretty.cpp @@ -214,7 +214,11 @@ void Pdb::PrettyValue(Pdb::Val val, const Vector&, int64 from, int count static VectorMap single { { 20, "Upp::Complex" }, { 40, "Upp::Font" }, - { 48, "Upp::Painting" }, { 49, "Upp::Drawing" }, { 150, "Upp::Image" } + { 48, "Upp::Painting" }, { 49, "Upp::Drawing" }, { 150, "Upp::Image" }, + { POINT64_V, "Upp::Point_<__int64>" }, { POINTF_V, "Upp::Point_" }, + { SIZE64_V, "Upp::Size_<__int64>" }, { SIZEF_V, "Upp::Size_" }, + { RECT_V, "Upp::Rect_" }, + { RECT64_V, "Upp::Rect_<__int64>" }, { RECTF_V, "Upp::Rect_" }, }; String t = single.Get(st, Null); @@ -231,7 +235,8 @@ void Pdb::PrettyValue(Pdb::Val val, const Vector&, int64 from, int count } static VectorMap single { { 1, "int" }, { 2, "double" }, { 4, "Upp::Date" }, { 5, "Upp::Time" }, { 10, "int64" }, - { 11, "bool" }, {39, "Upp::Color" } + { 11, "bool" }, {39, "Upp::Color" }, + { POINT_V, "Upp::Point_" }, { SIZE_V, "Upp::Size_" } }; String t = single.Get(st, Null); if(t.GetCount()) diff --git a/uppsrc/ide/Debuggers/Sym.cpp b/uppsrc/ide/Debuggers/Sym.cpp index a9d5407ec..fcecbdfd0 100644 --- a/uppsrc/ide/Debuggers/Sym.cpp +++ b/uppsrc/ide/Debuggers/Sym.cpp @@ -186,7 +186,7 @@ BOOL CALLBACK Pdb::EnumLocals(PSYMBOL_INFO pSym, ULONG SymbolSize, PVOID UserCon if(pSym->Tag == SymTagFunction) return TRUE; - Val& v = (pSym->Flags & IMAGEHLP_SYMBOL_INFO_PARAMETER ? c.param : c.local).GetAdd(pSym->Name); + Val& v = (pSym->Flags & IMAGEHLP_SYMBOL_INFO_PARAMETER ? c.param : c.local).Add(pSym->Name); v.address = (adr_t)pSym->Address; if(pSym->Flags & IMAGEHLP_SYMBOL_INFO_REGISTER) v.address = pSym->Register; @@ -209,13 +209,14 @@ BOOL CALLBACK Pdb::EnumLocals(PSYMBOL_INFO pSym, ULONG SymbolSize, PVOID UserCon c.pdb->TypeVal(v, pSym->TypeIndex, (adr_t)pSym->ModBase); v.reported_size = pSym->Size; v.context = c.context; - LLOG("LOCAL " << pSym->Name << ": " << Format64Hex(v.address)); + DLOG("LOCAL " << pSym->Name << ": " << Format64Hex(v.address)); return TRUE; } void Pdb::GetLocals(Frame& frame, Context& context, VectorMap& param, VectorMap& local) { + DLOG("============ GetLocals"); static IMAGEHLP_STACK_FRAME f; f.InstructionOffset = frame.pc; SymSetContext(hProcess, &f, 0); @@ -226,6 +227,7 @@ void Pdb::GetLocals(Frame& frame, Context& context, VectorMap& SymEnumSymbols(hProcess, 0, 0, &EnumLocals, &c); param = pick(c.param); local = pick(c.local); + DLOG("..."); } BOOL CALLBACK Pdb::EnumGlobals(PSYMBOL_INFO pSym, ULONG SymbolSize, PVOID UserContext) diff --git a/uppsrc/ide/Debuggers/Visualise.cpp b/uppsrc/ide/Debuggers/Visualise.cpp index cdd74a324..e1389e7d2 100644 --- a/uppsrc/ide/Debuggers/Visualise.cpp +++ b/uppsrc/ide/Debuggers/Visualise.cpp @@ -84,23 +84,16 @@ int Pdb::IntAt(Pdb::Val record, const char *id, int i) return (int)GetInt(At(record, id, i)); } -String Pdb::IntFormat(int64 i, dword flags) -{ - String r; - if(i < 0) - r << '-' << Format64(-i); - else - r << Format64(i); - if(i >= 32 && i < 128) - r << " \'" << (char)i << '\''; - return r; -} - void Pdb::CatInt(Visual& result, int64 val, dword flags) { - result.Cat(IntFormat(val), SRed); + if(val < 0) + result.Cat("-" + Format64(-val), SRed); + else + result.Cat(Format64(val), SRed); if(flags & MEMBER) return; + if(val >= 32 && val < 128) + result.Cat(String() << " \'" << (char)val << '\'', SRed); result.Cat(" 0x" + Format64Hex(val), SMagenta); } @@ -212,9 +205,11 @@ void Pdb::Visualise(Visual& result, Pdb::Val val, dword flags) if(!(flags & RAW) && !raw) try { - if(VisualisePretty(result, val, flags) && (flags & MEMBER)) - return; - result.Cat(" "); + if(VisualisePretty(result, val, flags)) { + if(flags & MEMBER) + return; + result.Cat(", raw: ", SGray); + } } catch(CParser::Error e) {} // if failed, display as raw data