mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[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:
@@ -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
|
||||
{
|
||||
Reference in New Issue
Block a user