Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12991 Fix build on Windows for ARM64 #6668

Merged
merged 2 commits into from
Aug 8, 2024
Merged
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
25 changes: 15 additions & 10 deletions cli/cppcheckexecutorseh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,23 @@ namespace {
);
CONTEXT context = *(ex->ContextRecord);
STACKFRAME64 stack= {0};
#ifdef _M_IX86
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Mode = AddrModeFlat;
#if defined(_M_IX86)
stack.AddrPC.Offset = context.Eip;
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Offset = context.Esp;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Offset = context.Ebp;
stack.AddrFrame.Mode = AddrModeFlat;
#else
#elif defined(_M_AMD64)
stack.AddrPC.Offset = context.Rip;
stack.AddrPC.Mode = AddrModeFlat;
stack.AddrStack.Offset = context.Rsp;
stack.AddrStack.Mode = AddrModeFlat;
stack.AddrFrame.Offset = context.Rsp;
stack.AddrFrame.Mode = AddrModeFlat;
#elif defined(_M_ARM64)
stack.AddrPC.Offset = context.Pc;
stack.AddrStack.Offset = context.Sp;
stack.AddrFrame.Offset = context.Fp;
#else
#error Platform not supported!
#endif
IMAGEHLP_SYMBOL64_EXT symbol;
symbol.SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
Expand All @@ -101,10 +104,12 @@ namespace {
for (ULONG frame = 0; ; frame++) {
BOOL result = pStackWalk64
(
#ifdef _M_IX86
#if defined(_M_IX86)
IMAGE_FILE_MACHINE_I386,
#else
#elif defined(_M_AMD64)
IMAGE_FILE_MACHINE_AMD64,
#elif defined(_M_ARM64)
IMAGE_FILE_MACHINE_ARM64,
#endif
hProcess,
hThread,
Expand Down
Loading