pExState->GetFlags()->SetDebugCatchHandlerFound();
#ifdef DEBUGGING_SUPPORTED
-
-
+#ifdef DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
if ( (pThread != NULL) &&
(pThread->IsExceptionInProgress()) &&
(pThread->GetExceptionState()->GetFlags()->DebuggerInterceptInfo()) )
//
ClrDebuggerDoUnwindAndIntercept(X86_FIRST_ARG(EXCEPTION_CHAIN_END) pExceptionPointers->ExceptionRecord);
}
+#endif // DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
#endif // DEBUGGING_SUPPORTED
return EXCEPTION_CONTINUE_SEARCH;
UNINSTALL_NESTED_EXCEPTION_HANDLER();
+#ifdef DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
EX_TRY
{
// if the debugger wants to intercept the unhandled exception then we immediately unwind without returning
{
}
EX_END_CATCH(SwallowAllExceptions);
+#endif // DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
return retval;
}
// perform simple checking to see if the current exception is intercepted
bool CheckThreadExceptionStateForInterception();
+#ifndef FEATURE_PAL
+// Currently, only Windows supports ClrUnwindEx (used inside ClrDebuggerDoUnwindAndIntercept)
+#define DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
+#endif // !FEATURE_PAL
+
+#ifdef DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
// Intercept the current exception and start an unwind. This function may never return.
EXCEPTION_DISPOSITION ClrDebuggerDoUnwindAndIntercept(X86_FIRST_ARG(EXCEPTION_REGISTRATION_RECORD *pEstablisherFrame)
EXCEPTION_RECORD *pExceptionRecord);
+#endif // DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
LONG NotifyDebuggerLastChance(Thread *pThread,
EXCEPTION_POINTERS *pExceptionInfo,
TrackerAllocator g_theTrackerAllocator;
-void __declspec(noinline)
-ClrUnwindEx(EXCEPTION_RECORD* pExceptionRecord,
- UINT_PTR ReturnValue,
- UINT_PTR TargetIP,
- UINT_PTR TargetFrameSp);
-
bool FixNonvolatileRegisters(UINT_PTR uOriginalSP,
Thread* pThread,
CONTEXT* pContextRecord,
}
}
+#ifdef DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
//---------------------------------------------------------------------------------------
//
// This function is called by DefaultCatchHandler() to intercept an exception and start an unwind.
UNREACHABLE();
}
+#endif // DEBUGGER_EXCEPTION_INTERCEPTION_SUPPORTED
#endif // DEBUGGING_SUPPORTED
#ifdef _DEBUG
#endif // FEATURE_PAL
+#ifndef FEATURE_PAL
void ClrUnwindEx(EXCEPTION_RECORD* pExceptionRecord, UINT_PTR ReturnValue, UINT_PTR TargetIP, UINT_PTR TargetFrameSp)
{
-#ifndef FEATURE_PAL
PVOID TargetFrame = (PVOID)TargetFrameSp;
CONTEXT ctx;
&ctx,
NULL); // HistoryTable
-#else // !FEATURE_PAL
- PORTABILITY_ASSERT("UNIXTODO: Implement unwinding for PAL");
-#endif // !FEATURE_PAL
-
// doesn't return
UNREACHABLE();
}
+#endif // !FEATURE_PAL
void TrackerAllocator::Init()
{
IN OUT PT_DISPATCHER_CONTEXT pDispatcherContext);
+#ifndef FEATURE_PAL
void __declspec(noinline)
ClrUnwindEx(EXCEPTION_RECORD* pExceptionRecord,
UINT_PTR ReturnValue,
UINT_PTR TargetIP,
UINT_PTR TargetFrameSp);
+#endif // !FEATURE_PAL
typedef DWORD_PTR (HandlerFn)(UINT_PTR uStackFrame, Object* pExceptionObj);