[x86/Linux] Fix framepointer while unwinding (dotnet/coreclr#9678)
authorSaeHie Park <saehie.park@gmail.com>
Wed, 22 Feb 2017 00:26:21 +0000 (09:26 +0900)
committerJan Vorlicek <janvorli@microsoft.com>
Wed, 22 Feb 2017 00:26:21 +0000 (01:26 +0100)
Use pCallerContext when getting frame pointer

Commit migrated from https://github.com/dotnet/coreclr/commit/2d7eedbbfd0d259659517ca68de05b82ec7f87a5

src/coreclr/src/vm/eetwain.cpp

index 33ef29e..bf6e1c7 100644 (file)
@@ -5169,7 +5169,11 @@ OBJECTREF EECodeManager::GetInstance( PREGDISPLAY    pContext,
     if (info.ebpFrame)
     {
         _ASSERTE(stackDepth == 0);
-        taArgBase = *pContext->GetEbpLocation();
+#if defined(WIN64EXCEPTIONS)
+        taArgBase = GetCallerSp(pContext) - 2 * sizeof(TADDR);
+#else
+        taArgBase = *pContext->pEbp;
+#endif
     }
     else
     {
@@ -5340,7 +5344,11 @@ PTR_VOID EECodeManager::GetParamTypeArg(PREGDISPLAY     pContext,
         return NULL;
     }
 
+#if defined(WIN64EXCEPTIONS)
+    TADDR fp = GetCallerSp(pContext) - 2 * sizeof(TADDR);
+#else
     TADDR fp = GetRegdisplayFP(pContext);
+#endif
     TADDR taParamTypeArg = *PTR_TADDR(fp - GetParamTypeArgOffset(&info));
     return PTR_VOID(taParamTypeArg);