Skip to content

Commit b345825

Browse files
Update mirrored cDAC and universal DBI source (#6199)
Updates the managed cDAC reader, generator and linked sources together with the universal DBI and its private PAL from [dotnet/runtime@59e1f8f](dotnet/runtime@59e1f8f). Both snapshots use the same runtime commit so the DAC/DBI interface stays in sync. The mirrored source tracks the latest `dotnet/runtime` main commit resolved when this workflow runs. The imported paths come from runtime's `src/native/managed/cdac/SourceManifest.props` and `src/coreclr/dlls/mscordbi_universal/SourceManifest.props`. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent b89922e commit b345825

36 files changed

Lines changed: 46 additions & 907 deletions

‎src/cdac/runtime-source.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a71484cc27c95f9962080e7df9988ce2da0d18e2
1+
59e1f8f3a9501c931f6e0dbd41e8956506f3fd44

‎src/cdac/runtime/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/X86/X86Unwinder.cs‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class X86Unwinder(Target target)
1919
private const byte X86_INSTR_PUSH_EAX = 0x50; // push eax
2020
private const byte X86_INSTR_XOR = 0x33; // xor
2121
private const byte X86_INSTR_NOP = 0x90; // nop
22-
private const byte X86_INSTR_RETN = 0xC3; // ret
2322
private const byte X86_INSTR_PUSH_EBP = 0x55; // push ebp
2423
private const ushort X86_INSTR_W_MOV_EBP_ESP = 0xEC8B; // mov ebp, esp
2524
private const byte X86_INSTR_CALL_REL32 = 0xE8; // call rel32
@@ -35,7 +34,6 @@ public class X86Unwinder(Target target)
3534
private readonly Target _target = target;
3635
private readonly uint _pointerSize = (uint)target.PointerSize;
3736
private readonly bool _updateAllRegs = true;
38-
private readonly bool _unixX86ABI = target.Contracts.RuntimeInfo.GetTargetOperatingSystem() != RuntimeInfoOperatingSystem.Windows;
3937

4038
private static readonly RegMask[] registerOrder =
4139
[
@@ -60,7 +58,6 @@ public bool Unwind(ref X86Context context)
6058
eman.GetGCInfo(cbh, out TargetPointer gcInfoAddress, out uint gcInfoVersion);
6159
uint relOffset = (uint)eman.GetRelativeOffset(cbh).Value;
6260
TargetPointer methodStart = eman.GetStartAddress(cbh);
63-
TargetPointer funcletStart = eman.GetFuncletStartAddress(cbh);
6461
bool isFunclet = eman.IsFunclet(cbh);
6562

6663
X86GCInfo gcInfo = new(_target, gcInfoAddress, gcInfoVersion, relOffset);
@@ -83,7 +80,6 @@ public bool Unwind(ref X86Context context)
8380
ref context,
8481
gcInfo,
8582
methodStart,
86-
funcletStart,
8783
isFunclet))
8884
{
8985
return false;
@@ -429,7 +425,6 @@ private bool UnwindEbpDoubleAlignFrame(
429425
ref X86Context context,
430426
X86GCInfo gcInfo,
431427
TargetPointer methodStart,
432-
TargetPointer funcletStart,
433428
bool isFunclet)
434429
{
435430
Debug.Assert(gcInfo.Header.EbpFrame || gcInfo.Header.DoubleAlign);
@@ -448,19 +443,6 @@ private bool UnwindEbpDoubleAlignFrame(
448443
// Set baseSP as initial SP
449444
baseSP += gcInfo.PushedArgSize;
450445

451-
if (_unixX86ABI)
452-
{
453-
// 16-byte stack alignment padding (allocated in genFuncletProlog)
454-
// Current funclet frame layout (see CodeGen::genFuncletProlog() and genFuncletEpilog()):
455-
// prolog: sub esp, 12
456-
// epilog: add esp, 12
457-
// ret
458-
// SP alignment padding should be added for all instructions except the first one and the last one.
459-
// Epilog may not exist (unreachable), so we need to check the instruction code.
460-
if (funcletStart != methodStart + gcInfo.RelativeOffset && ReadByteAt(methodStart + gcInfo.RelativeOffset) != X86_INSTR_RETN)
461-
baseSP += 12;
462-
}
463-
464446
context.Eip = (uint)_target.ReadPointer(baseSP);
465447
context.Esp = (uint)baseSP + _pointerSize;
466448
return true;

‎src/cdac/runtime/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ReadyToRunInfo.cs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ internal sealed partial class ReadyToRunInfo : IData<ReadyToRunInfo>
1717
[Field] public partial TargetPointer? DelayLoadMethodCallThunks { get; }
1818
[Field] public partial TargetPointer DebugInfoSection { get; }
1919
[Field] public partial TargetPointer ExceptionInfoSection { get; }
20-
[Field] public partial TargetPointer LoadedImageBase { get; }
2120
[Field] public partial TargetPointer Composite { get; }
2221
[Field] public partial uint NumImportSections { get; }
2322

@@ -27,6 +26,7 @@ internal sealed partial class ReadyToRunInfo : IData<ReadyToRunInfo>
2726
[CustomInit(nameof(InitHotColdMap))] public partial TargetPointer HotColdMap { get; }
2827
[CustomInit(nameof(InitImportSections))] public partial TargetPointer ImportSections { get; }
2928
[CustomInit(nameof(InitEntryPointToMethodDescMap))] public partial TargetPointer EntryPointToMethodDescMap { get; }
29+
[CustomInit(nameof(InitLoadedImageBase))] public partial TargetPointer LoadedImageBase { get; }
3030

3131
[DataDescriptorDependency(nameof(NumRuntimeFunctions), "uint32")]
3232
[DataDescriptorDependency(nameof(RuntimeFunctions), "pointer")]
@@ -68,4 +68,14 @@ private partial TargetPointer InitEntryPointToMethodDescMap(Target target, Targe
6868
// Map is from the composite info pointer (set to itself for non-multi-assembly composite images)
6969
return CompositeInfo + (ulong)type.Fields[nameof(EntryPointToMethodDescMap)].Offset;
7070
}
71+
72+
[DataDescriptorDependency(nameof(CompositeInfo), "pointer")]
73+
[DataDescriptorDependency(nameof(LoadedImageBase), "pointer")]
74+
private partial TargetPointer InitLoadedImageBase(Target target, TargetPointer address)
75+
{
76+
// Component assemblies of a multi-assembly composite image do not record the image base;
77+
// read it from the composite info (set to itself for non-component images).
78+
Target.TypeInfo type = target.GetTypeInfo(DataType.ReadyToRunInfo);
79+
return target.ReadPointerField(CompositeInfo, type, nameof(LoadedImageBase));
80+
}
7181
}

‎src/dbi/runtime-source.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a71484cc27c95f9962080e7df9988ce2da0d18e2
1+
59e1f8f3a9501c931f6e0dbd41e8956506f3fd44

‎src/dbi/runtime/eng/native/tryrun.cmake‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ if(NOT DEFINED ANDROID_BUILD)
2929
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl OR
3030
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/s390x-alpine-linux-musl OR
3131
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/ppc64le-alpine-linux-musl OR
32-
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl OR
3332
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl OR
3433
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl)
3534

‎src/dbi/runtime/src/coreclr/clrdefinitions.cmake‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ if (CLR_CMAKE_TARGET_UNIX)
1212
elseif (CLR_CMAKE_TARGET_ARCH_ARM)
1313
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:UNIX_ARM_ABI>)
1414
add_compile_definitions(FEATURE_EMULATE_SINGLESTEP)
15-
elseif (CLR_CMAKE_TARGET_ARCH_I386)
16-
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:UNIX_X86_ABI>)
1715
elseif (CLR_CMAKE_TARGET_ARCH_LOONGARCH64)
1816
add_compile_definitions(FEATURE_EMULATE_SINGLESTEP)
1917
elseif (CLR_CMAKE_TARGET_ARCH_RISCV64)
@@ -58,10 +56,8 @@ if(CLR_CMAKE_HOST_WIN32)
5856
add_compile_definitions(NOMINMAX)
5957
endif(CLR_CMAKE_HOST_WIN32)
6058

