Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 7621d45

Browse files
Mike McLaughlinPetermarcu
authored andcommitted
Fix source/line info on Windows for Windows PDBs. (#14696) (#15255)
Now attempts to load the diasymreader from the coreclr module path. Issue #21079
1 parent 872b9d9 commit 7621d45

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/vm/ceeload.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,27 +3893,31 @@ ISymUnmanagedReader *Module::GetISymUnmanagedReader(void)
38933893
// We've got in-memory ILDB symbols, create the ILDB symbol binder
38943894
// Note that in this case, we must be very careful not to use diasymreader.dll
38953895
// at all - we don't trust it, and shouldn't run any code in it
3896-
IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS,
3897-
IID_ISymUnmanagedBinder,
3898-
(void**)&pBinder));
3896+
IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS, IID_ISymUnmanagedBinder, (void**)&pBinder));
38993897
}
39003898
else
39013899
{
3902-
// We're going to be working with PDB format symbols
3903-
// Attempt to coCreate the symbol binder.
3904-
// CoreCLR supports not having a symbol reader installed, so this is expected there.
3900+
// We're going to be working with Windows PDB format symbols. Attempt to CoCreate the symbol binder.
3901+
// CoreCLR supports not having a symbol reader installed, so CoCreate searches the PATH env var
3902+
// and then tries coreclr dll location.
39053903
// On desktop, the framework installer is supposed to install diasymreader.dll as well
39063904
// and so this shouldn't happen.
3907-
hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS,
3908-
NATIVE_SYMBOL_READER_DLL,
3909-
IID_ISymUnmanagedBinder,
3910-
(void**)&pBinder,
3911-
NULL);
3905+
hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, NATIVE_SYMBOL_READER_DLL, IID_ISymUnmanagedBinder, (void**)&pBinder, NULL);
39123906
if (FAILED(hr))
39133907
{
3914-
RETURN (NULL);
3908+
PathString symbolReaderPath;
3909+
hr = GetHModuleDirectory(GetModuleInst(), symbolReaderPath);
3910+
if (FAILED(hr))
3911+
{
3912+
RETURN (NULL);
3913+
}
3914+
symbolReaderPath.Append(NATIVE_SYMBOL_READER_DLL);
3915+
hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, symbolReaderPath.GetUnicode(), IID_ISymUnmanagedBinder, (void**)&pBinder, NULL);
3916+
if (FAILED(hr))
3917+
{
3918+
RETURN (NULL);
3919+
}
39153920
}
3916-
39173921
}
39183922

39193923
LOG((LF_CORDB, LL_INFO10, "M::GISUR: Created binder\n"));

0 commit comments

Comments
 (0)