public DebugWriter() { Symbols = new DebugInfo(); scopes = new Stack <ScopeSym>(); funs = new Stack <FunSym>(); var glob = new ScopeSym(0, 0, 0, 0, 0) { EndOffset = int.MaxValue }; scopes.Push(glob); Symbols.Scopes.Add(glob); }
public static IEnumerable <VarSym> FindVarSyms(this DebugInfo syms, int offset, ScopeSym scope) { for (var i = 0; i < syms.Vars.Count; i++) { var v = syms.Vars[i]; if ((scope == null && v.Scope == 0 || v.Scope == scope.Index) && v.Offset <= offset) { yield return(v); } } }