61-
if (NOT (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX))
62-
set(FEATURE_METADATA_UPDATER 1)
63-
add_compile_definitions(FEATURE_METADATA_UPDATER)
64-
endif()
59+
set(FEATURE_METADATA_UPDATER 1)
60+
add_compile_definitions(FEATURE_METADATA_UPDATER)
6561

6662
if (FEATURE_TIERED_COMPILATION OR FEATURE_REJIT OR FEATURE_METADATA_UPDATER)
6763
add_compile_definitions(FEATURE_CODE_VERSIONING)
@@ -276,8 +272,6 @@ function(set_target_definitions_to_custom_os_and_arch)
276272
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_AMD64_ABI)
277273
elseif ((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel"))
278274
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_ARM_ABI)
279-
elseif (TARGETDETAILS_ARCH STREQUAL "x86")
280-
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_X86_ABI)
281275
elseif (TARGETDETAILS_ARCH STREQUAL "arm64")
282276
elseif (TARGETDETAILS_ARCH STREQUAL "loongarch64")
283277
endif()

‎src/dbi/runtime/src/coreclr/debug/di/shimremotedatatarget.cpp‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ ShimRemoteDataTarget::GetPlatform(
249249
CorDebugPlatform *pPlatform)
250250
{
251251
#ifdef HOST_UNIX
252-
#if defined(HOST_X86)
253-
*pPlatform = CORDB_PLATFORM_POSIX_X86;
254-
#elif defined(HOST_AMD64)
252+
#if defined(HOST_AMD64)
255253
*pPlatform = CORDB_PLATFORM_POSIX_AMD64;
256254
#elif defined(HOST_ARM)
257255
*pPlatform = CORDB_PLATFORM_POSIX_ARM;

‎src/dbi/runtime/src/coreclr/debug/inc/dbgipcevents.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ typedef enum
100100
//
101101
// Defines for current version numbers for the left and right sides
102102
//
103-
#define CorDB_LeftSideProtocolCurrent 2
104-
#define CorDB_LeftSideProtocolMinSupported 2
105-
#define CorDB_RightSideProtocolCurrent 2
106-
#define CorDB_RightSideProtocolMinSupported 2
103+
#define CorDB_LeftSideProtocolCurrent 3
104+
#define CorDB_LeftSideProtocolMinSupported 3
105+
#define CorDB_RightSideProtocolCurrent 3
106+
#define CorDB_RightSideProtocolMinSupported 3
107107

108108
//
109109
// The remaining data structures in this file can be shared between two processes and for network transport

‎src/dbi/runtime/src/coreclr/dlls/mscordbi_universal/SourceManifest.props‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/amd64/AsmMacros_Unix.inc" />
2626
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/arm/AsmMacros_Unix.inc" />
2727
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/arm64/AsmMacros_Unix.inc" />
28-
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/i386/AsmMacros_Unix.inc" />
2928
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/loongarch64/AsmMacros_Unix.inc" />
3029
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/riscv64/AsmMacros_Unix.inc" />
3130
<UniversalDbiSourceManifestSource Include="src/coreclr/runtime/unix/CLREventBase.cpp" />

‎src/dbi/runtime/src/coreclr/inc/corinfo.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,7 @@ enum class CorInfoCallConvExtension
697697
#ifdef TARGET_X86
698698
inline bool IsCallerPop(CorInfoCallConvExtension callConv)
699699
{
700-
#ifdef UNIX_X86_ABI
701-
return callConv == CorInfoCallConvExtension::Managed || callConv == CorInfoCallConvExtension::C || callConv == CorInfoCallConvExtension::CMemberFunction;
702-
#else
703700
return callConv == CorInfoCallConvExtension::C || callConv == CorInfoCallConvExtension::CMemberFunction;
704-
#endif // UNIX_X86_ABI
705701
}
706702
#endif
707703

0 commit comments

Comments
 (0)