Skip to content

CDRIVER-5839 Unofficial ARM64 Windows support #1810

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

Merged
merged 5 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion src/libmongoc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ if (ENABLE_TESTS)

target_link_libraries (${test}
PUBLIC
$<$<C_COMPILER_ID:MSVC>:DbgHelp.dll>
$<$<PLATFORM_ID:Windows>:DbgHelp.lib>
mongoc_static
)
# We have tests that test our deprecated api.
Expand Down
9 changes: 8 additions & 1 deletion src/libmongoc/tests/test-libmongoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2476,10 +2476,17 @@ windows_exception_handler (EXCEPTION_POINTERS *pExceptionInfo)
STACKFRAME64 stack_frame;
memset (&stack_frame, 0, sizeof (stack_frame));
#if defined(_WIN64)
#if defined(_M_ARM64)
int machine_type = IMAGE_FILE_MACHINE_ARM64;
stack_frame.AddrPC.Offset = context_record.Pc;
stack_frame.AddrFrame.Offset = context_record.Fp;
stack_frame.AddrStack.Offset = context_record.Sp;
#else
int machine_type = IMAGE_FILE_MACHINE_AMD64;
stack_frame.AddrPC.Offset = context_record.Rip;
stack_frame.AddrFrame.Offset = context_record.Rbp;
stack_frame.AddrStack.Offset = context_record.Rsp;
#endif
#else
int machine_type = IMAGE_FILE_MACHINE_I386;
stack_frame.AddrPC.Offset = context_record.Eip;
Expand Down Expand Up @@ -2522,7 +2529,7 @@ windows_exception_handler (EXCEPTION_POINTERS *pExceptionInfo)
line.SizeOfStruct = sizeof (IMAGEHLP_LINE);

DWORD offset_ln = 0;
if (SymGetLineFromAddr (process, (DWORD64) stack_frame.AddrPC.Offset, &offset_ln, &line)) {
if (SymGetLineFromAddr64 (process, (DWORD64) stack_frame.AddrPC.Offset, &offset_ln, &line)) {
fprintf (stderr, " %s:%d ", line.FileName, line.LineNumber);
}

Expand Down