From eb6acf02ad2cba4c0603c2a9d87508f942709945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sat, 14 Sep 2024 11:05:22 +0300 Subject: [PATCH] Support getregs() for aarch64-unknown-linux-musl --- changelog/2502.added.md | 1 + src/sys/ptrace/linux.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changelog/2502.added.md diff --git a/changelog/2502.added.md b/changelog/2502.added.md new file mode 100644 index 0000000000..ec639752ee --- /dev/null +++ b/changelog/2502.added.md @@ -0,0 +1 @@ +Add `getregset()` for Linux/musl/aarch64 diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs index 8abaf4d71b..ea842d4ea0 100644 --- a/src/sys/ptrace/linux.rs +++ b/src/sys/ptrace/linux.rs @@ -14,11 +14,10 @@ pub type AddressType = *mut ::libc::c_void; target_os = "linux", any( all( - target_arch = "x86_64", + any(target_arch = "x86_64", target_arch = "aarch64"), any(target_env = "gnu", target_env = "musl") ), all(target_arch = "x86", target_env = "gnu"), - all(target_arch = "aarch64", target_env = "gnu"), all(target_arch = "riscv64", target_env = "gnu"), ), ))] @@ -334,8 +333,13 @@ pub fn getregs(pid: Pid) -> Result { /// [ptrace(2)]: https://www.man7.org/linux/man-pages/man2/ptrace.2.html #[cfg(all( target_os = "linux", - target_env = "gnu", - any(target_arch = "aarch64", target_arch = "riscv64") + any( + all( + target_arch = "aarch64", + any(target_env = "gnu", target_env = "musl") + ), + all(target_arch = "riscv64", target_env = "gnu") + ) ))] pub fn getregs(pid: Pid) -> Result { getregset::(pid)