Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/dbgshim/dbgshim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,9 +1173,12 @@ GetTargetCLRMetrics(
pClrInfo->DacSizeOfImage = pDebugResource->dwDacSizeOfImage;
return true;
});
if (!pedecoder.EnumerateWin32Resources(W("CLRDEBUGINFO"), MAKEINTRESOURCEW(10), callback, pClrInfoOut))
if (!pedecoder.EnumerateWin32Resources(CLRDEBUGINFO_RESOURCE_NAME, MAKEINTRESOURCEW(10), callback, pClrInfoOut) || !pClrInfoOut->IsValid())
{
return E_FAIL;
if (!pedecoder.EnumerateWin32Resources(W("CLRDEBUGINFO"), MAKEINTRESOURCEW(10), callback, pClrInfoOut) || !pClrInfoOut->IsValid())
{
return E_FAIL;
}
}
}
else
Expand Down
37 changes: 1 addition & 36 deletions src/dbgshim/debugshim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,43 +604,8 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget * pDataTarget,
BOOL useCrossPlatformNaming = FALSE;
if (SUCCEEDED(hr))
{
// the initial state is that we haven't found a proper resource
HRESULT hrGetResource = E_FAIL;

// First check for the resource which has type = RC_DATA = 10, name = "CLRDEBUGINFO<host_os><host_arch>", language = 0
#if defined (HOST_WINDOWS) && defined(HOST_X86)
const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSX86");
#endif

#if !defined (HOST_WINDOWS) && defined(HOST_X86)
const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSX86");
#endif

#if defined (HOST_WINDOWS) && defined(HOST_AMD64)
const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSAMD64");
#endif

#if !defined (HOST_WINDOWS) && defined(HOST_AMD64)
const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSAMD64");
#endif

#if defined (HOST_WINDOWS) && defined(HOST_ARM64)
const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSARM64");
#endif

#if !defined (HOST_WINDOWS) && defined(HOST_ARM64)
const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSARM64");
#endif

#if defined (HOST_WINDOWS) && defined(HOST_ARM)
const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSARM");
#endif

#if !defined (HOST_WINDOWS) && defined(HOST_ARM)
const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSARM");
#endif

hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, resourceName, 0, &debugResourceRVA, &debugResourceSize);
HRESULT hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, CLRDEBUGINFO_RESOURCE_NAME, 0, &debugResourceRVA, &debugResourceSize);
useCrossPlatformNaming = SUCCEEDED(hrGetResource);

#if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM) || defined(HOST_ARM64))
Expand Down
25 changes: 25 additions & 0 deletions src/dbgshim/debugshim.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@
#include <metahost.h>
#include "runtimeinfo.h"

#if defined (HOST_WINDOWS) && defined(HOST_X86)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOWINDOWSX86")
#endif
#if !defined (HOST_WINDOWS) && defined(HOST_X86)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOCORESYSX86")
#endif
#if defined (HOST_WINDOWS) && defined(HOST_AMD64)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOWINDOWSAMD64")
#endif
#if !defined (HOST_WINDOWS) && defined(HOST_AMD64)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOCORESYSAMD64")
#endif
#if defined (HOST_WINDOWS) && defined(HOST_ARM64)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOWINDOWSARM64")
#endif
#if !defined (HOST_WINDOWS) && defined(HOST_ARM64)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOCORESYSARM64")
#endif
#if defined (HOST_WINDOWS) && defined(HOST_ARM)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOWINDOWSARM")
#endif
#if !defined (HOST_WINDOWS) && defined(HOST_ARM)
#define CLRDEBUGINFO_RESOURCE_NAME W("CLRDEBUGINFOCORESYSARM")
#endif

#define CORECLR_DAC_MODULE_NAME_W W("mscordaccore")
#define CLR_DAC_MODULE_NAME_W W("mscordacwks")
#define MAIN_DBI_MODULE_NAME_W W("mscordbi")
Expand Down