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
6 changes: 4 additions & 2 deletions src/dbgshim/debugshim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,15 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget * pDataTarget,
hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, resourceName, 0, &debugResourceRVA, &debugResourceSize);
useCrossPlatformNaming = SUCCEEDED(hrGetResource);

#if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM))
#if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM) || defined(HOST_ARM64))
#if defined(HOST_X86)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_I386
#elif defined(HOST_AMD64)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_AMD64
#elif defined(HOST_ARM)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_ARMNT
#elif defined(HOST_ARM64)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_ARM64
#endif

// if this is windows, and if host_arch matches target arch then we can fallback to searching for CLRDEBUGINFO on failure
Expand All @@ -661,7 +663,7 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget * pDataTarget,
#undef _HOST_MACHINE_TYPE
#endif
// if the search failed, we don't recognize the CLR
if(FAILED(hrGetResource))
if (FAILED(hrGetResource))
{
hr = CORDBG_E_NOT_CLR;
}
Expand Down
14 changes: 9 additions & 5 deletions src/dbgshim/pkg/Microsoft.Diagnostics.DbgShim.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
<!-- IncludeBuildOutput needs to be set to true to make NuGet include the passed in debug symbol files. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>true</IncludeSymbols>
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<IsPackable>true</IsPackable>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>.pdb;.dbg;.dwarf</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>$(SymbolsSuffix)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<!-- When KeepNativeSymbols is set, debug symbols are kept in the .so files. Separate symbol files do not exist that need to be packed. -->
<!-- <TargetsForTfmSpecificDebugSymbolsInPackage Condition="'$(KeepNativeSymbols)' != 'true'">$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificNativeSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage> -->
<TargetsForTfmSpecificDebugSymbolsInPackage Condition="'$(KeepNativeSymbols)' != 'true'">$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificNativeSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage>
<UseRuntimePackageDisclaimer>true</UseRuntimePackageDisclaimer>
<!-- This is a native package and doesn't contain any ref/lib assets. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
Expand All @@ -24,7 +22,13 @@

<Target Name="AddRuntimeSpecificNativeSymbolToPackage">
<ItemGroup>
<TfmSpecificDebugSymbolsFile Include="$(NativeBinDir)$(LibPrefix)dbgshim$(LibSuffix)$(SymbolsSuffix)"
<TfmSpecificDebugSymbolsFile Condition="$(OutputRid.StartsWith('win'))"
Include="$(NativeBinDir)PDB\$(LibPrefix)dbgshim$(SymbolsSuffix)"
TargetPath="/runtimes/$(OutputRid)/native"
TargetFramework="$(TargetFramework)" />

<TfmSpecificDebugSymbolsFile Condition="!$(OutputRid.StartsWith('win'))"
Include="$(NativeBinDir)$(LibPrefix)dbgshim$(LibSuffix)$(SymbolsSuffix)"
TargetPath="/runtimes/$(OutputRid)/native"
TargetFramework="$(TargetFramework)" />
</ItemGroup>
Expand Down
13 changes: 12 additions & 1 deletion src/shared/pal/inc/rt/ntimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
//

// This file is a verbatim copy of the Windows OS header with PE file structure definitions.


//
// ===========================================================================
// File: ntimage.h
Expand Down Expand Up @@ -222,7 +225,7 @@ typedef struct _IMAGE_FILE_HEADER {
#define IMAGE_FILE_MACHINE_SH4 0x01a6 // SH4 little-endian
#define IMAGE_FILE_MACHINE_SH5 0x01a8 // SH5
#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian
#define IMAGE_FILE_MACHINE_THUMB 0x01c2
#define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian
#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian
#define IMAGE_FILE_MACHINE_AM33 0x01d3
#define IMAGE_FILE_MACHINE_POWERPC 0x01F0 // IBM PowerPC Little-Endian
Expand All @@ -238,7 +241,9 @@ typedef struct _IMAGE_FILE_HEADER {
#define IMAGE_FILE_MACHINE_EBC 0x0EBC // EFI Byte Code
#define IMAGE_FILE_MACHINE_AMD64 0x8664 // AMD64 (K8)
#define IMAGE_FILE_MACHINE_M32R 0x9041 // M32R little-endian
#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian
#define IMAGE_FILE_MACHINE_CEE 0xC0EE
#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 // LOONGARCH64.

//
// Directory format.
Expand Down Expand Up @@ -1025,6 +1030,12 @@ typedef IMAGE_RELOCATION UNALIGNED *PIMAGE_RELOCATION;
#define IMAGE_REL_IA64_GPREL32 0x001C
#define IMAGE_REL_IA64_ADDEND 0x001F

//
// LOONGARCH64 relocation types
//
#define IMAGE_REL_LOONGARCH64_PC 0x0003
#define IMAGE_REL_LOONGARCH64_JIR 0x0004

//
// CEF relocation types.
//
Expand Down