Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61749a12 authored by Sijie Chen's avatar Sijie Chen Committed by Automerger Merge Worker
Browse files

Merge "[Berberis][CrashReporting] Add riscv case for thread local retrieve"...

Merge "[Berberis][CrashReporting] Add riscv case for thread local retrieve" into main am: f11349ef

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3097682



Change-Id: I29caab646074e2fd3cd0c34af9f026065e56b0dc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1e4cf5be f11349ef
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -449,7 +449,16 @@ static bool GetGuestRegistersFromCrashedProcess([[maybe_unused]] pid_t tid,

  if (ptrace(PTRACE_GETREGSET, tid, NT_ARM_TLS, &pt_iov) != 0) {
    PLOG(ERROR) << "failed to read thread register for thread " << tid;
    return false;
  }
#elif defined(__riscv)
  struct user_regs_struct regs;
  struct iovec pt_iov = {.iov_base = &regs, .iov_len = sizeof(regs)};
  if (ptrace(PTRACE_GETREGSET, tid, NT_PRSTATUS, &pt_iov) != 0) {
    PLOG(ERROR) << "failed to read thread register for thread " << tid;
    return false;
  }
  base = reinterpret_cast<uintptr_t>(regs.tp);
#else
  // TODO(b/339287219): Add case for Riscv host.
  return false;