# Visual Studio Solutions
-The repository has a number of Visual Studio Solutions files (`*.sln`) that are useful for editing parts of
-what are in the repository. In particular
+The repository has a number of Visual Studio Solutions files (`*.sln`) that are useful for editing parts of the repository. In particular
* `src\coreclr\src\System.Private.CoreLib\System.Private.CorLib.sln` - This solution is for all managed (C#) code that is defined
in the runtime itself. This is all class library support of one form or another.
#define VALIDATE_ROOT(isInterior, hCallBack, pObjRef)
-#define UINT32 UInt32
-#define INT32 Int32
-#define UINT16 UInt16
-#define UINT UInt32
-#define SIZE_T UIntNative
-#define SSIZE_T IntNative
+#define UINT32 uint32_t
+#define INT32 int32_t
+#define UINT16 uint16_t
+#define UINT uint32_t
+#define SIZE_T uintptr_t
+#define SSIZE_T intptr_t
#define LPVOID void*
typedef void * OBJECTREF;
try
{
PEReader peReader = OpenPEFile(filePath, out mappedViewAccessor);
- pdbReader = OpenAssociatedSymbolFile(filePath, peReader);
+ pdbReader = PortablePdbSymbolReader.TryOpenEmbedded(peReader, GetMetadataStringDecoder()) ?? OpenAssociatedSymbolFile(filePath, peReader);
EcmaModule module = EcmaModule.Create(this, peReader, containingAssembly: null, pdbReader);
return result;
}
- public static bool ContainsSignatureVariables(this TypeDesc thisType)
+ public static bool ContainsSignatureVariables(this TypeDesc thisType, bool treatGenericParameterLikeSignatureVariable = false)
{
switch (thisType.Category)
{
case TypeFlags.SzArray:
case TypeFlags.ByRef:
case TypeFlags.Pointer:
- return ((ParameterizedType)thisType).ParameterType.ContainsSignatureVariables();
+ return ((ParameterizedType)thisType).ParameterType.ContainsSignatureVariables(treatGenericParameterLikeSignatureVariable);
case TypeFlags.FunctionPointer:
MethodSignature pointerSignature = ((FunctionPointerType)thisType).Signature;
for (int i = 0; i < pointerSignature.Length; i++)
- if (pointerSignature[i].ContainsSignatureVariables())
+ if (pointerSignature[i].ContainsSignatureVariables(treatGenericParameterLikeSignatureVariable))
return true;
- return pointerSignature.ReturnType.ContainsSignatureVariables();
+ return pointerSignature.ReturnType.ContainsSignatureVariables(treatGenericParameterLikeSignatureVariable);
case TypeFlags.SignatureMethodVariable:
case TypeFlags.SignatureTypeVariable:
return true;
case TypeFlags.GenericParameter:
+ if (treatGenericParameterLikeSignatureVariable)
+ return true;
+ // It is generally a bug to have instantiations over generic parameters
+ // in the system. Typical instantiations are represented as instantiations
+ // over own formals - so these should be signature variables instead.
throw new ArgumentException();
default:
Debug.Assert(thisType is DefType);
foreach (TypeDesc arg in thisType.Instantiation)
{
- if (arg.ContainsSignatureVariables())
+ if (arg.ContainsSignatureVariables(treatGenericParameterLikeSignatureVariable))
return true;
}
using System.IO.MemoryMappedFiles;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
+using System.Reflection.PortableExecutable;
using Internal.IL;
return new PortablePdbSymbolReader(reader, mappedViewAccessor);
}
+ public static PdbSymbolReader TryOpenEmbedded(PEReader peReader, MetadataStringDecoder stringDecoder)
+ {
+ foreach (DebugDirectoryEntry debugEntry in peReader.ReadDebugDirectory())
+ {
+ if (debugEntry.Type != DebugDirectoryEntryType.EmbeddedPortablePdb)
+ continue;
+
+ MetadataReaderProvider embeddedReaderProvider = peReader.ReadEmbeddedPortablePdbDebugDirectoryData(debugEntry);
+ MetadataReader reader = embeddedReaderProvider.GetMetadataReader(MetadataReaderOptions.Default, stringDecoder);
+ return new PortablePdbSymbolReader(reader, mappedViewAccessor: null);
+ }
+
+ return null;
+ }
+
private MetadataReader _reader;
private MemoryMappedViewAccessor _mappedViewAccessor;
public override void Dispose()
{
- _mappedViewAccessor.Dispose();
+ if (_mappedViewAccessor != null)
+ _mappedViewAccessor.Dispose();
}
public override IEnumerable<ILSequencePoint> GetSequencePointsForMethod(int methodToken)
ImportConvert(WellKnownType.SByte, true, false);
break;
case ILOpcode.conv_ovf_u1:
- ImportConvert(WellKnownType.Byte, true, false);
+ ImportConvert(WellKnownType.Byte, true, true);
break;
case ILOpcode.conv_ovf_i2:
ImportConvert(WellKnownType.Int16, true, false);
break;
case ILOpcode.conv_ovf_u2:
- ImportConvert(WellKnownType.UInt16, true, false);
+ ImportConvert(WellKnownType.UInt16, true, true);
break;
case ILOpcode.conv_ovf_i4:
ImportConvert(WellKnownType.Int32, true, false);
break;
case ILOpcode.conv_ovf_u4:
- ImportConvert(WellKnownType.UInt32, true, false);
+ ImportConvert(WellKnownType.UInt32, true, true);
break;
case ILOpcode.conv_ovf_i8:
ImportConvert(WellKnownType.Int64, true, false);
break;
case ILOpcode.conv_ovf_u8:
- ImportConvert(WellKnownType.UInt64, true, false);
+ ImportConvert(WellKnownType.UInt64, true, true);
break;
case ILOpcode.refanyval:
ImportRefAnyVal(ReadILToken());
ImportLdToken(ReadILToken());
break;
case ILOpcode.conv_u2:
- ImportConvert(WellKnownType.UInt16, false, false);
+ ImportConvert(WellKnownType.UInt16, false, true);
break;
case ILOpcode.conv_u1:
- ImportConvert(WellKnownType.Byte, false, false);
+ ImportConvert(WellKnownType.Byte, false, true);
break;
case ILOpcode.conv_i:
ImportConvert(WellKnownType.IntPtr, false, false);
ImportConvert(WellKnownType.IntPtr, true, false);
break;
case ILOpcode.conv_ovf_u:
- ImportConvert(WellKnownType.UIntPtr, true, false);
+ ImportConvert(WellKnownType.UIntPtr, true, true);
break;
case ILOpcode.add_ovf:
case ILOpcode.add_ovf_un:
usage_list=()
usage_list+=("-skiprestorepackages: skip package restore.")
-usage_list+=("-skipstressdependencies: Don't install stress dependencies.")
usage_list+=("-skipgeneratelayout: Do not generate the Core_Root layout.")
usage_list+=("-skiptestwrappers: Don't generate test wrappers.")