summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pal/src/exception/seh-unwind.cpp8
-rw-r--r--src/pal/src/exception/signal.cpp12
-rw-r--r--src/pal/src/include/pal/context.h8
-rw-r--r--src/pal/src/thread/context.cpp4
4 files changed, 16 insertions, 16 deletions
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index c69c3e1504..f0749e7b29 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -228,7 +228,7 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
// So we compensate it by incrementing the PC before passing it to the unwinder.
// Without it, the unwinder would not find unwind info if the hardware exception
// happened in the first instruction of a function.
- SetProgramCounterOnCONTEXT(context, GetProgramCounterFromCONTEXT(context) + 1);
+ CONTEXTSetPC(context, CONTEXTGetPC(context) + 1);
}
#if UNWIND_CONTEXT_IS_UCONTEXT_T
@@ -260,7 +260,7 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
// The behaviour of libunwind from nongnu.org is to null the PC
// So we bank the original PC here, so we can compare it after
// the step
- curPc = GetProgramCounterFromCONTEXT(context);
+ curPc = CONTEXTGetPC(context);
#endif
st = unw_step(&cursor);
@@ -285,9 +285,9 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
//
UnwindContextToWinContext(&cursor, context);
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_ARM64_)
- if (st == 0 && GetProgramCounterFromCONTEXT(context) == curPc)
+ if (st == 0 && CONTEXTGetPC(context) == curPc)
{
- SetProgramCounterOnCONTEXT(context, 0);
+ CONTEXTSetPC(context, 0);
}
#endif
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index 27fadc9b9d..6d1005b342 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -264,7 +264,7 @@ static void sigill_handler(int code, siginfo_t *siginfo, void *context)
record.ExceptionCode = CONTEXTGetExceptionCodeForSignal(siginfo, ucontext);
record.ExceptionFlags = EXCEPTION_IS_SIGNAL;
record.ExceptionRecord = NULL;
- record.ExceptionAddress = CONTEXTGetPC(ucontext);
+ record.ExceptionAddress = GetNativeContextPC(ucontext);
record.NumberParameters = 0;
pointers.ExceptionRecord = &record;
@@ -309,7 +309,7 @@ static void sigfpe_handler(int code, siginfo_t *siginfo, void *context)
record.ExceptionCode = CONTEXTGetExceptionCodeForSignal(siginfo, ucontext);
record.ExceptionFlags = EXCEPTION_IS_SIGNAL;
record.ExceptionRecord = NULL;
- record.ExceptionAddress = CONTEXTGetPC(ucontext);
+ record.ExceptionAddress = GetNativeContextPC(ucontext);
record.NumberParameters = 0;
pointers.ExceptionRecord = &record;
@@ -354,7 +354,7 @@ static void sigsegv_handler(int code, siginfo_t *siginfo, void *context)
record.ExceptionCode = CONTEXTGetExceptionCodeForSignal(siginfo, ucontext);
record.ExceptionFlags = EXCEPTION_IS_SIGNAL;
record.ExceptionRecord = NULL;
- record.ExceptionAddress = CONTEXTGetPC(ucontext);
+ record.ExceptionAddress = GetNativeContextPC(ucontext);
record.NumberParameters = 2;
// TODO: First parameter says whether a read (0) or write (non-0) caused the
@@ -407,7 +407,7 @@ static void sigtrap_handler(int code, siginfo_t *siginfo, void *context)
record.ExceptionCode = CONTEXTGetExceptionCodeForSignal(siginfo, ucontext);
record.ExceptionFlags = EXCEPTION_IS_SIGNAL;
record.ExceptionRecord = NULL;
- record.ExceptionAddress = CONTEXTGetPC(ucontext);
+ record.ExceptionAddress = GetNativeContextPC(ucontext);
record.NumberParameters = 0;
pointers.ExceptionRecord = &record;
@@ -538,7 +538,7 @@ static void sigbus_handler(int code, siginfo_t *siginfo, void *context)
record.ExceptionCode = CONTEXTGetExceptionCodeForSignal(siginfo, ucontext);
record.ExceptionFlags = EXCEPTION_IS_SIGNAL;
record.ExceptionRecord = NULL;
- record.ExceptionAddress = CONTEXTGetPC(ucontext);
+ record.ExceptionAddress = GetNativeContextPC(ucontext);
record.NumberParameters = 2;
// TODO: First parameter says whether a read (0) or write (non-0) caused the
@@ -596,7 +596,7 @@ static void inject_activation_handler(int code, siginfo_t *siginfo, void *contex
&winContext,
CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT);
- if (g_safeActivationCheckFunction(GetProgramCounterFromCONTEXT(&winContext)))
+ if (g_safeActivationCheckFunction(CONTEXTGetPC(&winContext)))
{
g_activationFunction(&winContext);
}
diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h
index e94c1a0ac1..74ab8f75c7 100644
--- a/src/pal/src/include/pal/context.h
+++ b/src/pal/src/include/pal/context.h
@@ -336,7 +336,7 @@ typedef ucontext_t native_context_t;
#endif // HAVE_BSD_REGS_T
-inline static DWORD64 GetProgramCounterFromCONTEXT(LPCONTEXT pContext)
+inline static DWORD64 CONTEXTGetPC(LPCONTEXT pContext)
{
#if defined(_AMD64_)
return pContext->Rip;
@@ -347,7 +347,7 @@ inline static DWORD64 GetProgramCounterFromCONTEXT(LPCONTEXT pContext)
#endif
}
-inline static void SetProgramCounterOnCONTEXT(LPCONTEXT pContext, DWORD64 pc)
+inline static void CONTEXTSetPC(LPCONTEXT pContext, DWORD64 pc)
{
#if defined(_AMD64_)
pContext->Rip = pc;
@@ -480,7 +480,7 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex
/*++
Function :
- CONTEXTGetPC
+ GetNativeContextPC
Returns the program counter from the native context.
@@ -491,7 +491,7 @@ Return value :
The program counter from the native context.
--*/
-LPVOID CONTEXTGetPC(const native_context_t *context);
+LPVOID GetNativeContextPC(const native_context_t *context);
/*++
Function :
diff --git a/src/pal/src/thread/context.cpp b/src/pal/src/thread/context.cpp
index fdeeda31da..cdabb4bad6 100644
--- a/src/pal/src/thread/context.cpp
+++ b/src/pal/src/thread/context.cpp
@@ -543,7 +543,7 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex
/*++
Function :
- CONTEXTGetPC
+ GetNativeContextPC
Returns the program counter from the native context.
@@ -554,7 +554,7 @@ Return value :
The program counter from the native context.
--*/
-LPVOID CONTEXTGetPC(const native_context_t *context)
+LPVOID GetNativeContextPC(const native_context_t *context)
{
#ifdef _AMD64_
return (LPVOID)MCREG_Rip(context->uc_mcontext);