displayName: Copy Windows x64 Artifacts
inputs:
sourceFolder: '$(Build.SourcesDirectory)/artifacts/bin/Windows_NT.x64.Release'
- contents: 'sos.dll'
+ contents: ?(sos.dll|Microsoft.DiaSymReader.Native.amd64.dll)
targetFolder: '$(Build.SourcesDirectory)/artifacts/Windows_NT.x64.Release'
condition: succeeded()
displayName: Copy Windows x86 Artifacts
inputs:
sourceFolder: '$(System.ArtifactsDirectory)/Windows_x86_Release'
- contents: 'sos.dll'
+ contents: ?(sos.dll|Microsoft.DiaSymReader.Native.x86.dll)
targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Windows_NT.x86.Release'
condition: succeeded()
displayName: Copy Windows Arm Artifacts
inputs:
sourceFolder: '$(System.ArtifactsDirectory)/Windows_arm_Release'
- contents: 'sos.dll'
+ contents: ?(sos.dll|Microsoft.DiaSymReader.Native.arm.dll)
targetFolder: '$(Build.SourcesDirectory)/artifacts/bin/Windows_NT.arm.Release'
condition: succeeded()
set "__ManagedBinaryDir=%__RootBinDir%\bin"
set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!"
- set __ExtraCmakeArgs="-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCMAKE_SYSTEM_VERSION=10.0"
+ set __ExtraCmakeArgs="-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DNUGET_PACKAGES=%NUGET_PACKAGES:\=/%"
pushd "%__CrossCompIntermediatesDir%"
call "%__ProjectDir%\eng\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!
set "__ManagedBinaryDir=%__RootBinDir%\bin"
set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!"
- set __ExtraCmakeArgs=!___SDKVersion! "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%"
+ set __ExtraCmakeArgs=!___SDKVersion! "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DNUGET_PACKAGES=%NUGET_PACKAGES:\=/%"
pushd "%__IntermediatesDir%"
call "%__ProjectDir%\eng\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!
<!-- Other libs -->
<MicrosoftSymbolStoreVersion>1.0.0-dev-64131-02</MicrosoftSymbolStoreVersion>
- <MicrosoftDiagnosticsRuntimeVersion>1.0.5</MicrosoftDiagnosticsRuntimeVersion>
-
+ <MicrosoftDiagnosticsRuntimeVersion>1.1.35504</MicrosoftDiagnosticsRuntimeVersion>
+ <MicrosoftDiaSymReaderNativePackageVersion>1.7.0</MicrosoftDiaSymReaderNativePackageVersion>
<MicrosoftDiagnosticsTracingTraceEventVersion>2.0.43</MicrosoftDiagnosticsTracingTraceEventVersion>
<SystemCommandLineExperimentalVersion>0.2.0-alpha.19254.1</SystemCommandLineExperimentalVersion>
<SystemCommandLineRenderingVersion>0.2.0-alpha.19254.1</SystemCommandLineRenderingVersion>
mkdir -Force "$ZipFilePath"
Copy-Item $BinDir\Windows_NT.x64.Release\sos.dll $GalleryDir\x64
+Copy-Item $BinDir\Windows_NT.x64.Release\Microsoft.DiaSymReader.Native.amd64.dll $GalleryDir\x64
Copy-Item $SOSNETCorePath\*.dll $GalleryDir\x64
Copy-Item $BinDir\Windows_NT.x86.Release\sos.dll $GalleryDir\x86
+Copy-Item $BinDir\Windows_NT.x86.Release\Microsoft.DiaSymReader.Native.x86.dll $GalleryDir\x86
Copy-Item $SOSNETCorePath\*.dll $GalleryDir\x86
Copy-Item $BinDir\Windows_NT.arm.Release\sos.dll $GalleryDir\arm32
+Copy-Item $BinDir\Windows_NT.arm.Release\Microsoft.DiaSymReader.Native.arm.dll $GalleryDir\arm32
Copy-Item $SOSNETCorePath\*.dll $GalleryDir\arm32
cat $SourceDirectory\eng\GalleryManifest.xml | %{$_ -replace "X.X.X.X","$SOSGalleryVersion"} | Set-Content $BinDir\gallery\GalleryManifest.xml
install(FILES ${MANAGED_BINDIR}/System.Reflection.Metadata.dll DESTINATION . )
install(FILES ${MANAGED_BINDIR}/System.Collections.Immutable.dll DESTINATION . )
endif()
+
+if(NOT ${NUGET_PACKAGES} STREQUAL "")
+ set(DIASYMREADER_ARCH ${CLR_CMAKE_TARGET_ARCH})
+
+ if(NOT(CLR_CMAKE_TARGET_ARCH STREQUAL CLR_CMAKE_HOST_ARCH))
+ set(DIASYMREADER_ARCH ${CLR_CMAKE_HOST_ARCH})
+ endif()
+
+ if (DIASYMREADER_ARCH STREQUAL x64)
+ set(DIASYMREADER_ARCH amd64)
+ endif()
+
+ install(FILES ${NUGET_PACKAGES}/microsoft.diasymreader.native/1.7.0/runtimes/win/native/Microsoft.DiaSymReader.Native.${DIASYMREADER_ARCH}.dll DESTINATION . )
+endif()
<ItemGroup>
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<PackageReference Include="Microsoft.SymbolStore" Version="$(MicrosoftSymbolStoreVersion)" />
+ <PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativePackageVersion)" Condition="'$(OS)' == 'Windows_NT'" />
</ItemGroup>
</Project>
LPCSTR g_dbiFilePath = nullptr;
LPCSTR g_tmpPath = nullptr;
SOSNetCoreCallbacks g_SOSNetCoreCallbacks;
+#ifndef FEATURE_PAL
+HMODULE g_hmoduleSymBinder = nullptr;
+ISymUnmanagedBinder3 *g_pSymBinder = nullptr;
+#endif
#ifdef FEATURE_PAL
#define TPALIST_SEPARATOR_STR_A ":"
if (GetModuleFileNameA(g_hInstance, szSOSModulePath, MAX_LONGPATH) == 0)
{
ExtErr("Error: Failed to get SOS module directory\n");
- return E_FAIL;
+ return HRESULT_FROM_WIN32(GetLastError());
}
sosModuleDirectory = szSOSModulePath;
return g_SOSNetCoreCallbacks.GetMetadataLocatorDelegate(imagePath, imageTimestamp, imageSize, mvid, mdRva, flags, bufferSize, buffer, dataSize);
}
+#ifndef FEATURE_PAL
+
+/**********************************************************************\
+* A typesafe version of GetProcAddress
+\**********************************************************************/
+template <typename T>
+BOOL GetProcAddressT(PCSTR FunctionName, PCSTR DllName, T* OutFunctionPointer, HMODULE* InOutDllHandle)
+{
+ _ASSERTE(InOutDllHandle != NULL);
+ _ASSERTE(OutFunctionPointer != NULL);
+
+ T FunctionPointer = NULL;
+ HMODULE DllHandle = *InOutDllHandle;
+ if (DllHandle == NULL)
+ {
+ DllHandle = LoadLibraryEx(DllName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (DllHandle != NULL)
+ *InOutDllHandle = DllHandle;
+ }
+ if (DllHandle != NULL)
+ {
+ FunctionPointer = (T) GetProcAddress(DllHandle, FunctionName);
+ }
+ *OutFunctionPointer = FunctionPointer;
+ return FunctionPointer != NULL;
+}
+
+/**********************************************************************\
+* CreateInstanceFromPath() instantiates a COM object using a passed in *
+* fully-qualified path and a CLSID. *
+\**********************************************************************/
+HRESULT CreateInstanceFromPath(REFCLSID clsid, REFIID iid, LPCSTR path, HMODULE* pModuleHandle, void** ppItf)
+{
+ HRESULT (__stdcall *pfnDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv) = NULL;
+ HRESULT hr = S_OK;
+
+ if (!GetProcAddressT("DllGetClassObject", path, &pfnDllGetClassObject, pModuleHandle)) {
+ return REGDB_E_CLASSNOTREG;
+ }
+ ToRelease<IClassFactory> pFactory;
+ if (SUCCEEDED(hr = pfnDllGetClassObject(clsid, IID_IClassFactory, (void**)&pFactory))) {
+ if (SUCCEEDED(hr = pFactory->CreateInstance(NULL, iid, ppItf))) {
+ return S_OK;
+ }
+ }
+ if (*pModuleHandle != NULL) {
+ FreeLibrary(*pModuleHandle);
+ *pModuleHandle = NULL;
+ }
+ return hr;
+}
+
+#endif // FEATURE_PAL
+
/**********************************************************************\
* Load symbols for an ICorDebugModule. Used by "clrstack -i".
\**********************************************************************/
#ifndef FEATURE_PAL
+static void CleanupSymBinder()
+{
+ if (g_pSymBinder != nullptr)
+ {
+ g_pSymBinder->Release();
+ g_pSymBinder = nullptr;
+ }
+ if (g_hmoduleSymBinder != nullptr)
+ {
+ FreeLibrary(g_hmoduleSymBinder);
+ g_hmoduleSymBinder = nullptr;
+ }
+}
+
/**********************************************************************\
* Attempts to load Windows PDBs on Windows.
\**********************************************************************/
if (m_pSymReader != NULL)
return S_OK;
- // Ignore errors to be able to run under a managed host (dotnet-dump).
- CoInitialize(NULL);
-
- // We now need a binder object that will take the module and return a
- ToRelease<ISymUnmanagedBinder3> pSymBinder;
- if (FAILED(Status = CreateInstanceCustom(CLSID_CorSymBinder_SxS,
- IID_ISymUnmanagedBinder3,
- NATIVE_SYMBOL_READER_DLL,
- cciDacColocated|cciDbgPath,
- (void**)&pSymBinder)))
+ if (g_pSymBinder == nullptr)
{
- ExtOut("SOS Error: Unable to CoCreateInstance class=CLSID_CorSymBinder_SxS, interface=IID_ISymUnmanagedBinder3, hr=0x%x\n", Status);
- ExtOut("This usually means SOS was unable to locate a suitable version of DiaSymReader. The dll searched for was '%S'\n", NATIVE_SYMBOL_READER_DLL);
- return Status;
- }
+ // Ignore errors to be able to run under a managed host (dotnet-dump).
+ CoInitialize(NULL);
+
+ std::string diasymreaderPath;
+ ArrayHolder<char> szSOSModulePath = new char[MAX_LONGPATH + 1];
+ if (GetModuleFileNameA(g_hInstance, szSOSModulePath, MAX_LONGPATH) == 0)
+ {
+ ExtErr("Error: Failed to get SOS module directory\n");
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+ diasymreaderPath = szSOSModulePath;
+
+ // Get just the sos module directory
+ size_t lastSlash = diasymreaderPath.rfind(DIRECTORY_SEPARATOR_CHAR_A);
+ if (lastSlash == std::string::npos)
+ {
+ ExtErr("Error: Failed to parse sos module name\n");
+ return E_FAIL;
+ }
+ diasymreaderPath.erase(lastSlash + 1);
+ diasymreaderPath.append(NATIVE_SYMBOL_READER_DLL);
+ // We now need a binder object that will take the module and return a
+ if (FAILED(Status = CreateInstanceFromPath(CLSID_CorSymBinder_SxS, IID_ISymUnmanagedBinder3, diasymreaderPath.c_str(), &g_hmoduleSymBinder, (void**)&g_pSymBinder)))
+ {
+ ExtOut("SOS error: Unable to find the diasymreader module/interface %08x at %s\n", Status, diasymreaderPath.c_str());
+ return Status;
+ }
+ OnUnloadTask::Register(CleanupSymBinder);
+ }
ToRelease<IDebugSymbols3> spSym3(NULL);
Status = g_ExtSymbols->QueryInterface(__uuidof(IDebugSymbols3), (void**)&spSym3);
if (FAILED(Status))
}
// TODO: this should be better integrated with windbg's symbol lookup
- Status = pSymBinder->GetReaderFromCallback(pMD, pModuleName, symbolPath,
+ Status = g_pSymBinder->GetReaderFromCallback(pMD, pModuleName, symbolPath,
AllowRegistryAccess | AllowSymbolServerAccess | AllowOriginalPathAccess | AllowReferencePathAccess, pCallback, &m_pSymReader);
if (FAILED(Status) && m_pSymReader != NULL)
#define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0)
#endif
-#ifndef IfFailGoto
-#define IfFailGoto(EXPR, label) do { Status = (EXPR); if(FAILED(Status)) { goto label; } } while (0)
-#endif // IfFailGoto
-
-#ifndef IfFailGo
-#define IfFailGo(EXPR) IfFailGoto(EXPR, Error)
-#endif // IfFailGo
-
// Max number of reverted rejit versions that !dumpmd and !ip2md will print
const UINT kcMaxRevertedRejitData = 10;
const UINT kcMaxTieredVersions = 10;
#ifndef FEATURE_PAL
-extern LPCSTR GetHostRuntimeDirectory();
-
// ensure we always allocate on the process heap
void* __cdecl operator new(size_t size) throw()
{ return HeapAlloc(GetProcessHeap(), 0, size); }
void __cdecl operator delete[](void* pObj) throw()
{ HeapFree(GetProcessHeap(), 0, pObj); }
-/**********************************************************************\
-* Here we define types and functions that support custom COM *
-* activation rules, as defined by the CIOptions enum. *
-* *
-\**********************************************************************/
-
-typedef unsigned __int64 QWORD;
-
-namespace com_activation
-{
- //
- // Forward declarations for the implementation methods
- //
-
- HRESULT CreateInstanceCustomImpl(
- REFCLSID clsid,
- REFIID iid,
- LPCWSTR dllName,
- CIOptions cciOptions,
- void** ppItf);
-
- HRESULT CreateInstanceFromPath(
- REFCLSID clsid,
- REFIID iid,
- LPCWSTR path,
- void** ppItf);
-
- BOOL GetPathFromModule(
- HMODULE hModule,
- __in_ecount(cFqPath) LPWSTR fqPath,
- DWORD cFqPath);
-
- void CleanupClsidHmodMap();
-
- // Helper structures for defining the CLSID -> HMODULE hash table we
- // use for caching already activated objects
- class hash_compareGUID
- {
- public:
- static const size_t bucket_size = 4;
- static const size_t min_buckets = 8;
- hash_compareGUID()
- { }
-
- size_t operator( )(const GUID& _Key) const
- {
- DWORD *pdw = (DWORD*)&_Key;
- return (size_t)(pdw[0] ^ pdw[1] ^ pdw[2] ^ pdw[3]);
- }
-
- bool operator( )(const GUID& _Key1, const GUID& _Key2) const
- { return memcmp(&_Key1, &_Key2, sizeof(GUID)) == -1; }
- };
-
- static std::unordered_map<GUID, HMODULE, hash_compareGUID> *g_pClsidHmodMap = NULL;
-
-
-
-/**********************************************************************\
-* Routine Description: *
-* *
-* CreateInstanceCustomImpl() provides a way to activate a COM object *
-* w/o triggering the FeatureOnDemand dialog. In order to do this we *
-* must avoid using the CoCreateInstance() API, which, on a machine *
-* with v4+ installed and w/o v2, would trigger this. *
-* CreateInstanceCustom() activates the requested COM object according *
-* to the specified passed in CIOptions, in the following order *
-* (skipping the steps not enabled in the CIOptions flags passed in): *
-* 1. Attempt to activate the COM object using a framework install: *
-* a. If the debugger machine has a V4+ shell shim use the shim *
-* to activate the object *
-* b. Otherwise simply call CoCreateInstance *
-* 2. If unsuccessful attempt to activate looking for the dllName in *
-* the same folder as the DAC was loaded from *
-* 3. If unsuccessful attempt to activate the COM object looking in *
-* every path specified in the debugger's .exepath and .sympath *
-\**********************************************************************/
-HRESULT CreateInstanceCustomImpl(
- REFCLSID clsid,
- REFIID iid,
- LPCWSTR dllName,
- CIOptions cciOptions,
- void** ppItf)
-{
- _ASSERTE(ppItf != NULL);
- _ASSERTE(dllName != NULL);
-
- if (ppItf == NULL || dllName == NULL)
- return E_POINTER;
-
- WCHAR wszClsid[64] = W("<CLSID>");
-
- // Step 1: attempt activation using the host runtime directory
- LPCSTR hostRuntimeDirectory = GetHostRuntimeDirectory();
- if (hostRuntimeDirectory != nullptr)
- {
- ArrayHolder<WCHAR> path = new WCHAR[MAX_LONGPATH];
- int length = MultiByteToWideChar(CP_ACP, 0, hostRuntimeDirectory, -1, path, MAX_LONGPATH);
- if (length > 0)
- {
- if (wcscat_s(path, MAX_LONGPATH, W("\\")) == 0 && wcscat_s(path, MAX_LONGPATH, dllName) == 0 &&
- SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
- {
- return S_OK;
- }
- }
- }
-
- // Step 2: attempt activation using the folder the DAC was loaded from
- if ((cciOptions & cciDacColocated) != 0)
- {
- HMODULE hDac = NULL;
- ArrayHolder<WCHAR> path = new WCHAR[MAX_LONGPATH];
-
- if (SUCCEEDED(g_sos->GetDacModuleHandle(&hDac)) &&
- GetPathFromModule(hDac, path, MAX_LONGPATH))
- {
- // build the fully qualified file name and attempt instantiation
- if (wcscat_s(path, MAX_LONGPATH, dllName) == 0 &&
- SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
- {
- return S_OK;
- }
- }
-
- ExtDbgOut("Failed to instantiate {%ls} from DAC location.\n", wszClsid);
- }
-
- // Step 3: attempt activation using the debugger's .exepath and .sympath
- if ((cciOptions & cciDbgPath) != 0)
- {
- ToRelease<IDebugSymbols3> spSym3(NULL);
- HRESULT hr = g_ExtSymbols->QueryInterface(__uuidof(IDebugSymbols3), (void**)&spSym3);
- if (FAILED(hr))
- {
- ExtDbgOut("Unable to query IDebugSymbol3 HRESULT=0x%x.\n", hr);
- goto ErrDbgPath;
- }
-
- typedef HRESULT (__stdcall IDebugSymbols3::*GetPathFunc)(LPWSTR , ULONG, ULONG*);
-
- {
- // Handle both the image path and the symbol path
- GetPathFunc rgGetPathFuncs[] =
- { &IDebugSymbols3::GetImagePathWide, &IDebugSymbols3::GetSymbolPathWide };
-
- for (int i = 0; i < _countof(rgGetPathFuncs); ++i)
- {
- ULONG pathSize = 0;
-
- // get the path buffer size
- if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(NULL, 0, &pathSize) != S_OK)
- {
- continue;
- }
-
- ArrayHolder<WCHAR> imgPath = new WCHAR[pathSize+MAX_LONGPATH+1];
-
- // actually get the path
- if ((spSym3.GetPtr()->*rgGetPathFuncs[i])(imgPath, pathSize, NULL) != S_OK)
- {
- continue;
- }
-
- LPWSTR ctx;
- LPCWSTR pathElem = wcstok_s(imgPath, W(";"), &ctx);
- while (pathElem != NULL)
- {
- ArrayHolder<WCHAR> path = new WCHAR[MAX_LONGPATH];
- wcscpy_s(path, MAX_LONGPATH, pathElem);
- if (wcscat_s(path, MAX_LONGPATH, W("\\")) == 0 && wcscat_s(path, MAX_LONGPATH, dllName) == 0)
- {
- if (SUCCEEDED(CreateInstanceFromPath(clsid, iid, path, ppItf)))
- {
- return S_OK;
- }
- }
-
- pathElem = wcstok_s(NULL, W(";"), &ctx);
- }
- }
- }
-
- ErrDbgPath:
- ExtDbgOut("Failed to instantiate {%ls} from debugger's image path.\n", wszClsid);
- }
-
- return REGDB_E_CLASSNOTREG;
-}
-
-
-/**********************************************************************\
-* Routine Description: *
-* *
-* CreateInstanceFromPath() instantiates a COM object using a passed in *
-* fully-qualified path and a CLSID. *
-* *
-* Note: *
-* *
-* It uses a unordered_map to cache the mapping between a CLSID and the *
-* HMODULE that is successfully used to activate the CLSID from. When *
-* SOS is unloaded (in DebugExtensionUninitialize()) we call *
-* FreeLibrary() for all cached HMODULEs. *
-\**********************************************************************/
-HRESULT CreateInstanceFromPath(
- REFCLSID clsid,
- REFIID iid,
- LPCWSTR path,
- void** ppItf)
-{
- HRESULT Status = S_OK;
- HRESULT (__stdcall *pfnDllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID *ppv) = NULL;
-
- HMODULE hmod = NULL;
-
- if (g_pClsidHmodMap == NULL)
- {
- g_pClsidHmodMap = new std::unordered_map<GUID, HMODULE, hash_compareGUID>();
- OnUnloadTask::Register(CleanupClsidHmodMap);
- }
-
- auto it = g_pClsidHmodMap->find(clsid);
- if (it != g_pClsidHmodMap->end())
- hmod = it->second;
-
- if (!GetProcAddressT("DllGetClassObject", path, &pfnDllGetClassObject, &hmod))
- return REGDB_E_CLASSNOTREG;
-
- ToRelease<IClassFactory> pFactory;
- IfFailGo(pfnDllGetClassObject(clsid, IID_IClassFactory, (void**)&pFactory));
-
- IfFailGo(pFactory->CreateInstance(NULL, iid, ppItf));
-
- // only cache the HMODULE if we successfully created the COM object
- (*g_pClsidHmodMap)[clsid] = hmod;
-
- return S_OK;
-
-Error:
- if (hmod != NULL)
- FreeLibrary(hmod);
-
- return Status;
-}
-
-
-/**********************************************************************\
-* Routine Description: *
-* *
-* CleanupClsidHmodMap() cleans up the CLSID -> HMODULE map used to *
-* cache successful activations from specific paths. This is registered *
-* as an OnUnloadTask in CreateInstanceFromPath(), and executes when *
-* SOS is unloaded, in DebugExtensionUninitialize(). *
-\**********************************************************************/
-void CleanupClsidHmodMap()
-{
- if (g_pClsidHmodMap != NULL)
- {
- for (auto it = g_pClsidHmodMap->begin(); it != g_pClsidHmodMap->end(); ++it)
- {
- _ASSERTE(it->second != NULL);
- FreeLibrary(it->second);
- }
-
- delete g_pClsidHmodMap;
- g_pClsidHmodMap = NULL;
- }
-}
-
-
-/**********************************************************************\
-* Routine Description: *
-* *
-* GetPathFromModule() returns the name of the folder containing the *
-* file associated with hModule. *
- \**********************************************************************/
-BOOL GetPathFromModule(
- HMODULE hModule,
- __in_ecount(cFqPath) LPWSTR fqPath,
- DWORD cFqPath)
-{
- int len = GetModuleFileNameW(hModule, fqPath, cFqPath);
- if (len == 0 || len == cFqPath)
- return FALSE;
-
- WCHAR *pLastSep = _wcsrchr(fqPath, DIRECTORY_SEPARATOR_CHAR_W);
- if (pLastSep == NULL || pLastSep+1 >= fqPath+cFqPath)
- return FALSE;
-
- *(pLastSep+1) = L'\0';
-
- return TRUE;
-}
-
-}
-
-/**********************************************************************\
-* Routine Description: *
-* *
-* CreateInstanceCustom() provides a way to activate a COM object w/o *
-* triggering the FeatureOnDemand dialog. In order to do this we *
-* must avoid using the CoCreateInstance() API, which, on a machine *
-* with v4+ installed and w/o v2, would trigger this. *
-* CreateInstanceCustom() activates the requested COM object according *
-* to the specified passed in CIOptions, in the following order *
-* (skipping the steps not enabled in the CIOptions flags passed in): *
-* 1. Attempt to activate the COM object using a framework install: *
-* a. If the debugger machine has a V4+ shell shim use the shim *
-* to activate the object *
-* b. Otherwise simply call CoCreateInstance *
-* 2. If unsuccessful attempt to activate looking for the dllName in *
-* the same folder as the DAC was loaded from *
-* 3. If unsuccessful attempt to activate the COM object looking in *
-* every path specified in the debugger's .exepath and .sympath *
-\**********************************************************************/
-HRESULT CreateInstanceCustom(
- REFCLSID clsid,
- REFIID iid,
- LPCWSTR dllName,
- CIOptions cciOptions,
- void** ppItf)
-{
- return com_activation::CreateInstanceCustomImpl(clsid, iid, dllName, cciOptions, ppItf);
-}
-
-
-
-
/**********************************************************************\
* Routine Description: *
* *
// The native symbol reader dll name
#if defined(_AMD64_)
-#define NATIVE_SYMBOL_READER_DLL W("Microsoft.DiaSymReader.Native.amd64.dll")
+#define NATIVE_SYMBOL_READER_DLL "Microsoft.DiaSymReader.Native.amd64.dll"
#elif defined(_X86_)
-#define NATIVE_SYMBOL_READER_DLL W("Microsoft.DiaSymReader.Native.x86.dll")
+#define NATIVE_SYMBOL_READER_DLL "Microsoft.DiaSymReader.Native.x86.dll"
#elif defined(_ARM_)
-#define NATIVE_SYMBOL_READER_DLL W("Microsoft.DiaSymReader.Native.arm.dll")
+#define NATIVE_SYMBOL_READER_DLL "Microsoft.DiaSymReader.Native.arm.dll"
#elif defined(_ARM64_)
// Use diasymreader until the package has an arm64 version - issue #7360
-//#define NATIVE_SYMBOL_READER_DLL W("Microsoft.DiaSymReader.Native.arm64.dll")
-#define NATIVE_SYMBOL_READER_DLL W("diasymreader.dll")
+//#define NATIVE_SYMBOL_READER_DLL "Microsoft.DiaSymReader.Native.arm64.dll"
+#define NATIVE_SYMBOL_READER_DLL "diasymreader.dll"
#endif
// PREFIX macros - Begin
UnderlyingType m_val;
};
-#ifndef FEATURE_PAL
-
-// Flags defining activation policy for COM objects
-enum CIOptionsBits
-{
- cciDacColocated = 0x01, // Look next to the already loaded DAC module
- cciDbgPath = 0x02, // Look in all folders in the debuggers symbols and binary path
-};
-
-typedef Flags<DWORD, CIOptionsBits> CIOptions;
-
-/**********************************************************************\
-* Routine Description: *
-* *
-* CreateInstanceCustom() provides a way to activate a COM object w/o *
-* triggering the FeatureOnDemand dialog. In order to do this we *
-* must avoid using the CoCreateInstance() API, which, on a machine *
-* with v4+ installed and w/o v2, would trigger this. *
-* CreateInstanceCustom() activates the requested COM object according *
-* to the specified passed in CIOptions, in the following order *
-* (skipping the steps not enabled in the CIOptions flags passed in): *
-* 1. Attempt to activate the COM object using a framework install: *
-* a. If the debugger machine has a V4+ shell shim use the shim *
-* to activate the object *
-* b. Otherwise simply call CoCreateInstance *
-* 2. If unsuccessful attempt to activate looking for the dllName in *
-* the same folder as the DAC was loaded from *
-* 3. If unsuccessful attempt to activate the COM object looking in *
-* every path specified in the debugger's .exepath and .sympath *
-\**********************************************************************/
-HRESULT CreateInstanceCustom(
- REFCLSID clsid,
- REFIID iid,
- LPCWSTR dllName,
- CIOptions cciOptions,
- void** ppItf);
-
-
-//------------------------------------------------------------------------
-// A typesafe version of GetProcAddress
-//------------------------------------------------------------------------
-template <typename T>
-BOOL
-GetProcAddressT(
- ___in PCSTR FunctionName,
- __in_opt PCWSTR DllName,
- __inout T* OutFunctionPointer,
- __inout HMODULE* InOutDllHandle
- )
-{
- _ASSERTE(InOutDllHandle != NULL);
- _ASSERTE(OutFunctionPointer != NULL);
-
- T FunctionPointer = NULL;
- HMODULE DllHandle = *InOutDllHandle;
- if (DllHandle == NULL)
- {
- DllHandle = LoadLibraryExW(DllName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (DllHandle != NULL)
- *InOutDllHandle = DllHandle;
- }
- if (DllHandle != NULL)
- {
- FunctionPointer = (T) GetProcAddress(DllHandle, FunctionName);
- }
- *OutFunctionPointer = FunctionPointer;
- return FunctionPointer != NULL;
-}
-
-
-#endif // FEATURE_PAL
-
struct ImageInfo
{
ULONG64 modBase;
if (module.BuildId != null) {
WriteLine(" BuildId: {0}", string.Concat(module.BuildId.Select((b) => b.ToString("x2"))));
}
- WriteLine(" IsRuntime: {0}", module.IsRuntime);
WriteLine(" IsManaged: {0}", module.IsManaged);
}
else
<None Include="$(ArtifactsBinDir)\Windows_NT.x64.$(Configuration)\sos.dll" Pack="true" Visible="false">
<PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
</None>
+ <None Include="$(ArtifactsBinDir)\Windows_NT.x64.$(Configuration)\Microsoft.DiaSymReader.Native.amd64.dll" Pack="true" Visible="false">
+ <PackagePath>tools/$(TargetFramework)/any/win-x64</PackagePath>
+ </None>
+
<None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
<PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
</None>
<None Include="$(ArtifactsBinDir)\Windows_NT.x86.$(Configuration)\sos.dll" Pack="true" Visible="false">
<PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
</None>
+ <None Include="$(ArtifactsBinDir)\Windows_NT.x86.$(Configuration)\Microsoft.DiaSymReader.Native.x86.dll" Pack="true" Visible="false">
+ <PackagePath>tools/$(TargetFramework)/any/win-x86</PackagePath>
+ </None>
+
<None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
<PackagePath>tools/$(TargetFramework)/any/win-arm</PackagePath>
</None>
<None Include="$(ArtifactsBinDir)\Windows_NT.arm.$(Configuration)\sos.dll" Pack="true" Visible="false">
<PackagePath>tools/$(TargetFramework)/any/win-arm</PackagePath>
</None>
+ <None Include="$(ArtifactsBinDir)\Windows_NT.arm.$(Configuration)\Microsoft.DiaSymReader.Native.arm.dll" Pack="true" Visible="false">
+ <PackagePath>tools/$(TargetFramework)/any/win-arm</PackagePath>
+ </None>
<None Include="$(SOSNETCoreBinaries)" Pack="true" Visible="false">
<PackagePath>tools/$(TargetFramework)/any/linux-x64</PackagePath>