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

Commit

Permalink
Fix source/line info on Windows for Windows PDBs. (#14696) (#15255)
Browse files Browse the repository at this point in the history
Now attempts to load the diasymreader from the coreclr module path.

Issue #21079
  • Loading branch information
mikem8361 authored and Petermarcu committed Jan 3, 2018
1 parent 872b9d9 commit 7621d45
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/vm/ceeload.cpp
Expand Up @@ -3893,27 +3893,31 @@ ISymUnmanagedReader *Module::GetISymUnmanagedReader(void)
// We've got in-memory ILDB symbols, create the ILDB symbol binder
// Note that in this case, we must be very careful not to use diasymreader.dll
// at all - we don't trust it, and shouldn't run any code in it
IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS,
IID_ISymUnmanagedBinder,
(void**)&pBinder));
IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS, IID_ISymUnmanagedBinder, (void**)&pBinder));
}
else
{
// We're going to be working with PDB format symbols
// Attempt to coCreate the symbol binder.
// CoreCLR supports not having a symbol reader installed, so this is expected there.
// We're going to be working with Windows PDB format symbols. Attempt to CoCreate the symbol binder.
// CoreCLR supports not having a symbol reader installed, so CoCreate searches the PATH env var
// and then tries coreclr dll location.
// On desktop, the framework installer is supposed to install diasymreader.dll as well
// and so this shouldn't happen.
hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS,
NATIVE_SYMBOL_READER_DLL,
IID_ISymUnmanagedBinder,
(void**)&pBinder,
NULL);
hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, NATIVE_SYMBOL_READER_DLL, IID_ISymUnmanagedBinder, (void**)&pBinder, NULL);
if (FAILED(hr))
{
RETURN (NULL);
PathString symbolReaderPath;
hr = GetHModuleDirectory(GetModuleInst(), symbolReaderPath);
if (FAILED(hr))
{
RETURN (NULL);
}
symbolReaderPath.Append(NATIVE_SYMBOL_READER_DLL);
hr = FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS, symbolReaderPath.GetUnicode(), IID_ISymUnmanagedBinder, (void**)&pBinder, NULL);
if (FAILED(hr))
{
RETURN (NULL);
}
}

}

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

0 comments on commit 7621d45

Please sign in to comment.