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 Adapt s...
details: https://anonhg.NetBSD.org/src/rev/a21f20d3747b
branches: trunk
changeset: 938547:a21f20d3747b
user: kamil <kamil%NetBSD.org@localhost>
date: Fri Sep 11 01:07:00 2020 +0000
description:
Adapt stop-the-world for ptrace changes in NetBSD-9.99.30
Cherry-pick and adapt:
commit fc356dcc11c10003ff22acff667b0a9f5e6c1e0f
Author: Kamil Rytarowski <n54%gmx.com@localhost>
Date: Tue Dec 24 20:33:54 2019 +0100
[compiler-rt] Adapt stop-the-world for ptrace changes in NetBSD-9.99.30
Handle PT_LWPNEXT for newer kernels and keep PT_LWPINFO for older ones.
diffstat:
external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc | 12 ++++++++-
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (24 lines):
diff -r e4172be6a9ea -r a21f20d3747b external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc Fri Sep 11 01:05:28 2020 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc Fri Sep 11 01:07:00 2020 +0000
@@ -120,10 +120,18 @@
VReport(2, "Attached to process %d.\n", pid_);
+#ifdef PT_LWPNEXT
+ struct ptrace_lwpstatus pl;
+ int op = PT_LWPNEXT;
+#else
struct ptrace_lwpinfo pl;
+ int op = PT_LWPINFO;
+#endif
+
+ pl.pl_lwpid = 0;
+
int val;
- pl.pl_lwpid = 0;
- while ((val = ptrace(PT_LWPINFO, pid_, (void *)&pl, sizeof(pl))) != -1 &&
+ while ((val = ptrace(op, pid_, (void *)&pl, sizeof(pl))) != -1 &&
pl.pl_lwpid != 0) {
suspended_threads_list_.Append(pl.pl_lwpid);
VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);
Home |
Main Index |
Thread Index |
Old Index