From 6a0d6031c67f64e6e8939b04ec7e714dfad8a5a8 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 19 Nov 2019 16:07:03 +0000 Subject: [PATCH] ide: DDUMPs git-svn-id: svn://ultimatepp.org/upp/trunk@13702 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Debuggers/Pdb.h | 1 + uppsrc/ide/Debuggers/Pretty.cpp | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/uppsrc/ide/Debuggers/Pdb.h b/uppsrc/ide/Debuggers/Pdb.h index 419e76334..ead7a1651 100644 --- a/uppsrc/ide/Debuggers/Pdb.h +++ b/uppsrc/ide/Debuggers/Pdb.h @@ -333,6 +333,7 @@ struct Pdb : Debugger, ParentCtrl { TypeInfo GetTypeInfo(const String& name) { return GetTypeInfo(current_modbase, name); } // only in Pretty... // exp + Val MakeVal(const String& type, adr_t address); void ThrowError(const char *s); int SizeOfType(int ti); int SizeOfType(const String& name); diff --git a/uppsrc/ide/Debuggers/Pretty.cpp b/uppsrc/ide/Debuggers/Pretty.cpp index 46685f30d..5aadc8024 100644 --- a/uppsrc/ide/Debuggers/Pretty.cpp +++ b/uppsrc/ide/Debuggers/Pretty.cpp @@ -72,13 +72,16 @@ void Pdb::PrettyArrayMap(Pdb::Val val, const Vector& tparam, int from, i void Pdb::PrettyValue(Pdb::Val val, const Vector& tparam, int from, int count, Pdb::Pretty& p) { - p.kind = SINGLE_VALUE; val = GetAttr(val, "data"); adr_t a = val.address; p.data_ptr << a; if(PeekWord(a + 12) && !PeekWord(a + 14)) { // this is not String int st = PeekByte(a + 13); - +// if(st == 9) { +// PrettyVector(MakeVal("Upp::Vector", PeekPtr(a)), { "Upp::Value" }, from, count, p); +// return; +// } + p.kind = SINGLE_VALUE; String t = decode(st, 1, "int", 2, "double", 4, "Upp::Date", 5, "Upp::Time", 10, "int64", 11, "bool", ""); if(t.GetCount()) @@ -88,6 +91,14 @@ void Pdb::PrettyValue(Pdb::Val val, const Vector& tparam, int from, int p.data_type << "Upp::String"; } +Pdb::Val Pdb::MakeVal(const String& type, adr_t address) +{ + Val item; + (TypeInfo &)item = GetTypeInfo(type); + item.address = address; + return item; +} + bool Pdb::PrettyData(Visual& result, Pdb::Val val, int expandptr, int slen) { const Type& t = GetType(val.type); @@ -167,7 +178,7 @@ bool Pdb::PrettyData(Visual& result, Pdb::Val val, int expandptr, int slen) pretty.Add("Upp::VectorMap", { 2, THISFN(PrettyVectorMap) }); pretty.Add("Upp::ArrayMap", { 2, THISFN(PrettyArrayMap) }); } -DDUMP(type); + int ii = pretty.Find(type); while(ii >= 0) { auto pr = pretty[ii]; @@ -197,12 +208,8 @@ DDUMP(type); else if(p.kind == SINGLE_VALUE) { pr.b(val, type_param, 0, 1, p); - if(p.data_type.GetCount() && p.data_ptr.GetCount()) { - Val item; - (TypeInfo &)item = GetTypeInfo(p.data_type[0]); - item.address = p.data_ptr[0]; - Visualise(result, item, expandptr - 1, slen); - } + if(p.data_type.GetCount() && p.data_ptr.GetCount()) + Visualise(result, MakeVal(p.data_type[0], p.data_ptr[0]), expandptr - 1, slen); else Visualise(result, val, expandptr - 1, slen, false); }