@@ -14,11 +14,10 @@ pub type AddressType = *mut ::libc::c_void;
1414 target_os = "linux" ,
1515 any(
1616 all(
17- target_arch = "x86_64" ,
17+ any ( target_arch = "x86_64" , target_arch = "aarch64" ) ,
1818 any( target_env = "gnu" , target_env = "musl" )
1919 ) ,
2020 all( target_arch = "x86" , target_env = "gnu" ) ,
21- all( target_arch = "aarch64" , target_env = "gnu" ) ,
2221 all( target_arch = "riscv64" , target_env = "gnu" ) ,
2322 ) ,
2423) ) ]
@@ -334,8 +333,13 @@ pub fn getregs(pid: Pid) -> Result<user_regs_struct> {
334333/// [ptrace(2)]: https://www.man7.org/linux/man-pages/man2/ptrace.2.html
335334#[ cfg( all(
336335 target_os = "linux" ,
337- target_env = "gnu" ,
338- any( target_arch = "aarch64" , target_arch = "riscv64" )
336+ any(
337+ all(
338+ target_arch = "aarch64" ,
339+ any( target_env = "gnu" , target_env = "musl" )
340+ ) ,
341+ all( target_arch = "riscv64" , target_env = "gnu" )
342+ )
339343) ) ]
340344pub fn getregs ( pid : Pid ) -> Result < user_regs_struct > {
341345 getregset :: < regset:: NT_PRSTATUS > ( pid)
@@ -344,12 +348,17 @@ pub fn getregs(pid: Pid) -> Result<user_regs_struct> {
344348/// Get a particular set of user registers, as with `ptrace(PTRACE_GETREGSET, ...)`
345349#[ cfg( all(
346350 target_os = "linux" ,
347- target_env = "gnu" ,
348351 any(
349- target_arch = "x86_64" ,
350- target_arch = "x86" ,
351- target_arch = "aarch64" ,
352- target_arch = "riscv64" ,
352+ all(
353+ target_env = "gnu" ,
354+ any(
355+ target_arch = "x86_64" ,
356+ target_arch = "x86" ,
357+ target_arch = "aarch64" ,
358+ target_arch = "riscv64"
359+ )
360+ ) ,
361+ all( target_env = "musl" , target_arch = "aarch64" )
353362 )
354363) ) ]
355364pub fn getregset < S : RegisterSet > ( pid : Pid ) -> Result < S :: Regs > {
@@ -408,8 +417,13 @@ pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> {
408417/// [ptrace(2)]: https://www.man7.org/linux/man-pages/man2/ptrace.2.html
409418#[ cfg( all(
410419 target_os = "linux" ,
411- target_env = "gnu" ,
412- any( target_arch = "aarch64" , target_arch = "riscv64" )
420+ any(
421+ all(
422+ target_env = "gnu" ,
423+ any( target_arch = "aarch64" , target_arch = "riscv64" )
424+ ) ,
425+ all( target_env = "musl" , target_arch = "aarch64" )
426+ )
413427) ) ]
414428pub fn setregs ( pid : Pid , regs : user_regs_struct ) -> Result < ( ) > {
415429 setregset :: < regset:: NT_PRSTATUS > ( pid, regs)
@@ -418,12 +432,17 @@ pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> {
418432/// Set a particular set of user registers, as with `ptrace(PTRACE_SETREGSET, ...)`
419433#[ cfg( all(
420434 target_os = "linux" ,
421- target_env = "gnu" ,
422435 any(
423- target_arch = "x86_64" ,
424- target_arch = "x86" ,
425- target_arch = "aarch64" ,
426- target_arch = "riscv64" ,
436+ all(
437+ target_env = "gnu" ,
438+ any(
439+ target_arch = "x86_64" ,
440+ target_arch = "x86" ,
441+ target_arch = "aarch64" ,
442+ target_arch = "riscv64"
443+ )
444+ ) ,
445+ all( target_env = "musl" , target_arch = "aarch64" )
427446 )
428447) ) ]
429448pub fn setregset < S : RegisterSet > ( pid : Pid , mut regs : S :: Regs ) -> Result < ( ) > {
0 commit comments