fix GCInfo build problem, tested a few simple "HelloWorld" program works good!
authorZhicheng Zhu <zhizhu@microsoft.com>
Mon, 11 Apr 2016 18:01:21 +0000 (11:01 -0700)
committerZhicheng Zhu <zhizhu@microsoft.com>
Tue, 12 Apr 2016 17:29:38 +0000 (10:29 -0700)
src/ToolBox/SOS/Strike/disasm.cpp
src/inc/gcdump.h
src/inc/gcinfodecoder.h
src/vm/gcinfodecoder.cpp

index 701c6be..c614fbb 100644 (file)
@@ -44,7 +44,6 @@ namespace X86GCDump
 #endif // SOS_TARGET_X86
 
 #ifdef SOS_TARGET_AMD64 
-#ifndef FEATURE_PAL
 #include "gcdump.h"
 #define DAC_ARG(x)
 #define SUPPORTS_DAC
@@ -60,7 +59,6 @@ namespace X86GCDump
     #endif
     #define LOG_PIPTR(pObjRef, gcFlags, hCallBack) ((void)0)
 #include "gcdumpnonx86.cpp"
-#endif // FEATURE_PAL
 #endif // SOS_TARGET_AMD64
 
 #include "disasm.h"
@@ -1111,9 +1109,6 @@ LPCSTR AMD64Machine::s_SPName           = "RSP";
 ///
 void AMD64Machine::DumpGCInfo(BYTE* pTable, unsigned methodSize, printfFtn gcPrintf, bool encBytes, bool bPrintHeader) const
 {
-#ifdef FEATURE_PAL
-    ExtErr("AMD64Machine::DumpGCInfo not implemented\n");
-#else
     if (bPrintHeader)
     {
         ExtOut("Pointer table:\n");
@@ -1123,7 +1118,6 @@ void AMD64Machine::DumpGCInfo(BYTE* pTable, unsigned methodSize, printfFtn gcPri
     gcDump.gcPrintf = gcPrintf;
 
     gcDump.DumpGCTable(pTable, methodSize, 0);
-#endif // FEATURE_PAL
 }
 
 #endif // SOS_TARGET_AMD64
index 7aec159..aded6bb 100644 (file)
 #include "gcinfo.h"     // For InfoHdr
 
 #ifndef FASTCALL
+#ifndef FEATURE_PAL
 #define FASTCALL __fastcall
+#else
+#define FASTCALL
+#endif
 #endif
 
 
index bd802fe..52e8ed8 100644 (file)
@@ -13,6 +13,9 @@
 
 #include "daccess.h"
 
+#define _max(a, b) (((a) > (b)) ? (a) : (b)) 
+#define _min(a, b) (((a) < (b)) ? (a) : (b))
+
 #ifndef GCINFODECODER_NO_EE
 
 #include "eetwain.h"
@@ -150,6 +153,10 @@ enum ICodeManagerFlags
     #define MAX_PREDECODED_SLOTS 64
 #endif
 
+#if defined(FEATURE_PAL) && !defined(STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY)
+#define STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY
+#endif
+
 
 
 enum GcInfoDecoderFlags
index 674dce0..0a0a958 100644 (file)
@@ -1169,7 +1169,7 @@ void GcSlotDecoder::DecodeSlotTable(BitStreamReader& reader)
         m_SlotArray[0].Slot.RegisterNumber = regNum;
         m_SlotArray[0].Flags = flags;
 
-        UINT32 loopEnd = min(m_NumRegisters, MAX_PREDECODED_SLOTS);
+        UINT32 loopEnd = _min(m_NumRegisters, MAX_PREDECODED_SLOTS);
         for(i++; i < loopEnd; i++)
         {
             if(flags)
@@ -1203,7 +1203,7 @@ void GcSlotDecoder::DecodeSlotTable(BitStreamReader& reader)
         m_SlotArray[i].Slot.Stack.Base = spBase;
         m_SlotArray[i].Flags = flags;
 
-        UINT32 loopEnd = min(m_NumRegisters + numStackSlots, MAX_PREDECODED_SLOTS);
+        UINT32 loopEnd = _min(m_NumRegisters + numStackSlots, MAX_PREDECODED_SLOTS);
         for(i++; i < loopEnd; i++)
         {
             spBase = (GcStackSlotBase) reader.Read(2);
@@ -1240,7 +1240,7 @@ void GcSlotDecoder::DecodeSlotTable(BitStreamReader& reader)
         m_SlotArray[i].Slot.Stack.Base = spBase;
         m_SlotArray[i].Flags = flags;
 
-        UINT32 loopEnd = min(m_NumSlots, MAX_PREDECODED_SLOTS);
+        UINT32 loopEnd = _min(m_NumSlots, MAX_PREDECODED_SLOTS);
         for(i++; i < loopEnd; i++)
         {
             spBase = (GcStackSlotBase) reader.Read(2);
@@ -1539,8 +1539,7 @@ void GcInfoDecoder::ReportRegisterToGC(  // AMD64
     LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum ));
 
     OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD );
-
-#ifdef FEATURE_PAL
+#if defined(FEATURE_PAL) && !defined(SOS_TARGET_AMD64) 
     // On PAL, we don't always have the context pointers available due to
     // a limitation of an unwinding library. In such case, the context
     // pointers for some nonvolatile registers are NULL.
@@ -1560,7 +1559,7 @@ void GcInfoDecoder::ReportRegisterToGC(  // AMD64
 
         gcFlags |= GC_CALL_PINNED;
     }
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !SOS_TARGET_AMD64
 
 #ifdef _DEBUG
     if(IsScratchRegister(regNum, pRD))