Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142067296
D50556.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50556.diff
View Options
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -39,6 +39,7 @@
#include <sys/mman.h>
#include <sys/mutex.h>
#include <sys/reg.h>
+#include <sys/sleepqueue.h>
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
@@ -1346,6 +1347,27 @@
if (data == SIGKILL)
proc_wkilled(p);
+ /*
+ * If the PT_CONTINUE-like operation is attempted on
+ * the thread on sleepq, this is possible only after
+ * the transparent PT_ATTACH. In this case, if the
+ * caller modified the thread state, e.g. by writing
+ * register file or specifying the pc, make the thread
+ * xstopped by waking it up.
+ */
+ if ((td2->td_dbgflags & TDB_USERWR) != 0) {
+ if (pt_attach_transparent) {
+ thread_lock(td2);
+ if (TD_ON_SLEEPQ(td2) &&
+ (td2->td_flags & TDF_SINTR) != 0) {
+ sleepq_abort(td2, EINTR);
+ } else {
+ thread_unlock(td2);
+ }
+ }
+ td2->td_dbgflags &= ~TDB_USERWR;
+ }
+
/*
* Unsuspend all threads. To leave a thread
* suspended, use PT_SUSPEND to suspend it before
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 5:21 PM (18 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27663740
Default Alt Text
D50556.diff (1 KB)
Attached To
Mode
D50556: PT_CONTINUE: undo transparent attach consequences
Attached
Detach File
Event Timeline
Log In to Comment