* Fix stack overflow reporting from native code
When stack overflow happens in native code, the stack walker is unable
to walk the stack and we end up reporting no call stack at all.
This change fixes it by first unwinding the exception context to the first
managed frame and then letting the stack walker to walk the frames.
* Revert behavior for the Windows x86 case
if (pExceptionInfo && pExceptionInfo->ContextRecord)
{
GCX_COOP();
+#if defined(TARGET_X86) && defined(TARGET_WINDOWS)
+ // For Windows x86, we don't have a reliable method to unwind to the first managed call frame,
+ // so we handle at least the cases when the stack overflow happens in JIT helpers
AdjustContextForJITHelpers(pExceptionInfo->ExceptionRecord, pExceptionInfo->ContextRecord);
+#else
+ Thread::VirtualUnwindToFirstManagedCallFrame(pExceptionInfo->ContextRecord);
+#endif
fef.InitAndLink(pExceptionInfo->ContextRecord);
}