Skip to content

Commit

Permalink
Delete some more
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Oct 9, 2024
1 parent 9c366a3 commit de085ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 91 deletions.
42 changes: 5 additions & 37 deletions src/coreclr/debug/daccess/fntableaccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ static NTSTATUS OutOfProcessFindHeader(ReadMemoryFunction fpReadMemory,PVOID pUs
pHeader = tmp; \
}

static NTSTATUS OutOfProcessFunctionTableCallback_JIT(IN ReadMemoryFunction fpReadMemory,
IN PVOID pUserContext,
IN PVOID TableAddress,
OUT PULONG pnEntries,
OUT PT_RUNTIME_FUNCTION* ppFunctions)
extern "C" NTSTATUS OutOfProcessFunctionTableCallbackEx(IN ReadMemoryFunction fpReadMemory,
IN PVOID pUserContext,
IN PVOID TableAddress,
OUT PULONG pnEntries,
OUT PT_RUNTIME_FUNCTION* ppFunctions)
{
if (NULL == pnEntries) { return STATUS_INVALID_PARAMETER_3; }
if (NULL == ppFunctions) { return STATUS_INVALID_PARAMETER_4; }
Expand Down Expand Up @@ -284,38 +284,6 @@ extern "C" NTSTATUS OutOfProcessFunctionTableCallback(IN HANDLE
return OutOfProcessFunctionTableCallbackEx(&ReadMemory, hProcess, TableAddress, pnEntries, ppFunctions);
}

extern "C" NTSTATUS OutOfProcessFunctionTableCallbackEx(IN ReadMemoryFunction fpReadMemory,
IN PVOID pUserContext,
IN PVOID TableAddress,
OUT PULONG pnEntries,
OUT PT_RUNTIME_FUNCTION* ppFunctions)
{
if (NULL == pnEntries) { return STATUS_INVALID_PARAMETER_3; }
if (NULL == ppFunctions) { return STATUS_INVALID_PARAMETER_4; }

DYNAMIC_FUNCTION_TABLE * pTable = (DYNAMIC_FUNCTION_TABLE *) TableAddress;
PVOID pvContext;

move(pvContext, &pTable->Context);

FakeEEDynamicFunctionTableType type = (FakeEEDynamicFunctionTableType)((SIZE_T)pvContext & 3);

switch (type)
{
case FAKEDYNFNTABLE_JIT:
return OutOfProcessFunctionTableCallback_JIT(
fpReadMemory,
pUserContext,
TableAddress,
pnEntries,
ppFunctions);
default:
break;
}

return STATUS_UNSUCCESSFUL;
}

#else

extern "C" NTSTATUS OutOfProcessFunctionTableCallback()
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/debug/daccess/fntableaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ typedef struct _FakeHpCodeHdr
#define FAKE_STUB_CODE_BLOCK_LAST 0xF


enum FakeEEDynamicFunctionTableType
{
FAKEDYNFNTABLE_JIT = 0,
};


#ifdef CHECK_DUPLICATED_STRUCT_LAYOUTS

//
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2611,8 +2611,7 @@ HeapList* EEJitManager::NewCodeHeap(CodeHeapRequestInfo *pInfo, DomainCodeHeapLi
(PVOID)pStartRange,
(ULONG)((ULONG64)pEndRange - (ULONG64)pStartRange),
GetRuntimeFunctionCallback,
this,
DYNFNTABLE_JIT);
this);
}
EX_CATCH
{
Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/vm/rtlfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ HRESULT EnsureRtlFunctions()

#ifndef HOST_X86

#define DYNAMIC_FUNCTION_TABLE_MAX_RANGE INT32_MAX

VOID InstallEEFunctionTable (
PVOID pvTableID,
PVOID pvStartRange,
ULONG cbRange,
PGET_RUNTIME_FUNCTION_CALLBACK pfnGetRuntimeFunctionCallback,
PVOID pvContext,
EEDynamicFunctionTableType TableType)
PVOID pvContext)
{
CONTRACTL
{
Expand Down Expand Up @@ -120,7 +121,7 @@ VOID InstallEEFunctionTable (
(ULONG_PTR)pvStartRange,
cbRange,
pfnGetRuntimeFunctionCallback,
EncodeDynamicFunctionTableContext(pvContext, TableType),
pvContext,
wszModuleName))
{
COMPlusThrowOM();
Expand Down
44 changes: 1 addition & 43 deletions src/coreclr/vm/rtlfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,6 @@
#ifndef __RTLFUNCTIONS_H__
#define __RTLFUNCTIONS_H__

#ifdef FEATURE_EH_FUNCLETS

enum EEDynamicFunctionTableType
{
DYNFNTABLE_JIT = 0,
DYNFNTABLE_STUB = 1,
DYNFNTABLE_INVALID = -1,

DYNFNTABLE_FIRST = DYNFNTABLE_JIT,
DYNFNTABLE_LAST = DYNFNTABLE_STUB,
};

// Used by OutOfProcessFunctionTableCallback in DLLS\mscordbg\DebugSupport.cpp
// to figure out how to parse a dynamic function table that was registered
// with a callback.
inline
EEDynamicFunctionTableType IdentifyDynamicFunctionTableTypeFromContext (PVOID pvContext)
{
EEDynamicFunctionTableType type = (EEDynamicFunctionTableType)((SIZE_T)pvContext & 3);
if (type < DYNFNTABLE_FIRST || type > DYNFNTABLE_LAST)
type = DYNFNTABLE_INVALID;
return type;
}

inline
PVOID EncodeDynamicFunctionTableContext (PVOID pvContext, EEDynamicFunctionTableType type)
{
_ASSERTE(type >= DYNFNTABLE_FIRST && type <= DYNFNTABLE_LAST);
return (PVOID)((SIZE_T)pvContext | type);
}

inline
PVOID DecodeDynamicFunctionTableContext (PVOID pvContext)
{
return (PVOID)((SIZE_T)pvContext & ~3);
}


#define DYNAMIC_FUNCTION_TABLE_MAX_RANGE INT32_MAX

#endif // FEATURE_EH_FUNCLETS


#if !defined(DACCESS_COMPILE) && defined(HOST_WINDOWS) && !defined(HOST_X86)

Expand All @@ -69,7 +27,7 @@ VOID DeleteEEFunctionTable(

#else

#define InstallEEFunctionTable(pvTableID, pvStartRange, cbRange, pfnGetRuntimeFunctionCallback, pvContext, TableType) do { } while (0)
#define InstallEEFunctionTable(pvTableID, pvStartRange, cbRange, pfnGetRuntimeFunctionCallback, pvContext) do { } while (0)
#define DeleteEEFunctionTable(pvTableID) do { } while (0)

#endif
Expand Down

0 comments on commit de085ec

Please sign in to comment.