// dnlib: See LICENSE.txt for more info using System.Collections.Generic; using System.Diagnostics; using dnlib.DotNet.Emit; namespace dnlib.DotNet.Pdb { /// /// A PDB scope /// [DebuggerDisplay("{Start} - {End}")] public sealed class PdbScope : IHasCustomDebugInformation { readonly IList scopes = new List(); readonly IList locals = new List(); readonly IList namespaces = new List(); readonly IList constants = new List(); /// /// Constructor /// public PdbScope() { } /// /// Gets/sets the first instruction /// public Instruction Start { get; set; } /// /// Gets/sets the last instruction. It's null if it ends at the end of the method. /// public Instruction End { get; set; } /// /// Gets all child scopes /// public IList Scopes => scopes; /// /// true if is not empty /// public bool HasScopes => scopes.Count > 0; /// /// Gets all locals in this scope /// public IList Variables => locals; /// /// true if is not empty /// public bool HasVariables => locals.Count > 0; /// /// Gets all namespaces (Windows PDBs). Portable PDBs use /// public IList Namespaces => namespaces; /// /// true if is not empty /// public bool HasNamespaces => namespaces.Count > 0; /// /// Gets/sets the import scope (Portable PDBs). Windows PDBs use /// public PdbImportScope ImportScope { get; set; } /// /// Gets all constants /// public IList Constants => constants; /// /// true if is not empty /// public bool HasConstants => constants.Count > 0; /// public int HasCustomDebugInformationTag => 23; /// public bool HasCustomDebugInfos => CustomDebugInfos.Count > 0; /// /// Gets all custom debug infos /// public IList CustomDebugInfos => customDebugInfos; readonly IList customDebugInfos = new List(); } }