Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167550803
D49430.id152552.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
D49430.id152552.diff
View Options
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -343,6 +343,13 @@
* the postsig() loop was performed.
*/
sigfastblock_setpend(td, resched_sigs);
+
+ /*
+ * Clear td_sa.code: this AST handler is run when the process
+ * is traced, and it is run with the last ptracestop() points
+ * before the return to userspace.
+ */
+ td->td_sa.code = 0;
}
static void
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
@@ -1168,7 +1168,8 @@
case PT_GET_SC_ARGS:
CTR1(KTR_PTRACE, "PT_GET_SC_ARGS: pid %d", p->p_pid);
- if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0
+ if (((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 &&
+ td2->td_sa.code == 0)
#ifdef COMPAT_FREEBSD32
|| (wrap32 && !safe)
#endif
@@ -1511,13 +1512,8 @@
pl->pl_sigmask = td2->td_sigmask;
pl->pl_siglist = td2->td_siglist;
strcpy(pl->pl_tdname, td2->td_name);
- if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) {
- pl->pl_syscall_code = td2->td_sa.code;
- pl->pl_syscall_narg = td2->td_sa.callp->sy_narg;
- } else {
- pl->pl_syscall_code = 0;
- pl->pl_syscall_narg = 0;
- }
+ pl->pl_syscall_code = td2->td_sa.code;
+ pl->pl_syscall_narg = td2->td_sa.callp->sy_narg;
CTR6(KTR_PTRACE,
"PT_LWPINFO: tid %d (pid %d) event %d flags %#x child pid %d syscall %d",
td2->td_tid, p->p_pid, pl->pl_event, pl->pl_flags,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 23, 3:26 PM (14 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37148895
Default Alt Text
D49430.id152552.diff (1 KB)
Attached To
Mode
D49430: ptrace(2): expand ability to fetch syscall parameters
Attached
Detach File
Event Timeline
Log In to Comment