Pass endpoint to sys_trace instead of slot number.
This commit is contained in:
parent
55bdde85f0
commit
57ed4b2bf7
|
@ -37,6 +37,7 @@ FORWARD _PROTOTYPE( struct mproc *find_proc, (pid_t lpid) );
|
||||||
PUBLIC int do_trace()
|
PUBLIC int do_trace()
|
||||||
{
|
{
|
||||||
register struct mproc *child;
|
register struct mproc *child;
|
||||||
|
int r;
|
||||||
|
|
||||||
/* the T_OK call is made by the child fork of the debugger before it execs
|
/* the T_OK call is made by the child fork of the debugger before it execs
|
||||||
* the process to be traced
|
* the process to be traced
|
||||||
|
@ -68,8 +69,9 @@ PUBLIC int do_trace()
|
||||||
child->mp_flags &= ~STOPPED;
|
child->mp_flags &= ~STOPPED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sys_trace(m_in.request,(int)(child-mproc),m_in.taddr,&m_in.data) != OK)
|
r= sys_trace(m_in.request,child->mp_endpoint,m_in.taddr,&m_in.data);
|
||||||
return(-errno);
|
if (r != OK) return(r);
|
||||||
|
|
||||||
mp->mp_reply.reply_trace = m_in.data;
|
mp->mp_reply.reply_trace = m_in.data;
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
@ -88,7 +90,7 @@ pid_t lpid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* stop_proc *
|
* stop_proc *
|
||||||
*===========================================================================*/
|
*===========================================================================*/
|
||||||
PUBLIC void stop_proc(rmp, signo)
|
PUBLIC void stop_proc(rmp, signo)
|
||||||
register struct mproc *rmp;
|
register struct mproc *rmp;
|
||||||
|
@ -97,8 +99,11 @@ int signo;
|
||||||
/* A traced process got a signal so stop it. */
|
/* A traced process got a signal so stop it. */
|
||||||
|
|
||||||
register struct mproc *rpmp = mproc + rmp->mp_parent;
|
register struct mproc *rpmp = mproc + rmp->mp_parent;
|
||||||
|
int r;
|
||||||
|
|
||||||
if (sys_trace(-1, (int) (rmp - mproc), 0L, (long *) 0) != OK) return;
|
r= sys_trace(-1, rmp->mp_endpoint, 0L, (long *) 0);
|
||||||
|
if (r != OK) panic("pm", "sys_trace failed", r);
|
||||||
|
|
||||||
rmp->mp_flags |= STOPPED;
|
rmp->mp_flags |= STOPPED;
|
||||||
if (rpmp->mp_flags & WAITING) {
|
if (rpmp->mp_flags & WAITING) {
|
||||||
rpmp->mp_flags &= ~WAITING; /* parent is no longer waiting */
|
rpmp->mp_flags &= ~WAITING; /* parent is no longer waiting */
|
||||||
|
|
Loading…
Reference in a new issue