diff options
author | John Chen (CLR) <jochen@microsoft.com> | 2016-08-05 16:08:18 -0700 |
---|---|---|
committer | John Chen (CLR) <jochen@microsoft.com> | 2016-08-08 13:36:34 -0700 |
commit | 21df26e038c4039150a7978188ecd0b6a5f23d2b (patch) | |
tree | 9ff37042706b455e937751b2d27aff2a9ae9eba6 /src/tools | |
parent | deb00ad58acf627763b6c0a7833fa789e3bb1cd0 (diff) | |
download | coreclr-21df26e038c4039150a7978188ecd0b6a5f23d2b.tar.gz coreclr-21df26e038c4039150a7978188ecd0b6a5f23d2b.tar.bz2 coreclr-21df26e038c4039150a7978188ecd0b6a5f23d2b.zip |
Modify "crossgen -createpdb" to skip loading clrjit.dll (#6607)
The -JITPath option doesn't work properly when CrossGen is used to
create a PDB file (issue #6607). Since clrjit.dll isn't really
needed for creating PDB files, the issue is fixed by modifying
CrossGen to skip loading clrjit.dll when -createpdb option is given.
Also following suggestion from issue #6607, added a new switch
-diasymreaderPath to CrossGen, to allow loading diasymreader.dll
from an alternative path.
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/crossgen/crossgen.cpp | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/src/tools/crossgen/crossgen.cpp b/src/tools/crossgen/crossgen.cpp index 8330660ceb..960bcf51cd 100644 --- a/src/tools/crossgen/crossgen.cpp +++ b/src/tools/crossgen/crossgen.cpp @@ -33,7 +33,7 @@ enum ReturnValues #define NumItems(s) (sizeof(s) / sizeof(s[0])) -STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzPlatformWinmdPaths); +STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzPlatformWinmdPaths, LPCWSTR pwzDiasymreaderPath); STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr); void SetSvcLogger(ICorSvcLogger *pCorSvcLogger); #ifdef FEATURE_CORECLR @@ -175,7 +175,11 @@ void PrintUsageHelper() W(" Debugging Parameters\n") W(" /CreatePDB <Dir to store PDB> [/lines [<search path for managed PDB>] ]\n") W(" When specifying /CreatePDB, the native image should be created\n") - W(" first, and <assembly name> should be the path to the NI.") + W(" first, and <assembly name> should be the path to the NI.\n") +#ifdef FEATURE_CORECLR + W(" /DiasymreaderPath <Path to diasymreader.dll>\n") + W(" - Specifies the absolute file path to diasymreader.dll to be used.\n") +#endif // FEATURE_CORECLR #elif defined(FEATURE_PERFMAP) W(" Debugging Parameters\n") W(" /CreatePerfMap <Dir to store perf map>\n") @@ -458,6 +462,8 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) LPCWSTR pwszCLRJITPath = nullptr; #endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE) + LPCWSTR pwzDiasymreaderPath = nullptr; + HRESULT hr; #ifndef PLATFORM_UNIX @@ -701,6 +707,16 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) argv--; argc++; } +#ifdef FEATURE_CORECLR + else if (MatchParameter(*argv, W("DiasymreaderPath")) && (argc > 1)) + { + pwzDiasymreaderPath = argv[1]; + + // skip diasymreader Path + argv++; + argc--; + } +#endif // FEATURE_CORECLR #endif // NO_NGENPDB #ifdef FEATURE_PERFMAP else if (MatchParameter(*argv, W("CreatePerfMap")) && (argc > 1)) @@ -799,6 +815,22 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) exit(FAILURE_RESULT); } +#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE) + if (pwszCLRJITPath != nullptr && fCreatePDB) + { + Output(W("The /JITPath switch can not be used with the /CreatePDB switch.\n")); + exit(FAILURE_RESULT); + } +#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE) + +#if defined(FEATURE_CORECLR) && !defined(NO_NGENPDB) + if (pwzDiasymreaderPath != nullptr && !fCreatePDB) + { + Output(W("The /DiasymreaderPath switch can only be used with the /CreatePDB switch.\n")); + exit(FAILURE_RESULT); + } +#endif // defined(FEATURE_CORECLR) && !defined(NO_NGENPDB) + #if defined(FEATURE_CORECLR) if ((pwzTrustedPlatformAssemblies != nullptr) && (pwzPlatformAssembliesPaths != nullptr)) { @@ -931,7 +963,8 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) wzDirectoryToStorePDB, fGeneratePDBLinesInfo, pwzSearchPathForManagedPDB, - pwzPlatformWinmdPaths); + pwzPlatformWinmdPaths, + pwzDiasymreaderPath); } else |