PUBLIC int do_trace()
{
register struct mproc *child;
+ int r;
/* the T_OK call is made by the child fork of the debugger before it execs
* the process to be traced
child->mp_flags &= ~STOPPED;
break;
}
- if (sys_trace(m_in.request,(int)(child-mproc),m_in.taddr,&m_in.data) != OK)
- return(-errno);
+ r= sys_trace(m_in.request,child->mp_endpoint,m_in.taddr,&m_in.data);
+ if (r != OK) return(r);
+
mp->mp_reply.reply_trace = m_in.data;
return(OK);
}
}
/*===========================================================================*
- * stop_proc *
+ * stop_proc *
*===========================================================================*/
PUBLIC void stop_proc(rmp, signo)
register struct mproc *rmp;
/* A traced process got a signal so stop it. */
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;
if (rpmp->mp_flags & WAITING) {
rpmp->mp_flags &= ~WAITING; /* parent is no longer waiting */