summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorRama krishnan Raghupathy <ramarag@microsoft.com>2016-02-19 19:31:15 -0800
committerRama krishnan Raghupathy <ramarag@microsoft.com>2016-02-19 19:31:15 -0800
commit7045ca7a6de381b382a709dc0a61f49ca713d160 (patch)
tree00de7384e22a0dbb6bfb8b7be03643a40f147596 /src/debug
parenta60523e59973b07f7240f3970a4fa41e14c9d6a6 (diff)
parentf98fb85e72d0f24c58d9e54b8b3bff2c67f985fb (diff)
downloadcoreclr-7045ca7a6de381b382a709dc0a61f49ca713d160.tar.gz
coreclr-7045ca7a6de381b382a709dc0a61f49ca713d160.tar.bz2
coreclr-7045ca7a6de381b382a709dc0a61f49ca713d160.zip
Merge pull request #2998 from ramarag/LongFileSupport
Initial Support for LongFile in the VM
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/di/cordb.cpp6
-rw-r--r--src/debug/di/module.cpp3
-rw-r--r--src/debug/di/shimprocess.cpp27
-rw-r--r--src/debug/ee/debugger.cpp16
4 files changed, 21 insertions, 31 deletions
diff --git a/src/debug/di/cordb.cpp b/src/debug/di/cordb.cpp
index 3a4fdff901..497225fd67 100644
--- a/src/debug/di/cordb.cpp
+++ b/src/debug/di/cordb.cpp
@@ -201,11 +201,11 @@ BOOL WINAPI DbgDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
#if defined(LOGGING)
{
- WCHAR rcFile[_MAX_PATH];
- WszGetModuleFileName(hInstance, rcFile, NumItems(rcFile));
+ PathString rcFile;
+ WszGetModuleFileName(hInstance, rcFile);
LOG((LF_CORDB, LL_INFO10000,
"DI::DbgDllMain: load right side support from file '%s'\n",
- rcFile));
+ rcFile.GetUnicode()));
}
#endif
diff --git a/src/debug/di/module.cpp b/src/debug/di/module.cpp
index 700a362c94..78c7599455 100644
--- a/src/debug/di/module.cpp
+++ b/src/debug/di/module.cpp
@@ -2568,8 +2568,9 @@ HRESULT CordbModule::CreateReaderForInMemorySymbols(REFIID riid, void** ppObj)
#ifndef FEATURE_PAL
// PDB format - use diasymreader.dll with COM activation
InlineSString<_MAX_PATH> ssBuf;
+ IfFailThrow(GetHModuleDirectory(GetModuleInst(), ssBuf));
IfFailThrow(FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS,
- GetHModuleDirectory(GetModuleInst(), ssBuf).GetUnicode(),
+ ssBuf.GetUnicode(),
IID_ISymUnmanagedBinder,
(void**)&pBinder,
NULL));
diff --git a/src/debug/di/shimprocess.cpp b/src/debug/di/shimprocess.cpp
index f15ab3fff6..a6fc15407e 100644
--- a/src/debug/di/shimprocess.cpp
+++ b/src/debug/di/shimprocess.cpp
@@ -1823,50 +1823,41 @@ HRESULT ShimProcess::FindLoadedCLR(CORDB_ADDRESS * pClrInstanceId)
HMODULE ShimProcess::GetDacModule()
{
HModuleHolder hDacDll;
- WCHAR wszAccessDllPath[MAX_LONGPATH];
+ PathString wszAccessDllPath;
#ifdef FEATURE_PAL
- if (!PAL_GetPALDirectoryW(wszAccessDllPath, _countof(wszAccessDllPath)))
+ if (!PAL_GetPALDirectoryWrapper(wszAccessDllPath))
{
ThrowLastError();
}
- wcscat_s(wszAccessDllPath, _countof(wszAccessDllPath), MAKEDLLNAME_W(W("mscordaccore")));
+ PCWSTR eeFlavor = MAKEDLLNAME_W(W("mscordaccore"));
#else
//
// Load the access DLL from the same directory as the the current CLR Debugging Services DLL.
//
- if (!WszGetModuleFileName(GetModuleInst(), wszAccessDllPath, NumItems(wszAccessDllPath)))
+ if (!WszGetModuleFileName(GetModuleInst(), wszAccessDllPath))
{
ThrowLastError();
}
- PWSTR pPathTail = wcsrchr(wszAccessDllPath, DIRECTORY_SEPARATOR_CHAR_W);
- if (!pPathTail)
+ if (!SUCCEEDED(CopySystemDirectory(wszAccessDllPath, wszAccessDllPath)))
{
ThrowHR(E_INVALIDARG);
}
- pPathTail++;
// Dac Dll is named:
// mscordaccore.dll <-- coreclr
// mscordacwks.dll <-- desktop
PCWSTR eeFlavor =
#if defined(FEATURE_MAIN_CLR_MODULE_USES_CORE_NAME)
- W("core");
+ W("mscordaccore.dll");
#else
- W("wks");
+ W("mscordacwks.dll");
#endif
-
- if (_snwprintf_s(pPathTail,
- _countof(wszAccessDllPath) + (wszAccessDllPath - pPathTail),
- NumItems(wszAccessDllPath) - (pPathTail - wszAccessDllPath),
- MAKEDLLNAME_W(W("mscordac%s")),
- eeFlavor) <= 0)
- {
- ThrowHR(E_INVALIDARG);
- }
+
#endif // FEATURE_PAL
+ wszAccessDllPath.Append(eeFlavor);
hDacDll.Assign(WszLoadLibrary(wszAccessDllPath));
if (!hDacDll)
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp
index 5905965c8b..c063eb829f 100644
--- a/src/debug/ee/debugger.cpp
+++ b/src/debug/ee/debugger.cpp
@@ -2244,9 +2244,9 @@ HRESULT Debugger::StartupPhase2(Thread * pThread)
if (!CORDebuggerAttached())
{
#define DBG_ATTACH_ON_STARTUP_ENV_VAR W("COMPlus_DbgAttachOnStartup")
-
+ PathString temp;
// We explicitly just check the env because we don't want a switch this invasive to be global.
- DWORD fAttach = WszGetEnvironmentVariable(DBG_ATTACH_ON_STARTUP_ENV_VAR, NULL, 0) > 0;
+ DWORD fAttach = WszGetEnvironmentVariable(DBG_ATTACH_ON_STARTUP_ENV_VAR, temp) > 0;
if (fAttach)
{
@@ -15166,8 +15166,7 @@ HRESULT Debugger::InitAppDomainIPC(void)
} hEnsureCleanup(this);
DWORD dwStrLen = 0;
- SString szExeNamePathString;
- WCHAR * szExeName = szExeNamePathString.OpenUnicodeBuffer(MAX_LONGPATH);
+ SString szExeName;
int i;
// all fields in the object can be zero initialized.
@@ -15216,15 +15215,14 @@ HRESULT Debugger::InitAppDomainIPC(void)
// also initialize the process name
dwStrLen = WszGetModuleFileName(NULL,
- szExeName,
- MAX_LONGPATH);
+ szExeName);
- szExeNamePathString.CloseBuffer(dwStrLen);
+
// If we couldn't get the name, then use a nice default.
if (dwStrLen == 0)
{
- wcscpy_s(szExeName, COUNTOF(szExeName), W("<NoProcessName>"));
- dwStrLen = (DWORD)wcslen(szExeName);
+ szExeName.Set(W("<NoProcessName>"));
+ dwStrLen = szExeName.GetCount();
}
// If we got the name, copy it into a buffer. dwStrLen is the