summaryrefslogtreecommitdiff
path: root/src/zap
diff options
context:
space:
mode:
Diffstat (limited to 'src/zap')
-rw-r--r--src/zap/zapper.cpp42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp
index 0ad910865b..bcb1b0edca 100644
--- a/src/zap/zapper.cpp
+++ b/src/zap/zapper.cpp
@@ -240,7 +240,7 @@ STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembl
return hr;
}
-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)
{
HRESULT hr = S_OK;
@@ -255,6 +255,10 @@ STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPat
zap = Zapper::NewZapper(&ngo);
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ zap->SetDontLoadJit();
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+
if (pwzPlatformAssembliesPaths != nullptr)
zap->SetPlatformAssembliesPaths(pwzPlatformAssembliesPaths);
@@ -273,6 +277,11 @@ STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPat
if (pwzPlatformWinmdPaths != nullptr)
zap->SetPlatformWinmdPaths(pwzPlatformWinmdPaths);
+#if defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+ if (pwzDiasymreaderPath != nullptr)
+ zap->SetDiasymreaderPath(pwzDiasymreaderPath);
+#endif // defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+
// Avoid unnecessary security failures, since permissions are irrelevant when
// generating NGEN PDBs
zap->SetForceFullTrust(true);
@@ -676,6 +685,10 @@ void Zapper::Init(ZapperOptions *pOptions, bool fFreeZapperOptions)
_ASSERTE(SUCCEEDED(hr));
#endif
+#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ m_fDontLoadJit = false;
+#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+
m_fForceFullTrust = false;
}
@@ -707,6 +720,11 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi
extern HINSTANCE g_hThisInst;
#if defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+ if (m_fDontLoadJit)
+ {
+ return;
+ }
+
if (m_CLRJITPath.GetCount() > 0)
{
// If we have been asked to load a specific JIT binary, load it.
@@ -2215,7 +2233,15 @@ void Zapper::CreatePdbInCurrentDomain(BSTR pAssemblyPathOrName, BSTR pNativeImag
tkFile, &hModule));
}
- IfFailThrow(::CreatePdb(hAssembly, pNativeImagePath, pPdbPath, pdbLines, pManagedPdbSearchPath));
+ LPCWSTR pDiasymreaderPath = nullptr;
+#if defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+ if (m_DiasymreaderPath.GetCount() > 0)
+ {
+ pDiasymreaderPath = m_DiasymreaderPath.GetUnicode();
+ }
+#endif // defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+
+ IfFailThrow(::CreatePdb(hAssembly, pNativeImagePath, pPdbPath, pdbLines, pManagedPdbSearchPath, pDiasymreaderPath));
}
EX_CATCH
{
@@ -4037,8 +4063,20 @@ void Zapper::SetCLRJITPath(LPCWSTR pwszCLRJITPath)
{
m_CLRJITPath.Set(pwszCLRJITPath);
}
+
+void Zapper::SetDontLoadJit()
+{
+ m_fDontLoadJit = true;
+}
#endif // defined(FEATURE_CORECLR) && !defined(FEATURE_MERGE_JIT_AND_ENGINE)
+#if defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+void Zapper::SetDiasymreaderPath(LPCWSTR pwzDiasymreaderPath)
+{
+ m_DiasymreaderPath.Set(pwzDiasymreaderPath);
+}
+#endif // defined(FEATURE_CORECLR) && !defined(NO_NGENPDB)
+
#if defined(FEATURE_CORECLR) || defined(CROSSGEN_COMPILE)
void Zapper::SetPlatformAssembliesPaths(LPCWSTR pwzPlatformAssembliesPaths)