[ARM64] UnhandledExceptionHandler ARM64 support (#17587)

* Rename UnhandledExceptionHandler_x64.h and InitUnhandledExceptionHandler_x64

* Added ARM64 registers to UnhandledExceptionHandler

* Added ARM64 registers to unhandled_exception_handler.cpp
This commit is contained in:
Jeremy Sinclair
2022-04-08 05:19:42 -04:00
committed by GitHub
parent 5dd9049810
commit f778d010e5
9 changed files with 41 additions and 18 deletions

View File

@@ -162,11 +162,18 @@ inline void LogStackTrace()
HANDLE process = GetCurrentProcess();
HANDLE thread = GetCurrentThread();
#ifdef _M_ARM64
stack.AddrPC.Offset = context.Pc;
stack.AddrStack.Offset = context.Sp;
stack.AddrFrame.Offset = context.Fp;
#else
stack.AddrPC.Offset = context.Rip;
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Offset = context.Rsp;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Offset = context.Rbp;
#endif
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Mode = AddrModeFlat;
BOOL result = false;
@@ -174,7 +181,11 @@ inline void LogStackTrace()
for (;;)
{
result = StackWalk64(
#ifdef _M_ARM64
IMAGE_FILE_MACHINE_ARM64,
#else
IMAGE_FILE_MACHINE_AMD64,
#endif
process,
thread,
&stack,
@@ -252,7 +263,7 @@ inline void InitSymbols()
}
}
inline void InitUnhandledExceptionHandler_x64(void)
inline void InitUnhandledExceptionHandler(void)
{
try
{