Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ jobs:
TEST_X86: 1
- name: Windows (latest)
os: windows-latest
- name: Windows arm64
os: windows-11-arm
- name: Windows (latest, UTF-8 paths)
os: windows-latest
UTF8_TEST_CWD: 1
Expand Down
43 changes: 41 additions & 2 deletions src/backends/sentry_backend_inproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,47 @@ registers_from_uctx(const sentry_ucontext_t *uctx)
SET_REG("esp", Esp);
}

# else
// _ARM64_
# elif defined(_M_ARM64)

if (ctx->ContextFlags & CONTEXT_INTEGER) {
SET_REG("x0", X0);
SET_REG("x1", X1);
SET_REG("x2", X2);
SET_REG("x3", X3);
SET_REG("x4", X4);
SET_REG("x5", X5);
SET_REG("x6", X6);
SET_REG("x7", X7);
SET_REG("x8", X8);
SET_REG("x9", X9);
SET_REG("x10", X10);
SET_REG("x11", X11);
SET_REG("x12", X12);
SET_REG("x13", X13);
SET_REG("x14", X14);
SET_REG("x15", X15);
SET_REG("x16", X16);
SET_REG("x17", X17);
// x18 is reserved as platform register on Windows
SET_REG("x19", X19);
SET_REG("x20", X20);
SET_REG("x21", X21);
SET_REG("x22", X22);
SET_REG("x23", X23);
SET_REG("x24", X24);
SET_REG("x25", X25);
SET_REG("x26", X26);
SET_REG("x27", X27);
SET_REG("x28", X28);
}

if (ctx->ContextFlags & CONTEXT_CONTROL) {
SET_REG("fp", Fp);
SET_REG("lr", Lr);
SET_REG("sp", Sp);
SET_REG("pc", Pc);
}

# endif

# undef SET_REG
Expand Down
5 changes: 3 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ pytest==8.1.1
pytest-httpserver==1.0.10
msgpack==1.0.8
pytest-xdist==3.5.0
clang-format==19.1.3
clang-format==20.1.5
pywin32==308; sys_platform == "win32"
mitmproxy==11.0.0
# mitmproxy requires OpenSSL to build on Windows ARM64, skip it there
mitmproxy==11.0.0; platform_machine != "ARM64"
psutil==7.1.1
12 changes: 7 additions & 5 deletions tests/test_build_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ def test_static_lib(cmake):
binary.seek(offset, 0)
magic = binary.read(6)
# https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#signature-image-only
assert magic == (
b"PE\x00\x00\x4c\x01"
if os.environ.get("TEST_X86")
else b"PE\x00\x00\x64\x86"
)
if os.environ.get("TEST_X86"):
expected = b"PE\x00\x00\x4c\x01" # IMAGE_FILE_MACHINE_I386
elif os.environ.get("PROCESSOR_ARCHITECTURE") == "ARM64":
expected = b"PE\x00\x00\x64\xaa" # IMAGE_FILE_MACHINE_ARM64
else:
expected = b"PE\x00\x00\x64\x86" # IMAGE_FILE_MACHINE_AMD64
assert magic == expected
# similarly, we use `file` on linux
if sys.platform == "linux":
output = subprocess.check_output(
Expand Down
Loading