/// <summary> /// Initializes a new instance of the <see cref="PdbSymbolField"/> class. /// </summary> /// <param name="parentType">The parent type.</param> /// <param name="record">Static data member type record.</param> public PdbSymbolField(PdbSymbol parentType, StaticDataMemberRecord record) : base(parentType) { Name = record.Name; LocationType = DIA.LocationType.Static; DataKind = DIA.DataKind.StaticMember; Type = parentType.PdbModule.GetSymbol(record.Type); Size = Type.Size; // Try native constant ConstantSymbol constant; string nativeConstant = $"{parentType.Name}::{Name}"; if (!parentType.PdbModule.Constants.TryGetValue(nativeConstant, out constant)) { // Try managed constant string managedConstant = $"{parentType.Name}.{Name}"; if (!parentType.PdbModule.Constants.TryGetValue(managedConstant, out constant)) { constant = null; } } if (constant != null && record.Type == constant.TypeIndex) { LocationType = DIA.LocationType.Constant; Value = constant.Value; } }
/// <summary> /// Initializes a new instance of the <see cref="PdbTypeRegularStaticField"/> class. /// </summary> /// <param name="containerType">Type that contains this field.</param> /// <param name="staticDataMemberRecord">The static data member record.</param> /// <param name="data">Data symbol for this static field.</param> internal PdbTypeRegularStaticField(PdbUserDefinedType containerType, StaticDataMemberRecord staticDataMemberRecord, DataSymbol data) : base(containerType, staticDataMemberRecord) { Data = data; }
/// <summary> /// Initializes a new instance of the <see cref="PdbTypeStaticField"/> class. /// </summary> /// <param name="containerType">Type that contains this field.</param> /// <param name="staticDataMemberRecord">The static data member record.</param> internal PdbTypeStaticField(PdbUserDefinedType containerType, StaticDataMemberRecord staticDataMemberRecord) { ContainerType = containerType; StaticDataMemberRecord = staticDataMemberRecord; }
/// <summary> /// Initializes a new instance of the <see cref="PdbTypeConstant"/> class. /// </summary> /// <param name="containerType">Type that contains this field.</param> /// <param name="staticDataMemberRecord">The static data member record.</param> /// <param name="constant">The constant symbol.</param> internal PdbTypeConstant(PdbUserDefinedType containerType, StaticDataMemberRecord staticDataMemberRecord, ConstantSymbol constant) : base(containerType, staticDataMemberRecord) { Constant = constant; }
/// <summary> /// Initializes a new instance of the <see cref="PdbTypeThreadLocalStorage"/> class. /// </summary> /// <param name="containerType">Type that contains this field.</param> /// <param name="staticDataMemberRecord">The static data member record.</param> /// <param name="threadLocalData">The thread local data.</param> internal PdbTypeThreadLocalStorage(PdbUserDefinedType containerType, StaticDataMemberRecord staticDataMemberRecord, ThreadLocalDataSymbol threadLocalData) : base(containerType, staticDataMemberRecord) { ThreadLocalData = threadLocalData; }