@@ -438,7 +438,7 @@ int ISOSDacInterface.GetMethodDescData(ClrDataAddress addr, ClrDataAddress ip, D
438
438
NativeCodeVersionHandle ? activeNativeCodeVersion = null ;
439
439
if ( ip != 0 )
440
440
{
441
- requestedNativeCodeVersion = nativeCodeContract . GetNativeCodeVersionForIP ( new TargetCodePointer ( ip ) ) ;
441
+ requestedNativeCodeVersion = nativeCodeContract . GetNativeCodeVersionForIP ( ip . ToTargetCodePointer ( _target ) ) ;
442
442
}
443
443
else
444
444
{
@@ -457,7 +457,7 @@ int ISOSDacInterface.GetMethodDescData(ClrDataAddress addr, ClrDataAddress ip, D
457
457
if ( nativeCodeAddr != TargetCodePointer . Null )
458
458
{
459
459
data ->bHasNativeCode = 1 ;
460
- data ->NativeCodeAddr = nativeCodeAddr . AsTargetPointer . ToClrDataAddress ( _target ) ;
460
+ data ->NativeCodeAddr = nativeCodeAddr . ToAddress ( _target ) . ToClrDataAddress ( _target ) ;
461
461
}
462
462
else
463
463
{
@@ -615,41 +615,41 @@ int ISOSDacInterface.GetMethodDescData(ClrDataAddress addr, ClrDataAddress ip, D
615
615
Debug . Assert ( hrLocal == hr , $ "cDAC: { hr : x} , DAC: { hrLocal : x} ") ;
616
616
if ( hr == HResults . S_OK )
617
617
{
618
- Debug . Assert ( data ->bHasNativeCode == dataLocal . bHasNativeCode ) ;
619
- Debug . Assert ( data ->bIsDynamic == dataLocal . bIsDynamic ) ;
620
- Debug . Assert ( data ->wSlotNumber == dataLocal . wSlotNumber ) ;
621
- Debug . Assert ( data ->NativeCodeAddr == dataLocal . NativeCodeAddr ) ;
622
- Debug . Assert ( data ->AddressOfNativeCodeSlot == dataLocal . AddressOfNativeCodeSlot ) ;
623
- Debug . Assert ( data ->MethodDescPtr == dataLocal . MethodDescPtr ) ;
624
- Debug . Assert ( data ->MethodTablePtr == dataLocal . MethodTablePtr ) ;
625
- Debug . Assert ( data ->ModulePtr == dataLocal . ModulePtr ) ;
626
- Debug . Assert ( data ->MDToken == dataLocal . MDToken ) ;
627
- Debug . Assert ( data ->GCInfo == dataLocal . GCInfo ) ;
628
- Debug . Assert ( data ->GCStressCodeCopy == dataLocal . GCStressCodeCopy ) ;
618
+ Debug . Assert ( data ->bHasNativeCode == dataLocal . bHasNativeCode , $ "cDAC: { data -> bHasNativeCode } , DAC: { dataLocal . bHasNativeCode } " ) ;
619
+ Debug . Assert ( data ->bIsDynamic == dataLocal . bIsDynamic , $ "cDAC: { data -> bIsDynamic } , DAC: { dataLocal . bIsDynamic } " ) ;
620
+ Debug . Assert ( data ->wSlotNumber == dataLocal . wSlotNumber , $ "cDAC: { data -> wSlotNumber } , DAC: { dataLocal . wSlotNumber } " ) ;
621
+ Debug . Assert ( data ->NativeCodeAddr == dataLocal . NativeCodeAddr , $ "cDAC: { data -> NativeCodeAddr : x } , DAC: { dataLocal . NativeCodeAddr : x } " ) ;
622
+ Debug . Assert ( data ->AddressOfNativeCodeSlot == dataLocal . AddressOfNativeCodeSlot , $ "cDAC: { data -> AddressOfNativeCodeSlot : x } , DAC: { dataLocal . AddressOfNativeCodeSlot : x } " ) ;
623
+ Debug . Assert ( data ->MethodDescPtr == dataLocal . MethodDescPtr , $ "cDAC: { data -> MethodDescPtr : x } , DAC: { dataLocal . MethodDescPtr : x } " ) ;
624
+ Debug . Assert ( data ->MethodTablePtr == dataLocal . MethodTablePtr , $ "cDAC: { data -> MethodTablePtr : x } , DAC: { dataLocal . MethodTablePtr : x } " ) ;
625
+ Debug . Assert ( data ->ModulePtr == dataLocal . ModulePtr , $ "cDAC: { data -> ModulePtr : x } , DAC: { dataLocal . ModulePtr : x } " ) ;
626
+ Debug . Assert ( data ->MDToken == dataLocal . MDToken , $ "cDAC: { data -> MDToken : x } , DAC: { dataLocal . MDToken : x } " ) ;
627
+ Debug . Assert ( data ->GCInfo == dataLocal . GCInfo , $ "cDAC: { data -> GCInfo : x } , DAC: { dataLocal . GCInfo : x } " ) ;
628
+ Debug . Assert ( data ->GCStressCodeCopy == dataLocal . GCStressCodeCopy , $ "cDAC: { data -> GCStressCodeCopy : x } , DAC: { dataLocal . GCStressCodeCopy : x } " ) ;
629
629
// managedDynamicMethodObject is not currently populated by the cDAC API and may differ from legacyImpl.
630
630
Debug . Assert ( data ->managedDynamicMethodObject == 0 ) ;
631
- Debug . Assert ( data ->requestedIP == dataLocal . requestedIP ) ;
632
- Debug . Assert ( data ->cJittedRejitVersions == dataLocal . cJittedRejitVersions ) ;
631
+ Debug . Assert ( data ->requestedIP == dataLocal . requestedIP , $ "cDAC: { data -> requestedIP : x } , DAC: { dataLocal . requestedIP : x } " ) ;
632
+ Debug . Assert ( data ->cJittedRejitVersions == dataLocal . cJittedRejitVersions , $ "cDAC: { data -> cJittedRejitVersions } , DAC: { dataLocal . cJittedRejitVersions } " ) ;
633
633
634
634
// rejitDataCurrent
635
- Debug . Assert ( data ->rejitDataCurrent . rejitID == dataLocal . rejitDataCurrent . rejitID ) ;
636
- Debug . Assert ( data ->rejitDataCurrent . NativeCodeAddr == dataLocal . rejitDataCurrent . NativeCodeAddr ) ;
637
- Debug . Assert ( data ->rejitDataCurrent . flags == dataLocal . rejitDataCurrent . flags ) ;
635
+ Debug . Assert ( data ->rejitDataCurrent . rejitID == dataLocal . rejitDataCurrent . rejitID , $ "cDAC: { data -> rejitDataCurrent . rejitID } , DAC: { dataLocal . rejitDataCurrent . rejitID } " ) ;
636
+ Debug . Assert ( data ->rejitDataCurrent . NativeCodeAddr == dataLocal . rejitDataCurrent . NativeCodeAddr , $ "cDAC: { data -> rejitDataCurrent . NativeCodeAddr : x } , DAC: { dataLocal . rejitDataCurrent . NativeCodeAddr : x } " ) ;
637
+ Debug . Assert ( data ->rejitDataCurrent . flags == dataLocal . rejitDataCurrent . flags , $ "cDAC: { data -> rejitDataCurrent . flags } , DAC: { dataLocal . rejitDataCurrent . flags } " ) ;
638
638
639
639
// rejitDataRequested
640
- Debug . Assert ( data ->rejitDataRequested . rejitID == dataLocal . rejitDataRequested . rejitID ) ;
641
- Debug . Assert ( data ->rejitDataRequested . NativeCodeAddr == dataLocal . rejitDataRequested . NativeCodeAddr ) ;
642
- Debug . Assert ( data ->rejitDataRequested . flags == dataLocal . rejitDataRequested . flags ) ;
640
+ Debug . Assert ( data ->rejitDataRequested . rejitID == dataLocal . rejitDataRequested . rejitID , $ "cDAC: { data -> rejitDataRequested . rejitID } , DAC: { dataLocal . rejitDataRequested . rejitID } " ) ;
641
+ Debug . Assert ( data ->rejitDataRequested . NativeCodeAddr == dataLocal . rejitDataRequested . NativeCodeAddr , $ "cDAC: { data -> rejitDataRequested . NativeCodeAddr : x } , DAC: { dataLocal . rejitDataRequested . NativeCodeAddr : x } " ) ;
642
+ Debug . Assert ( data ->rejitDataRequested . flags == dataLocal . rejitDataRequested . flags , $ "cDAC: { data -> rejitDataRequested . flags } , DAC: { dataLocal . rejitDataRequested . flags } " ) ;
643
643
644
644
// rgRevertedRejitData
645
645
if ( rgRevertedRejitData != null && rgRevertedRejitDataLocal != null )
646
646
{
647
- Debug . Assert ( cNeededRevertedRejitDataLocal == * pcNeededRevertedRejitData ) ;
647
+ Debug . Assert ( cNeededRevertedRejitDataLocal == * pcNeededRevertedRejitData , $ "cDAC: { * pcNeededRevertedRejitData } , DAC: { cNeededRevertedRejitDataLocal } " ) ;
648
648
for ( ulong i = 0 ; i < cNeededRevertedRejitDataLocal ; i ++ )
649
649
{
650
- Debug . Assert ( rgRevertedRejitData [ i ] . rejitID == rgRevertedRejitDataLocal [ i ] . rejitID ) ;
651
- Debug . Assert ( rgRevertedRejitData [ i ] . NativeCodeAddr == rgRevertedRejitDataLocal [ i ] . NativeCodeAddr ) ;
652
- Debug . Assert ( rgRevertedRejitData [ i ] . flags == rgRevertedRejitDataLocal [ i ] . flags ) ;
650
+ Debug . Assert ( rgRevertedRejitData [ i ] . rejitID == rgRevertedRejitDataLocal [ i ] . rejitID , $ "cDAC: { rgRevertedRejitData [ i ] . rejitID } , DAC: { rgRevertedRejitDataLocal [ i ] . rejitID } " ) ;
651
+ Debug . Assert ( rgRevertedRejitData [ i ] . NativeCodeAddr == rgRevertedRejitDataLocal [ i ] . NativeCodeAddr , $ "cDAC: { rgRevertedRejitData [ i ] . NativeCodeAddr : x } , DAC: { rgRevertedRejitDataLocal [ i ] . NativeCodeAddr : x } " ) ;
652
+ Debug . Assert ( rgRevertedRejitData [ i ] . flags == rgRevertedRejitDataLocal [ i ] . flags , $ "cDAC: { rgRevertedRejitData [ i ] . flags } , DAC: { rgRevertedRejitDataLocal [ i ] . flags } " ) ;
653
653
}
654
654
}
655
655
}
@@ -803,7 +803,7 @@ int ISOSDacInterface.GetMethodDescPtrFromIP(ClrDataAddress ip, ClrDataAddress* p
803
803
IExecutionManager executionManager = _target . Contracts . ExecutionManager ;
804
804
IRuntimeTypeSystem rts = _target . Contracts . RuntimeTypeSystem ;
805
805
806
- CodeBlockHandle ? handle = executionManager . GetCodeBlockHandle ( new TargetCodePointer ( ip ) ) ;
806
+ CodeBlockHandle ? handle = executionManager . GetCodeBlockHandle ( ip . ToTargetCodePointer ( _target ) ) ;
807
807
if ( handle is CodeBlockHandle codeHandle )
808
808
{
809
809
TargetPointer methodDescAddr = executionManager . GetMethodDesc ( codeHandle ) ;
@@ -814,7 +814,7 @@ int ISOSDacInterface.GetMethodDescPtrFromIP(ClrDataAddress ip, ClrDataAddress* p
814
814
// if validation fails, should return E_INVALIDARG
815
815
rts . GetMethodDescHandle ( methodDescAddr ) ;
816
816
817
- * ppMD = methodDescAddr . Value ;
817
+ * ppMD = methodDescAddr . ToClrDataAddress ( _target ) ;
818
818
hr = HResults . S_OK ;
819
819
}
820
820
catch ( System . Exception )
@@ -963,7 +963,7 @@ int ISOSDacInterface.GetMethodTableName(ClrDataAddress mt, uint count, char* mtN
963
963
try
964
964
{
965
965
Contracts . IRuntimeTypeSystem typeSystemContract = _target . Contracts . RuntimeTypeSystem ;
966
- Contracts . TypeHandle methodTableHandle = typeSystemContract . GetTypeHandle ( mt . ToTargetPointer ( _target ) ) ;
966
+ Contracts . TypeHandle methodTableHandle = typeSystemContract . GetTypeHandle ( mt . ToTargetPointer ( _target , overrideCheck : true ) ) ;
967
967
if ( typeSystemContract . IsFreeObjectMethodTable ( methodTableHandle ) )
968
968
{
969
969
OutputBufferHelpers . CopyStringToBuffer ( mtName , count , pNeeded , "Free" ) ;
@@ -1511,21 +1511,21 @@ int ISOSDacInterface.GetThreadData(ClrDataAddress thread, DacpThreadData* data)
1511
1511
Debug . Assert ( hrLocal == hr , $ "cDAC: { hr : x} , DAC: { hrLocal : x} ") ;
1512
1512
if ( hr == HResults . S_OK )
1513
1513
{
1514
- Debug . Assert ( data ->corThreadId == dataLocal . corThreadId ) ;
1515
- Debug . Assert ( data ->osThreadId == dataLocal . osThreadId ) ;
1516
- Debug . Assert ( data ->state == dataLocal . state ) ;
1517
- Debug . Assert ( data ->preemptiveGCDisabled == dataLocal . preemptiveGCDisabled ) ;
1518
- Debug . Assert ( data ->allocContextPtr == dataLocal . allocContextPtr ) ;
1519
- Debug . Assert ( data ->allocContextLimit == dataLocal . allocContextLimit ) ;
1520
- Debug . Assert ( data ->fiberData == dataLocal . fiberData ) ;
1521
- Debug . Assert ( data ->context == dataLocal . context ) ;
1522
- Debug . Assert ( data ->domain == dataLocal . domain ) ;
1523
- Debug . Assert ( data ->lockCount == dataLocal . lockCount ) ;
1524
- Debug . Assert ( data ->pFrame == dataLocal . pFrame ) ;
1525
- Debug . Assert ( data ->firstNestedException == dataLocal . firstNestedException ) ;
1526
- Debug . Assert ( data ->teb == dataLocal . teb ) ;
1527
- Debug . Assert ( data ->lastThrownObjectHandle == dataLocal . lastThrownObjectHandle ) ;
1528
- Debug . Assert ( data ->nextThread == dataLocal . nextThread ) ;
1514
+ Debug . Assert ( data ->corThreadId == dataLocal . corThreadId , $ "cDAC: { data -> corThreadId } , DAC: { dataLocal . corThreadId } " ) ;
1515
+ Debug . Assert ( data ->osThreadId == dataLocal . osThreadId , $ "cDAC: { data -> osThreadId } , DAC: { dataLocal . osThreadId } " ) ;
1516
+ Debug . Assert ( data ->state == dataLocal . state , $ "cDAC: { data -> state } , DAC: { dataLocal . state } " ) ;
1517
+ Debug . Assert ( data ->preemptiveGCDisabled == dataLocal . preemptiveGCDisabled , $ "cDAC: { data -> preemptiveGCDisabled } , DAC: { dataLocal . preemptiveGCDisabled } " ) ;
1518
+ Debug . Assert ( data ->allocContextPtr == dataLocal . allocContextPtr , $ "cDAC: { data -> allocContextPtr : x } , DAC: { dataLocal . allocContextPtr : x } " ) ;
1519
+ Debug . Assert ( data ->allocContextLimit == dataLocal . allocContextLimit , $ "cDAC: { data -> allocContextLimit : x } , DAC: { dataLocal . allocContextLimit : x } " ) ;
1520
+ Debug . Assert ( data ->fiberData == dataLocal . fiberData , $ "cDAC: { data -> fiberData : x } , DAC: { dataLocal . fiberData : x } " ) ;
1521
+ Debug . Assert ( data ->context == dataLocal . context , $ "cDAC: { data -> context : x } , DAC: { dataLocal . context : x } " ) ;
1522
+ Debug . Assert ( data ->domain == dataLocal . domain , $ "cDAC: { data -> domain : x } , DAC: { dataLocal . domain : x } " ) ;
1523
+ Debug . Assert ( data ->lockCount == dataLocal . lockCount , $ "cDAC: { data -> lockCount } , DAC: { dataLocal . lockCount } " ) ;
1524
+ Debug . Assert ( data ->pFrame == dataLocal . pFrame , $ "cDAC: { data -> pFrame : x } , DAC: { dataLocal . pFrame : x } " ) ;
1525
+ Debug . Assert ( data ->firstNestedException == dataLocal . firstNestedException , $ "cDAC: { data -> firstNestedException : x } , DAC: { dataLocal . firstNestedException : x } " ) ;
1526
+ Debug . Assert ( data ->teb == dataLocal . teb , $ "cDAC: { data -> teb : x } , DAC: { dataLocal . teb : x } " ) ;
1527
+ Debug . Assert ( data ->lastThrownObjectHandle == dataLocal . lastThrownObjectHandle , $ "cDAC: { data -> lastThrownObjectHandle : x } , DAC: { dataLocal . lastThrownObjectHandle : x } " ) ;
1528
+ Debug . Assert ( data ->nextThread == dataLocal . nextThread , $ "cDAC: { data -> nextThread : x } , DAC: { dataLocal . nextThread : x } " ) ;
1529
1529
}
1530
1530
}
1531
1531
#endif
0 commit comments