/// <summary> /// Initializes a new instance of the <see cref="VSClrAppDomain" /> class. /// </summary> /// <param name="runtime">The runtime.</param> /// <param name="id">The application domain identifier.</param> /// <param name="address">The application domain address.</param> /// <param name="applicationBase">The application domain base directory.</param> /// <param name="configurationFile">The configuration file used for application domain.</param> public VSClrAppDomain(VSClrRuntime runtime, int id, string name, ulong address, string applicationBase, string configurationFile) { VSRuntime = runtime; Id = id; Name = name; Address = address; ApplicationBase = applicationBase; ConfigurationFile = configurationFile; modulesCache = SimpleCache.Create(() => { ulong[] moduleAddresses = VSRuntime.Proxy.GetClrAppDomainModules(VSRuntime.Process.Id, VSRuntime.Id, Id); VSClrModule[] modules = new VSClrModule[moduleAddresses.Length]; for (int i = 0; i < modules.Length; i++) { modules[i] = VSRuntime.GetModule(moduleAddresses[i]); } return(modules); }); }
/// <summary> /// Initializes a new instance of the <see cref="VSClrType"/> class. /// </summary> /// <param name="runtime">The owning runtime.</param> /// <param name="id">The type identifier.</param> public VSClrType(VSClrRuntime runtime, int id) { Runtime = runtime; Id = id; moduleCache = SimpleCache.Create(() => Runtime.GetModule(Proxy.GetClrTypeModule(Runtime.Process.Id, id))); dataCache = SimpleCache.Create(() => { Tuple <int, int, int, int, int, int, string> tuple = Proxy.GetClrTypeSimpleData(Runtime.Process.Id, id); return(new SimpleData { BaseSize = tuple.Item1, BaseTypeId = tuple.Item2, ComponentTypeId = tuple.Item3, ElementSize = tuple.Item4, ElementType = tuple.Item5, HasSimpleValue = (tuple.Item6 & 1) != 0, IsArray = (tuple.Item6 & 2) != 0, IsEnum = (tuple.Item6 & 4) != 0, IsObjectReference = (tuple.Item6 & 8) != 0, IsPointer = (tuple.Item6 & 16) != 0, IsPrimitive = (tuple.Item6 & 32) != 0, IsString = (tuple.Item6 & 64) != 0, IsValueClass = (tuple.Item6 & 128) != 0, Name = tuple.Item7, }); }); fieldsCache = SimpleCache.Create(() => { Tuple <string, int, int, int>[] fieldTuples = Proxy.GetClrTypeFields(Runtime.Process.Id, id); VSClrInstanceField[] fields = new VSClrInstanceField[fieldTuples.Length]; for (int i = 0; i < fields.Length; i++) { fields[i] = new VSClrInstanceField(fieldTuples[i].Item1, Runtime.GetClrType(fieldTuples[i].Item2), fieldTuples[i].Item3, fieldTuples[i].Item4); } return(fields); }); }