Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/debug/ee/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -3994,7 +3994,7 @@ HANDLE OpenWin32EventOrThrow(
// Returns true if the specified IL offset has a special meaning (eg. prolog, etc.)
bool DbgIsSpecialILOffset(DWORD offset);

#if defined(TARGET_WINDOWS)
#if defined(TARGET_WINDOWS) && !defined(TARGET_X86)
void FixupDispatcherContext(T_DISPATCHER_CONTEXT* pDispatcherContext, T_CONTEXT* pContext, PEXCEPTION_ROUTINE pUnwindPersonalityRoutine = NULL);
#endif

Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/debug/ee/funceval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3990,7 +3990,7 @@ void * STDCALL FuncEvalHijackWorker(DebuggerEval *pDE)
}


#if defined(FEATURE_EH_FUNCLETS) && !defined(TARGET_UNIX)
#if defined(FEATURE_EH_FUNCLETS) && !defined(TARGET_UNIX) && !defined(TARGET_X86)

EXTERN_C EXCEPTION_DISPOSITION
FuncEvalHijackPersonalityRoutine(IN PEXCEPTION_RECORD pExceptionRecord,
Expand Down Expand Up @@ -4028,7 +4028,6 @@ FuncEvalHijackPersonalityRoutine(IN PEXCEPTION_RECORD pExceptionRecord,
return ExceptionCollidedUnwind;
}


#endif // FEATURE_EH_FUNCLETS && !TARGET_UNIX
#endif // FEATURE_EH_FUNCLETS && !TARGET_UNIX && !TARGET_X86

#endif // ifndef DACCESS_COMPILE
12 changes: 0 additions & 12 deletions src/coreclr/gcdump/i386/gcdumpx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#endif
#include "gcdump.h"


/*****************************************************************************/

#define castto(var,typ) (*(typ *)&var)
Expand Down Expand Up @@ -323,11 +322,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table,

gcPrintf("%s%s pointer\n",
(lowBits & byref_OFFSET_FLAG) ? "byref " : "",
#ifndef FEATURE_EH_FUNCLETS
(lowBits & this_OFFSET_FLAG) ? "this" : ""
#else
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flags between funclet and non-funclet are overloaded. We are building JIT without FEATURE_EH_FUNCLETS but it can produce both funclet and non-funclet code. It's a preexisting issue that JitDumps on NativeAOT/win-x86 would trigger the asserts.

(lowBits & pinned_OFFSET_FLAG) ? "pinned" : ""
#endif
);

_ASSERTE(endOffs <= methodSize);
Expand Down Expand Up @@ -456,10 +451,6 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table,
/* non-ptr arg push */

curOffs += (val & 0x07);
#ifndef FEATURE_EH_FUNCLETS
// For funclets, non-ptr arg pushes can be reported even for EBP frames
_ASSERTE(!header.ebpFrame);
#endif // FEATURE_EH_FUNCLETS
argCnt++;

DumpEncoding(bp, table-bp); bp = table;
Expand Down Expand Up @@ -681,9 +672,6 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table,
{
argTab += decodeUnsigned(argTab, &val);

#ifndef FEATURE_EH_FUNCLETS
assert((val & this_OFFSET_FLAG) == 0);
#endif
unsigned stkOffs = val & ~byref_OFFSET_FLAG;
unsigned lowBit = val & byref_OFFSET_FLAG;

Expand Down
30 changes: 30 additions & 0 deletions src/coreclr/inc/crosscomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,36 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {
#define T_DISPATCHER_CONTEXT DISPATCHER_CONTEXT
#define PT_DISPATCHER_CONTEXT PDISPATCHER_CONTEXT

#if defined(HOST_WINDOWS) && defined(TARGET_X86)
typedef struct _KNONVOLATILE_CONTEXT {

DWORD Edi;
DWORD Esi;
DWORD Ebx;
DWORD Ebp;

} KNONVOLATILE_CONTEXT, *PKNONVOLATILE_CONTEXT;

typedef struct _KNONVOLATILE_CONTEXT_POINTERS_EX
{
// The ordering of these fields should be aligned with that
// of corresponding fields in CONTEXT
//
// (See FillRegDisplay in inc/regdisp.h for details)
PDWORD Edi;
PDWORD Esi;
PDWORD Ebx;
PDWORD Edx;
PDWORD Ecx;
PDWORD Eax;

PDWORD Ebp;

} KNONVOLATILE_CONTEXT_POINTERS_EX, *PKNONVOLATILE_CONTEXT_POINTERS_EX;

#define KNONVOLATILE_CONTEXT_POINTERS KNONVOLATILE_CONTEXT_POINTERS_EX
#define PKNONVOLATILE_CONTEXT_POINTERS PKNONVOLATILE_CONTEXT_POINTERS_EX
#endif
#define T_KNONVOLATILE_CONTEXT_POINTERS KNONVOLATILE_CONTEXT_POINTERS
#define PT_KNONVOLATILE_CONTEXT_POINTERS PKNONVOLATILE_CONTEXT_POINTERS

Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/inc/regdisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pC
// This will setup the PC and SP
SyncRegDisplayToCurrentContext(pRD);

#ifdef TARGET_X86
pRD->PCTAddr = (UINT_PTR)&(pctx->Eip);
#endif

#if !defined(DACCESS_COMPILE)
#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
pRD->SSP = GetSSP(pctx);
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/vm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ elseif(CLR_CMAKE_TARGET_ARCH_I386)
set(VM_SOURCES_WKS_ARCH_ASM
${ARCH_SOURCES_DIR}/RedirectedHandledJITCase.asm
${ARCH_SOURCES_DIR}/asmhelpers.asm
${ARCH_SOURCES_DIR}/ehhelpers.asm
${ARCH_SOURCES_DIR}/gmsasm.asm
${ARCH_SOURCES_DIR}/jithelp.asm
${ARCH_SOURCES_DIR}/PInvokeStubs.asm
Expand Down
6 changes: 6 additions & 0 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6562,6 +6562,11 @@ BOOL ReadyToRunJitManager::IsFilterFunclet(EECodeInfo * pCodeInfo)
if (!pCodeInfo->IsFunclet())
return FALSE;

#ifdef TARGET_X86
// x86 doesn't use personality routines in unwind data, so we have to fallback to
// the slow implementation
return IJitManager::IsFilterFunclet(pCodeInfo);
#else
// Get address of the personality routine for the function being queried.
SIZE_T size;
PTR_VOID pUnwindData = GetUnwindDataBlob(pCodeInfo->GetModuleBase(), pCodeInfo->GetFunctionEntry(), &size);
Expand All @@ -6586,6 +6591,7 @@ BOOL ReadyToRunJitManager::IsFilterFunclet(EECodeInfo * pCodeInfo)
_ASSERTE(fRet == IJitManager::IsFilterFunclet(pCodeInfo));

return fRet;
#endif
}

#endif // FEATURE_EH_FUNCLETS
Expand Down
20 changes: 9 additions & 11 deletions src/coreclr/vm/excep.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ VOID DECLSPEC_NORETURN RealCOMPlusThrowInvalidCastException(TypeHandle thCastFro

VOID DECLSPEC_NORETURN RealCOMPlusThrowInvalidCastException(OBJECTREF *pObj, TypeHandle thCastTo);


#ifndef FEATURE_EH_FUNCLETS

#include "eexcp.h"
Expand Down Expand Up @@ -510,30 +509,29 @@ BOOL IsThreadHijackedForThreadStop(Thread* pThread, EXCEPTION_RECORD* pEx
void AdjustContextForThreadStop(Thread* pThread, T_CONTEXT* pContext);
OBJECTREF CreateCOMPlusExceptionObject(Thread* pThread, EXCEPTION_RECORD* pExceptionRecord, BOOL bAsynchronousThreadStop);

#if defined(TARGET_WINDOWS) && defined(TARGET_X86)
// Pop off any SEH handlers we have registered below pTargetSP
VOID PopSEHRecords(LPVOID pTargetSP);

// Misc functions to access and update the SEH chain. Be very, very careful about updating the SEH chain.
PEXCEPTION_REGISTRATION_RECORD GetCurrentSEHRecord();
VOID SetCurrentSEHRecord(EXCEPTION_REGISTRATION_RECORD *pSEH);
#endif

#if !defined(FEATURE_EH_FUNCLETS)
EXCEPTION_HANDLER_DECL(COMPlusFrameHandler);
EXCEPTION_HANDLER_DECL(COMPlusNestedExceptionHandler);
#ifdef FEATURE_COMINTEROP
EXCEPTION_HANDLER_DECL(COMPlusFrameHandlerRevCom);
#endif // FEATURE_COMINTEROP

// Pop off any SEH handlers we have registered below pTargetSP
VOID PopSEHRecords(LPVOID pTargetSP);

#ifdef DEBUGGING_SUPPORTED
VOID UnwindExceptionTrackerAndResumeInInterceptionFrame(ExInfo* pExInfo, EHContext* context);
#endif // DEBUGGING_SUPPORTED

BOOL PopNestedExceptionRecords(LPVOID pTargetSP, BOOL bCheckForUnknownHandlers = FALSE);
VOID PopNestedExceptionRecords(LPVOID pTargetSP, T_CONTEXT *pCtx, void *pSEH);

// Misc functions to access and update the SEH chain. Be very, very careful about updating the SEH chain.
// Frankly, if you think you need to use one of these function, please
// consult with the owner of the exception system.
PEXCEPTION_REGISTRATION_RECORD GetCurrentSEHRecord();
VOID SetCurrentSEHRecord(EXCEPTION_REGISTRATION_RECORD *pSEH);


#define STACK_OVERWRITE_BARRIER_SIZE 20
#define STACK_OVERWRITE_BARRIER_VALUE 0xabcdefab

Expand Down
Loading
Loading