Arm64 Sos fixes for
authorRama Krishnan Raghupathy <ramarag@microsoft.com>
Tue, 16 Aug 2016 01:34:24 +0000 (18:34 -0700)
committerRama Krishnan Raghupathy <ramarag@microsoft.com>
Tue, 16 Aug 2016 01:34:24 +0000 (18:34 -0700)
!verify heap
!u
!u -gcinfo

src/ToolBox/SOS/Strike/disasmARM64.cpp
src/ToolBox/SOS/Strike/gcroot.cpp
src/ToolBox/SOS/Strike/strike.cpp
src/ToolBox/SOS/Strike/util.h
src/gcinfo/gcinfodumper.cpp

index 4ac8c59..2629e6d 100644 (file)
@@ -173,7 +173,7 @@ void ARM64Machine::Unassembly (
 
     while(PC < PCEnd)
     {
-        ULONG_PTR prevPC = PC;
+        ULONG_PTR currentPC = PC;
         DisasmAndClean (PC, line, _countof(line));
 
         // This is the closing of the previous run. 
@@ -196,7 +196,7 @@ void ARM64Machine::Unassembly (
             }
             ExtOut ("\n");
         }
-        else if (prevPC != PCBegin)
+        else if (currentPC != PCBegin)
         {
             ExtOut ("\n");
         }
@@ -209,7 +209,7 @@ void ARM64Machine::Unassembly (
         //
         // Print out line numbers if needed
         //
-        if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(PC), &lineNum, fileName, MAX_PATH_FNAME+1)))
+        if (!bSuppressLines && SUCCEEDED(GetLineByOffset(TO_CDADDR(currentPC), &lineNum, fileName, MAX_PATH_FNAME+1)))
         {
             if (lineNum != curLine)
             {
@@ -223,7 +223,7 @@ void ARM64Machine::Unassembly (
         //
         if (pGCEncodingInfo)
         {
-            SIZE_T curOffset = (PC - PCBegin) + pGCEncodingInfo->hotSizeToAdd;
+            SIZE_T curOffset = (currentPC - PCBegin) + pGCEncodingInfo->hotSizeToAdd;
             while (   !pGCEncodingInfo->fDoneDecoding
                    && pGCEncodingInfo->ofs <= curOffset)
             {
@@ -238,10 +238,10 @@ void ARM64Machine::Unassembly (
         //
         if (pEHInfo)
         {
-            pEHInfo->FormatForDisassembly(PC - PCBegin);
+            pEHInfo->FormatForDisassembly(currentPC - PCBegin);
         }
         
-        if (PC == PCAskedFor)
+        if (currentPC == PCAskedFor)
         {
             ExtOut (">>> ");
         }
@@ -251,7 +251,7 @@ void ARM64Machine::Unassembly (
         //
         if (bDisplayOffsets)
         {
-            ExtOut("%04x ", PC - PCBegin);
+            ExtOut("%04x ", currentPC - PCBegin);
         }
 
         // look at the disassembled bytes
@@ -271,7 +271,7 @@ void ARM64Machine::Unassembly (
                 || !strncmp (ptr, "badc0de2", 8)
                 ))
         {
-            ULONG_PTR InstrAddr = prevPC;
+            ULONG_PTR InstrAddr = currentPC;
 
             //
             // Compute address into saved copy of the code, and
@@ -294,7 +294,7 @@ void ARM64Machine::Unassembly (
             // Print out real code address in place of the copy address
             //
 
-            ExtOut("%08x ", (ULONG)InstrAddr);
+                       ExtOut("%08x`%08x ", (ULONG)(InstrAddr >> 32), (ULONG)InstrAddr);
 
             ptr = line;
             NextTerm (ptr);
index 663457d..f68b935 100644 (file)
@@ -1320,11 +1320,11 @@ void PrintNotReachableInRange(TADDR rngStart, TADDR rngEnd, BOOL bExcludeReadyFo
 // The value of card_size is determined empirically according to the average size of an object
 // In the code we also rely on the assumption that one card_table entry (DWORD) covers an entire os page
 //
-#if defined (_TARGET_AMD64_)
+#if defined (_TARGET_WIN64_)
 #define card_size ((size_t)(2*DT_OS_PAGE_SIZE/card_word_width))
 #else
 #define card_size ((size_t)(DT_OS_PAGE_SIZE/card_word_width))
-#endif //_TARGET_AMD64_
+#endif //_TARGET_WIN64_
 
 // so card_size = 128 on x86, 256 on x64
 
index df4a184..3164c2c 100644 (file)
@@ -8101,7 +8101,7 @@ void DecodeGCTableEntry (const char *fmt, ...)
 VOID CALLBACK DumpGCTableFiberEntry (LPVOID pvGCEncodingInfo)
 {
     GCEncodingInfo *pInfo = (GCEncodingInfo*)pvGCEncodingInfo;
-    GCInfoToken gcInfoToken = { pInfo, GCINFO_VERSION };
+    GCInfoToken gcInfoToken = { pInfo->table, GCINFO_VERSION };
     g_targetMachine->DumpGCInfo(gcInfoToken, pInfo->methodSize, DecodeGCTableEntry, false /*encBytes*/, false /*bPrintHeader*/);
 
     pInfo->fDoneDecoding = true;
index 4fad1b7..ee49f8c 100644 (file)
@@ -2631,7 +2631,6 @@ typedef struct {
 #define THUMB_CODE 1
 #endif
 
-//ARM64TODO: Verify the correctness of the following for ARM64
 ///ARM64 Context
 #define ARM64_MAX_BREAKPOINTS     8
 #define ARM64_MAX_WATCHPOINTS     2
index 4e31871..3bd2f5c 100644 (file)
@@ -260,7 +260,7 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this
                 break;
             }
 #elif defined (_TARGET_ARM64_)
-
+            iEncodedReg = iEncodedReg + ctx; //We have to compensate for not tracking x18
             if (ctx == 1)
             {
                 if (iReg < 18 )   // skip volatile registers for second context
@@ -673,7 +673,7 @@ PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on th
         if(safePointDecoder.IsSafePoint(safePointOffset))
         {
             _ASSERTE(!fNewInterruptible);
-            if (pfnSafePointFunc(offset, pvData))
+            if (pfnSafePointFunc(safePointOffset, pvData))
                 break;
 
             flags = 0;