public static void VerifyPdb( this Compilation compilation, string qualifiedMethodName, XElement expectedPdb, IEnumerable <EmbeddedText> embeddedTexts = null, IMethodSymbol debugEntryPoint = null, DebugInformationFormat format = 0, PdbValidationOptions options = PdbValidationOptions.Default, [CallerLineNumber] int expectedValueSourceLine = 0, [CallerFilePath] string expectedValueSourcePath = null ) { VerifyPdbImpl( compilation, embeddedTexts, debugEntryPoint, qualifiedMethodName, expectedPdb.ToString(), format, options, expectedValueSourceLine, expectedValueSourcePath, expectedIsXmlLiteral: true ); }
public static void VerifyPdb( this Compilation compilation, XElement expectedPdb, IEnumerable <EmbeddedText> embeddedTexts = null, IMethodSymbol debugEntryPoint = null, DebugInformationFormat format = 0, PdbValidationOptions options = PdbValidationOptions.Default, [CallerLineNumber] int expectedValueSourceLine = 0, [CallerFilePath] string expectedValueSourcePath = null) { VerifyPdb(compilation, "", expectedPdb, embeddedTexts, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath); }
public static PdbToXmlOptions ToPdbToXmlOptions(this PdbValidationOptions options) { const PdbValidationOptions mask = PdbValidationOptions.ExcludeDocuments | PdbValidationOptions.ExcludeMethods | PdbValidationOptions.ExcludeSequencePoints | PdbValidationOptions.ExcludeScopes | PdbValidationOptions.ExcludeNamespaces | PdbValidationOptions.ExcludeAsyncInfo | PdbValidationOptions.ExcludeCustomDebugInformation; return(PdbToXmlOptions.ResolveTokens | PdbToXmlOptions.ThrowOnError | PdbToXmlOptions.IncludeEmbeddedSources | (PdbToXmlOptions)(options & mask)); }
public static CompilationVerifier VerifyPdb( this CompilationVerifier verifier, string expectedPdb, IEnumerable <EmbeddedText> embeddedTexts = null, IMethodSymbol debugEntryPoint = null, DebugInformationFormat format = 0, PdbValidationOptions options = PdbValidationOptions.Default, [CallerLineNumber] int expectedValueSourceLine = 0, [CallerFilePath] string expectedValueSourcePath = null) { verifier.Compilation.VerifyPdb(expectedPdb, embeddedTexts, debugEntryPoint, format, options, expectedValueSourceLine, expectedValueSourcePath); return(verifier); }
internal static string GetPdbXml( Compilation compilation, IEnumerable <EmbeddedText> embeddedTexts = null, IMethodSymbol debugEntryPoint = null, PdbValidationOptions options = PdbValidationOptions.Default, string qualifiedMethodName = "", bool portable = false) { var peStream = new MemoryStream(); var pdbStream = new MemoryStream(); EmitWithPdb(peStream, pdbStream, compilation, debugEntryPoint, embeddedTexts, portable); pdbStream.Position = 0; peStream.Position = 0; return(PdbToXmlConverter.ToXml(pdbStream, peStream, options.ToPdbToXmlOptions(), methodName: qualifiedMethodName)); }
private static void VerifyPdbImpl( this Compilation compilation, IEnumerable <EmbeddedText> embeddedTexts, IMethodSymbol debugEntryPoint, string qualifiedMethodName, string expectedPdb, DebugInformationFormat format, PdbValidationOptions options, int expectedValueSourceLine, string expectedValueSourcePath, bool expectedIsXmlLiteral) { Assert.NotEqual(DebugInformationFormat.Embedded, format); bool testWindowsPdb = format == 0 || format == DebugInformationFormat.Pdb; bool testPortablePdb = format == 0 || format == DebugInformationFormat.PortablePdb; bool testConversion = (options & PdbValidationOptions.SkipConversionValidation) == 0; var pdbToXmlOptions = options.ToPdbToXmlOptions(); if (testWindowsPdb) { Verify(isPortable: false, testOtherFormat: testPortablePdb); } if (testPortablePdb) { Verify(isPortable: true, testOtherFormat: testWindowsPdb); } void Verify(bool isPortable, bool testOtherFormat) { var peStream = new MemoryStream(); var pdbStream = new MemoryStream(); EmitWithPdb(peStream, pdbStream, compilation, debugEntryPoint, embeddedTexts, isPortable); VerifyPdbMatchesExpectedXml(peStream, pdbStream, qualifiedMethodName, pdbToXmlOptions, expectedPdb, expectedValueSourceLine, expectedValueSourcePath, expectedIsXmlLiteral, isPortable); if (testConversion && testOtherFormat) { VerifyConvertedPdbMatchesExpectedXml(peStream, pdbStream, qualifiedMethodName, expectedPdb, pdbToXmlOptions, expectedIsXmlLiteral, isPortable); } } }