madscientist / google-coredumper

Google coredumper library
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

Elfcore getcontext #7

Closed achichinov closed 2 years ago

achichinov commented 2 years ago

Add support for arm64-linux

  1. Added preprocessor conditions for aarch64
  2. Copied the GP and FP registers structures from glibc.
  3. Defined FRAME ans SET_FRAME macros FRAME is defined via getcontext() function. It is simpler than using asm.
  4. In CreateElfCore() skip [vvar] memory segment. A process fails to read this segment. On x86_64 [vvar] is disabled for core dump, but on ARM64 it is not. It is the only segment that is marked as "pure PFN range" on the both architectures.
  5. Make stack pointer 16-byte aligned in local_clone() on all architectures.
  6. Add a separate ifdef section to read registers using PTRACE_GETREGSET. PTRACE_GETREGS and PTRACE_GETFPREGS are not supported on arm64-linux
achichinov commented 2 years ago

Oops, I planned to merge it to mine master branch first. I will create new PR.