public override bool HasChildren(DebugSymbolGroup LocalSymbolCache, DebugSymbolWrapper Symbol) { /* Note: HasChildren gets called first. To save searching time, * write our pre-results into the dictionary to return them when GetChildSymbols() is called. */ var ret=_childArray[Symbol.Symbol] = GetChildren(LocalSymbolCache,Symbol); return ret != null && ret.Length > 0; }
public override IEnumerable<DebugSymbolWrapper> GetChildSymbols(DebugSymbolGroup LocalSymbolCache, DebugSymbolWrapper Parent) { //return GetChildren(LocalSymbolCache,Parent); if (Parent == null) return GetChildren(LocalSymbolCache, Parent); if (_childArray.ContainsKey(Parent.Symbol)) return _childArray[Parent.Symbol]; return null; }
/// <summary> /// Retrieves child symbols of a debug symbol. /// Primarily used when showing local symbols when debugging. /// </summary> /// <param name="LocalSymbolCache"></param> /// <param name="Parent">Item whose children are requested. Will be null when root symbols are </param> /// <returns></returns> public virtual IEnumerable<DebugSymbolWrapper> GetChildSymbols(DebugSymbolGroup LocalSymbolCache, DebugSymbolWrapper Parent) { var ret = new List<DebugSymbolWrapper>(); if (Parent == null) { foreach (var s in LocalSymbolCache.Symbols) ret.Add(new DebugSymbolWrapper(s)); return ret; } foreach (var s in Parent.Symbol.Children) ret.Add(new DebugSymbolWrapper(s)); return ret; }
public DebugSymbolWrapper[] GetChildren(DebugSymbolGroup locals, DebugSymbolWrapper parent) { var ret = new List<DDebugSymbolWrapper>(); if (locals == null) return null; var scache=locals.Symbols; if (scache == null) return null; // If requesting root-leveled items, return all whose depth equals 0 if (parent == null) { foreach (var sym in scache) if (sym.Depth < 1) ret.Add(new DDebugSymbolWrapper(sym, this)); return ret.ToArray(); } // Find out index of parent item in locals int i = 0; for (; i < scache.Length; i++) if (scache[i].Offset == parent.Symbol.Offset) break; // If any items aren't there for searching, return empty list if (i >= scache.Length) return _childArray[parent.Symbol] = null; // Scan if following items are deeper-leveled for (int j = i + 1; j < scache.Length; j++) { var d=scache[j].Depth; if (d == parent.Symbol.Depth + 1) // Only add direct child items { //TODO: Scan for base classes ret.Add(new DDebugSymbolWrapper(scache[j], this)); } else if(d<=parent.Symbol.Depth) break; // If on the same level again or moved up a level, break } return ret.ToArray(); }
public virtual bool HasChildren(DebugSymbolGroup LocalSymbolCache, DebugSymbolWrapper Symbol) { return Symbol.Symbol.ChildrenCount > 0; }
public virtual bool HasChildren(DebugSymbolGroup LocalSymbolCache, DebugSymbolWrapper Symbol) { return(Symbol.Symbol.ChildrenCount > 0); }
/// <summary> /// Retrieves child symbols of a debug symbol. /// Primarily used when showing local symbols when debugging. /// </summary> /// <param name="LocalSymbolCache"></param> /// <param name="Parent">Item whose children are requested. Will be null when root symbols are </param> /// <returns></returns> public virtual IEnumerable <DebugSymbolWrapper> GetChildSymbols(DebugSymbolGroup LocalSymbolCache, DebugSymbolWrapper Parent) { var ret = new List <DebugSymbolWrapper>(); if (Parent == null) { foreach (var s in LocalSymbolCache.Symbols) { ret.Add(new DebugSymbolWrapper(s)); } return(ret); } foreach (var s in Parent.Symbol.Children) { ret.Add(new DebugSymbolWrapper(s)); } return(ret); }