summaryrefslogtreecommitdiff
path: root/src/debug/di/shimprocess.cpp
diff options
context:
space:
mode:
authorMike McLaughlin <mikem@microsoft.com>2015-12-02 16:47:27 -0800
committerMike McLaughlin <mikem@microsoft.com>2015-12-08 15:58:28 -0800
commit160de625e36f120af8454c7333e476176791380f (patch)
treea318b590168f9d69305c15ac9908ba1800bafc97 /src/debug/di/shimprocess.cpp
parentd1633211ee01ed05f467cacd36418f313e7a3d71 (diff)
downloadcoreclr-160de625e36f120af8454c7333e476176791380f.tar.gz
coreclr-160de625e36f120af8454c7333e476176791380f.tar.bz2
coreclr-160de625e36f120af8454c7333e476176791380f.zip
Use dbi's path to load dac and add RPATH to make files.
Fixes VS's problems with debugging and running different versions of coreclr. Set RPATH for OSX is @loader_path and removed now unnecessary load of mscordaccore in the lldb sos plugin. Simplify the GetDacModule code to use PAL_GetPALDirectoryW instead of depending on GetModuleInst() and the module handle passed to DllMain. Changed PAL_RegisterModule not to also call the DllMain of the module so it wouldn't be called twice.
Diffstat (limited to 'src/debug/di/shimprocess.cpp')
-rw-r--r--src/debug/di/shimprocess.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/debug/di/shimprocess.cpp b/src/debug/di/shimprocess.cpp
index ed315b6cad..4c13c3f3d2 100644
--- a/src/debug/di/shimprocess.cpp
+++ b/src/debug/di/shimprocess.cpp
@@ -1825,16 +1825,16 @@ HRESULT ShimProcess::FindLoadedCLR(CORDB_ADDRESS * pClrInstanceId)
HMODULE ShimProcess::GetDacModule()
{
-
HModuleHolder hDacDll;
+ WCHAR wszAccessDllPath[MAX_LONGPATH];
#ifdef FEATURE_PAL
- // For now on Unix we'll just search for DAC in the default location.
- // Debugger can always control it by setting LD_LIBRARY_PATH env var.
- WCHAR wszAccessDllPath[MAX_LONGPATH] = MAKEDLLNAME_W(W("mscordaccore"));
-
-#else
- WCHAR wszAccessDllPath[MAX_LONGPATH];
+ if (!PAL_GetPALDirectoryW(wszAccessDllPath, _countof(wszAccessDllPath)))
+ {
+ ThrowLastError();
+ }
+ wcscat_s(wszAccessDllPath, _countof(wszAccessDllPath), MAKEDLLNAME_W(W("mscordaccore")));
+#else
//
// Load the access DLL from the same directory as the the current CLR Debugging Services DLL.
//
@@ -1844,7 +1844,7 @@ HMODULE ShimProcess::GetDacModule()
ThrowLastError();
}
- PWSTR pPathTail = wcsrchr(wszAccessDllPath, '\\');
+ PWSTR pPathTail = wcsrchr(wszAccessDllPath, DIRECTORY_SEPARATOR_CHAR_W);
if (!pPathTail)
{
ThrowHR(E_INVALIDARG);
@@ -1855,7 +1855,7 @@ HMODULE ShimProcess::GetDacModule()
// mscordaccore.dll <-- coreclr
// mscordacwks.dll <-- desktop
PCWSTR eeFlavor =
-#ifdef FEATURE_MAIN_CLR_MODULE_USES_CORE_NAME
+#if defined(FEATURE_MAIN_CLR_MODULE_USES_CORE_NAME)
W("core");
#else
W("wks");
@@ -1869,7 +1869,7 @@ HMODULE ShimProcess::GetDacModule()
{
ThrowHR(E_INVALIDARG);
}
-#endif //!FEATURE_PAL
+#endif // FEATURE_PAL
hDacDll.Assign(WszLoadLibrary(wszAccessDllPath));
if (!hDacDll)