@@ -438,7 +438,7 @@ int ISOSDacInterface.GetMethodDescData(ClrDataAddress addr, ClrDataAddress ip, D
438438            NativeCodeVersionHandle ?  activeNativeCodeVersion  =  null ; 
439439            if  ( ip  !=  0 ) 
440440            { 
441-                 requestedNativeCodeVersion  =  nativeCodeContract . GetNativeCodeVersionForIP ( new   TargetCodePointer ( ip ) ) ; 
441+                 requestedNativeCodeVersion  =  nativeCodeContract . GetNativeCodeVersionForIP ( ip . ToTargetCodePointer ( _target ) ) ; 
442442            } 
443443            else 
444444            { 
@@ -457,7 +457,7 @@ int ISOSDacInterface.GetMethodDescData(ClrDataAddress addr, ClrDataAddress ip, D
457457            if  ( nativeCodeAddr  !=  TargetCodePointer . Null ) 
458458            { 
459459                data ->bHasNativeCode  =  1 ; 
460-                 data ->NativeCodeAddr  =  nativeCodeAddr . AsTargetPointer . ToClrDataAddress ( _target ) ; 
460+                 data ->NativeCodeAddr  =  nativeCodeAddr . ToAddress ( _target ) . ToClrDataAddress ( _target ) ; 
461461            } 
462462            else 
463463            { 
@@ -615,41 +615,41 @@ int ISOSDacInterface.GetMethodDescData(ClrDataAddress addr, ClrDataAddress ip, D
615615            Debug . Assert ( hrLocal  ==  hr ,  $ "cDAC: { hr : x} , DAC: { hrLocal : x} ") ; 
616616            if  ( hr  ==  HResults . S_OK ) 
617617            { 
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 } " ) ; 
629629                // managedDynamicMethodObject is not currently populated by the cDAC API and may differ from legacyImpl. 
630630                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 } " ) ; 
633633
634634                // 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 } " ) ; 
638638
639639                // 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 } " ) ; 
643643
644644                // rgRevertedRejitData 
645645                if  ( rgRevertedRejitData  !=  null  &&  rgRevertedRejitDataLocal  !=  null ) 
646646                { 
647-                     Debug . Assert ( cNeededRevertedRejitDataLocal  ==  * pcNeededRevertedRejitData ) ; 
647+                     Debug . Assert ( cNeededRevertedRejitDataLocal  ==  * pcNeededRevertedRejitData ,   $ "cDAC:  { * pcNeededRevertedRejitData } , DAC:  { cNeededRevertedRejitDataLocal } " ) ; 
648648                    for  ( ulong  i  =  0 ;  i  <  cNeededRevertedRejitDataLocal ;  i ++ ) 
649649                    { 
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 } " ) ; 
653653                    } 
654654                } 
655655            } 
@@ -803,7 +803,7 @@ int ISOSDacInterface.GetMethodDescPtrFromIP(ClrDataAddress ip, ClrDataAddress* p
803803            IExecutionManager  executionManager  =  _target . Contracts . ExecutionManager ; 
804804            IRuntimeTypeSystem  rts  =  _target . Contracts . RuntimeTypeSystem ; 
805805
806-             CodeBlockHandle ?  handle  =  executionManager . GetCodeBlockHandle ( new   TargetCodePointer ( ip ) ) ; 
806+             CodeBlockHandle ?  handle  =  executionManager . GetCodeBlockHandle ( ip . ToTargetCodePointer ( _target ) ) ; 
807807            if  ( handle  is  CodeBlockHandle  codeHandle ) 
808808            { 
809809                TargetPointer  methodDescAddr  =  executionManager . GetMethodDesc ( codeHandle ) ; 
@@ -814,7 +814,7 @@ int ISOSDacInterface.GetMethodDescPtrFromIP(ClrDataAddress ip, ClrDataAddress* p
814814                    // if validation fails, should return E_INVALIDARG 
815815                    rts . GetMethodDescHandle ( methodDescAddr ) ; 
816816
817-                     * ppMD  =  methodDescAddr . Value ; 
817+                     * ppMD  =  methodDescAddr . ToClrDataAddress ( _target ) ; 
818818                    hr  =  HResults . S_OK ; 
819819                } 
820820                catch  ( System . Exception ) 
@@ -963,7 +963,7 @@ int ISOSDacInterface.GetMethodTableName(ClrDataAddress mt, uint count, char* mtN
963963        try 
964964        { 
965965            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 ) ) ; 
967967            if  ( typeSystemContract . IsFreeObjectMethodTable ( methodTableHandle ) ) 
968968            { 
969969                OutputBufferHelpers . CopyStringToBuffer ( mtName ,  count ,  pNeeded ,  "Free" ) ; 
@@ -1511,21 +1511,21 @@ int ISOSDacInterface.GetThreadData(ClrDataAddress thread, DacpThreadData* data)
15111511            Debug . Assert ( hrLocal  ==  hr ,  $ "cDAC: { hr : x} , DAC: { hrLocal : x} ") ; 
15121512            if  ( hr  ==  HResults . S_OK ) 
15131513            { 
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 } " ) ; 
15291529            } 
15301530        } 
15311531#endif
0 commit comments