Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common fix spa...



details:   https://anonhg.NetBSD.org/src/rev/fec036369d5a
branches:  trunk
changeset: 990471:fec036369d5a
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Oct 28 11:22:41 2021 +0000

description:
fix sparc: use mcontext to fetch pc and sp

diffstat:

 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 39dedf4ff554 -r fec036369d5a external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Thu Oct 28 11:13:27 2021 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   Thu Oct 28 11:22:41 2021 +0000
@@ -1930,12 +1930,12 @@
   // From OpenSolaris $SRC/uts/sun4/os/trap.c (get_accesstype).
 # if SANITIZER_SOLARIS
   uptr pc = ucontext->uc_mcontext.gregs[REG_PC];
+# elif SANITIZER_NETBSD
+  uptr pc = ucontext->uc_mcontext.__gregs[_REG_PC];
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)ucontext;
-#  if SANITIZER_NETBSD
-  uptr pc = scontext->sc_pc;
-#  elif defined(__arch64__)
+#  if defined(__arch64__)
   uptr pc = scontext->sigc_regs.tpc;
 #  else
   uptr pc = scontext->si_regs.pc;
@@ -2040,6 +2040,9 @@
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.gregs[REG_PC];
   *sp = ucontext->uc_mcontext.gregs[REG_O6] + STACK_BIAS;
+# elif SANITIZER_NETBSD
+  *pc = ucontext->uc_mcontext.__gregs[REG_PC];
+  *sp = ucontext->uc_mcontext.__gregs[REG_O6] + STACK_BIAS;
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)context;



Home | Main Index | Thread Index | Old Index