WIP
authorDavid Mason <davmason@microsoft.com>
Sat, 17 Aug 2019 09:57:37 +0000 (02:57 -0700)
committerDavid Mason <davmason@microsoft.com>
Sat, 17 Aug 2019 09:57:37 +0000 (02:57 -0700)
src/SOS/Strike/util.cpp
src/SOS/Strike/util.h

index 65f6e3d5379b10b78c206901a382f08a84b11228..476753302b3382f4b4d38e735ef3ea46883b7b1d 100644 (file)
@@ -2707,7 +2707,7 @@ const char *EHTypeName(EHClauseType et)
 
 void DumpTieredNativeCodeAddressInfo(struct DacpTieredVersionData * pTieredVersionData, const UINT cTieredVersionData)
 {
-    ExtOut("Code Version History:\n");
+    ExtOut("    Code Version History:\n");
 
     for(int i = cTieredVersionData - 1; i >= 0; --i)
     {
@@ -2735,8 +2735,8 @@ void DumpTieredNativeCodeAddressInfo(struct DacpTieredVersionData * pTieredVersi
             break;
         }
 
-        DMLOut("  CodeAddr:           %s  (%s)\n", DMLIP(pTieredVersionData[i].NativeCodeAddr), descriptor);
-        ExtOut("  NativeCodeVersion:  %p\n", SOS_PTR(pTieredVersionData[i].NativeCodeVersionNodePtr));
+        DMLOut("      CodeAddr:           %s  (%s)\n", DMLIP(pTieredVersionData[i].NativeCodeAddr), descriptor);
+        ExtOut("      NativeCodeVersion:  %p\n", SOS_PTR(pTieredVersionData[i].NativeCodeVersionNodePtr));
     }
 }
 
@@ -2772,22 +2772,11 @@ void DumpTieredNativeCodeAddressInfo_21(struct DacpTieredVersionData_21 * pTiere
 
 void DumpRejitData(CLRDATA_ADDRESS pMethodDesc, DacpReJitData * pReJitData)
 {
-    ExtOut("    ReJITID %p: ", SOS_PTR(pReJitData->rejitID));
+    ExtOut("  ReJITID %p: ", SOS_PTR(pReJitData->rejitID));
 
     struct DacpTieredVersionData codeAddrs[kcMaxTieredVersions];
     int cCodeAddrs;
 
-    ReleaseHolder<ISOSDacInterface5> sos5;
-    if (SUCCEEDED(g_sos->QueryInterface(__uuidof(ISOSDacInterface5), &sos5)) && 
-        SUCCEEDED(sos5->GetTieredVersions(pMethodDesc, 
-                                            (int)pReJitData->rejitID,
-                                            codeAddrs,
-                                            kcMaxTieredVersions,
-                                            &cCodeAddrs)))
-    {
-        DumpTieredNativeCodeAddressInfo(codeAddrs, cCodeAddrs);
-    }
-
     LPCSTR szFlags;
     switch (pReJitData->flags)
     {
@@ -2809,6 +2798,19 @@ void DumpRejitData(CLRDATA_ADDRESS pMethodDesc, DacpReJitData * pReJitData)
         break;
     }
     
+    ExtOut("%s\n", szFlags);
+
+    ReleaseHolder<ISOSDacInterface5> sos5;
+    if (SUCCEEDED(g_sos->QueryInterface(__uuidof(ISOSDacInterface5), &sos5)) && 
+        SUCCEEDED(sos5->GetTieredVersions(pMethodDesc, 
+                                            (int)pReJitData->rejitID,
+                                            codeAddrs,
+                                            kcMaxTieredVersions,
+                                            &cCodeAddrs)))
+    {
+        DumpTieredNativeCodeAddressInfo(codeAddrs, cCodeAddrs);
+    }
+
     struct DacpReJitData2 rejitData;
     ReleaseHolder<ISOSDacInterface7> sos7;
     if (SUCCEEDED(g_sos->QueryInterface(__uuidof(ISOSDacInterface7), &sos7)) && 
@@ -2816,11 +2818,10 @@ void DumpRejitData(CLRDATA_ADDRESS pMethodDesc, DacpReJitData * pReJitData)
                                             (int)pReJitData->rejitID,
                                             &rejitData)))
     {
-        DMLOut("  IL Addr:            %s\n", DMLIP(rejitData.il));
-        ExtOut("  NativeCodeVersion:  %p\n", SOS_PTR(rejitData.ilCodeVersionNodePtr));
+        ExtOut("    ReJIT Information:\n");
+        DMLOut("      IL Addr:            %s\n", DMLIL(rejitData.il));
+        ExtOut("      ILCodeVersion:      %p\n", SOS_PTR(rejitData.ilCodeVersionNodePtr));
     }
-
-    ExtOut("%s\n", szFlags);
 }
 
 // For !ip2md requests, this function helps us ensure that rejitted version corresponding
@@ -4988,6 +4989,7 @@ const char * const DMLFormats[] =
     "<exec cmd=\"!DumpCCW /d %s\">%s</exec>",       // DML_CCWrapper
     "<exec cmd=\"!ClrStack -i %S %d\">%S</exec>",   // DML_ManagedVar
     "<exec cmd=\"!DumpAsync -addr %s -tasks -completed -fields -stacks -roots\">%s</exec>", // DML_Async
+    "<exec cmd=\"!DumpIL /i %s\">%s</exec>",         // DML_IL
 };
 
 void ConvertToLower(__out_ecount(len) char *buffer, size_t len)
index 07a93056161b0dd56ce97bade0792207db7d2f2c..80797f559ce2c28958096d1a8d17bdb2c248ce89 100644 (file)
@@ -362,6 +362,7 @@ namespace Output
         DML_CCWrapper,
         DML_ManagedVar,
         DML_Async,
+        DML_IL,
     };
 
     /**********************************************************************\
@@ -466,6 +467,7 @@ inline void ExtOutIndent()  { WhitespaceOut(Output::g_Indent << 2); }
 #define DMLCCWrapper(addr) Output::BuildHexValue(addr, Output::DML_CCWrapper).GetPtr()
 #define DMLManagedVar(expansionName,frame,simpleName) Output::BuildManagedVarValue(expansionName, frame, simpleName, Output::DML_ManagedVar).GetPtr()
 #define DMLAsync(addr) Output::BuildHexValue(addr, Output::DML_Async).GetPtr()
+#define DMLIL(addr) Output::BuildHexValue(addr, Output::DML_IL).GetPtr()
 
 bool IsDMLEnabled();
 
@@ -1058,6 +1060,7 @@ DefineFormatClass(ThreadID, Formats::Hex, Output::DML_ThreadID);
 DefineFormatClass(RCWrapper, Formats::Pointer, Output::DML_RCWrapper);
 DefineFormatClass(CCWrapper, Formats::Pointer, Output::DML_CCWrapper);
 DefineFormatClass(InstructionPtr, Formats::Pointer, Output::DML_IP);
+DefineFormatClass(ILPtr, Formats::Pointer, Output::DML_IL);
 DefineFormatClass(NativePtr, Formats::Pointer, Output::DML_None);
 
 DefineFormatClass(Decimal, Formats::Decimal, Output::DML_None);