diff --git a/uppsrc/CtrlCore/CtrlCore.h b/uppsrc/CtrlCore/CtrlCore.h index 94740f14e..1de5833c9 100644 --- a/uppsrc/CtrlCore/CtrlCore.h +++ b/uppsrc/CtrlCore/CtrlCore.h @@ -1667,7 +1667,6 @@ void WriteClipboardHTML(const String& html); template T *Ctrl::GetAscendant() const { - T *main; for(Ctrl *p = GetParent(); p; p = p->GetParent()) if(T *a = dynamic_cast(p)) return a; diff --git a/uppsrc/ide/Debuggers/Pdb.h b/uppsrc/ide/Debuggers/Pdb.h index d0d2ec3af..4c6086010 100644 --- a/uppsrc/ide/Debuggers/Pdb.h +++ b/uppsrc/ide/Debuggers/Pdb.h @@ -469,7 +469,7 @@ struct Pdb : Debugger, ParentCtrl { void SetTree(const String& exp); void SetTreeA(ArrayCtrl *data); void PrettyTreeNode(int parent, Pdb::Val val, int64 from = 0); - void TreeNode(int parent, const String& name, Val val); + bool TreeNode(int parent, const String& name, Val val, int64 from = 0); void TreeExpand(int node); String StoreTree(int parent); void SaveTree(); diff --git a/uppsrc/ide/Debuggers/Tree.cpp b/uppsrc/ide/Debuggers/Tree.cpp index 097d53092..14069e6e1 100644 --- a/uppsrc/ide/Debuggers/Tree.cpp +++ b/uppsrc/ide/Debuggers/Tree.cpp @@ -65,22 +65,29 @@ void Pdb::PrettyTreeNode(int parent, Pdb::Val val, int64 from) catch(CParser::Error e) {} } -void Pdb::TreeNode(int parent, const String& name, Pdb::Val val) +bool Pdb::TreeNode(int parent, const String& name, Pdb::Val val, int64 from) { PrettyTreeNode(parent, val); NamedVal nv; nv.name = name; nv.val = val; + nv.from = from; Visual v; + bool r = true; try { - v.Cat(name + "=", SGray); - Visualise(v, val, 0); + v.Cat(name); + if(!from) { + v.Cat("=", SGray); + Visualise(v, val, 0); + } } catch(LengthLimit) {} catch(CParser::Error e) { v.Cat(e, SColorDisabled); + r = false; } tree.Add(parent, Null, RawToValue(nv), RawPickToValue(pick(v)), val.type >= 0 || val.ref > 0); + return r; } void Pdb::TreeExpand(int node) @@ -97,18 +104,28 @@ void Pdb::TreeExpand(int node) TreeNode(node, "value", val); return; } + if(nv.val.ref > 0) { + Val val0 = val; + val = DeRef(val); + if(val.type < 0 || val.ref > 0) { + int sz = SizeOfType(val.type); + val.address += sz * nv.from; + for(int i = 0; i < (nv.from ? 10000 : 20); i++) { + if(!TreeNode(node, String() << "[" << i + nv.from << "]" , val)) { + SaveTree(); + return; + } + val.address += sz; + } + TreeNode(node, "[more]", val0, nv.from ? nv.from + 10000 : 20); + return; + } + } + else if(nv.from > 0) { PrettyTreeNode(node, val, nv.from); return; } - if(nv.val.ref > 0) { - val = DeRef(val); - if(val.type < 0 || val.ref > 0) { - TreeNode(node, '*' + nv.name, val); - SaveTree(); - return; - } - } if(val.type < 0) { SaveTree(); return; @@ -263,7 +280,8 @@ void Pdb::SetTree(const String& exp) Visual v; try { - v.Cat(n + "=", SGray); + v.Cat(n, SBlack); + v.Cat("=", SGray); Visualise(v, nv.val, 0); } catch(LengthLimit) {}