< prev index next >

agent/src/os/linux/ps_proc.c

Print this page
rev 8073 : 8078521: AARCH64: Add AArch64 SA support
Reviewed-by: kvn

@@ -36,10 +36,15 @@
 
 #if defined(x86_64) && !defined(amd64)
 #define amd64 1
 #endif
 
+#ifdef aarch64
+#include <sys/uio.h>   // For struct iovec
+#include <elf.h>
+#endif
+
 #ifndef __WALL
 #define __WALL          0x40000000  // Copied from /usr/include/linux/wait.h
 #endif
 
 // This file has the libproc implementation specific to live process

@@ -147,10 +152,21 @@
  if (ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, (void*) &iov) < 0) {
    print_debug("ptrace(PTRACE_GETREGSET, ...) failed for lwp %d\n", pid);
    return false;
  }
  return true;
+#elif defined(aarch64)
+ {
+   struct iovec iovec;
+   iovec.iov_base = user;
+   iovec.iov_len = sizeof (struct user_regs_struct);
+   if (ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &iovec) < 0) {
+     print_debug("ptrace(PTRACE_GETREGSET, ...) failed for lwp %d\n", pid);
+     return false;
+   }
+   return true;
+ }
 #else
  print_debug("ptrace(PTRACE_GETREGS, ...) not supported\n");
  return false;
 #endif
 
< prev index next >