struct ptrace_range pr;
int i, r, req;
- req = m_in.PM_PTRACE_REQ;
+ req = m_in.m_lc_pm_ptrace.req;
/* The T_OK call is made by the child fork of the debugger before it execs
* the process to be traced. The T_ATTACH call is made by the debugger itself
if (mp->mp_tracer != NO_TRACER) return(EBUSY);
mp->mp_tracer = mp->mp_parent;
- mp->mp_reply.PM_PTRACE_DATA = 0;
+ mp->mp_reply.m_pm_lc_ptrace.data = 0;
return(OK);
case T_ATTACH: /* attach to an existing process */
- if ((child = find_proc(m_in.PM_PTRACE_PID)) == NULL) return(ESRCH);
+ if ((child = find_proc(m_in.m_lc_pm_ptrace.pid)) == NULL) return(ESRCH);
if (child->mp_flags & EXITING) return(ESRCH);
/* For non-root processes, user and group ID must match. */
sig_proc(child, SIGSTOP, TRUE /*trace*/, FALSE /* ksig */);
- mp->mp_reply.PM_PTRACE_DATA = 0;
+ mp->mp_reply.m_pm_lc_ptrace.data = 0;
return(OK);
case T_STOP: /* stop the process */
case T_READB_INS: /* special hack for reading text segments */
if (mp->mp_effuid != SUPER_USER) return(EPERM);
- if ((child = find_proc(m_in.PM_PTRACE_PID)) == NULL) return(ESRCH);
+ if ((child = find_proc(m_in.m_lc_pm_ptrace.pid)) == NULL) return(ESRCH);
if (child->mp_flags & EXITING) return(ESRCH);
- r = sys_trace(req, child->mp_endpoint, m_in.PM_PTRACE_ADDR,
- &m_in.PM_PTRACE_DATA);
+ r = sys_trace(req, child->mp_endpoint, m_in.m_lc_pm_ptrace.addr,
+ &m_in.m_lc_pm_ptrace.data);
if (r != OK) return(r);
- mp->mp_reply.PM_PTRACE_DATA = m_in.PM_PTRACE_DATA;
+ mp->mp_reply.m_pm_lc_ptrace.data = m_in.m_lc_pm_ptrace.data;
return(OK);
case T_WRITEB_INS: /* special hack for patching text segments */
if (mp->mp_effuid != SUPER_USER) return(EPERM);
- if ((child = find_proc(m_in.PM_PTRACE_PID)) == NULL) return(ESRCH);
+ if ((child = find_proc(m_in.m_lc_pm_ptrace.pid)) == NULL) return(ESRCH);
if (child->mp_flags & EXITING) return(ESRCH);
#if 0
child->mp_ctime = 0;
#endif
- r = sys_trace(req, child->mp_endpoint, m_in.PM_PTRACE_ADDR,
- &m_in.PM_PTRACE_DATA);
+ r = sys_trace(req, child->mp_endpoint, m_in.m_lc_pm_ptrace.addr,
+ &m_in.m_lc_pm_ptrace.data);
if (r != OK) return(r);
- mp->mp_reply.PM_PTRACE_DATA = m_in.PM_PTRACE_DATA;
+ mp->mp_reply.m_pm_lc_ptrace.data = m_in.m_lc_pm_ptrace.data;
return(OK);
}
/* All the other calls are made by the tracing process to control execution
* of the child. For all these calls, the child must be stopped.
*/
- if ((child = find_proc(m_in.PM_PTRACE_PID)) == NULL) return(ESRCH);
+ if ((child = find_proc(m_in.m_lc_pm_ptrace.pid)) == NULL) return(ESRCH);
if (child->mp_flags & EXITING) return(ESRCH);
if (child->mp_tracer != who_p) return(ESRCH);
if (!(child->mp_flags & TRACE_STOPPED)) return(EBUSY);
/* Defer the exit if the traced process has an VFS call pending. */
if (child->mp_flags & VFS_CALL)
- child->mp_exitstatus = (int) m_in.PM_PTRACE_DATA; /* save it */
+ child->mp_exitstatus = m_in.m_lc_pm_ptrace.data; /* save it */
else
- exit_proc(child, (int) m_in.PM_PTRACE_DATA,
+ exit_proc(child, m_in.m_lc_pm_ptrace.data,
FALSE /*dump_core*/);
/* Do not reply to the caller until VFS has processed the exit
return(SUSPEND);
case T_SETOPT: /* set trace options */
- child->mp_trace_flags = m_in.PM_PTRACE_DATA;
+ child->mp_trace_flags = m_in.m_lc_pm_ptrace.data;
- mp->mp_reply.PM_PTRACE_DATA = 0;
+ mp->mp_reply.m_pm_lc_ptrace.data = 0;
return(OK);
case T_GETRANGE:
case T_SETRANGE: /* get/set range of values */
- r = sys_datacopy(who_e, (vir_bytes) m_in.PM_PTRACE_ADDR,
- SELF, (vir_bytes) &pr, (phys_bytes) sizeof(pr));
+ r = sys_datacopy(who_e, m_in.m_lc_pm_ptrace.addr, SELF, (vir_bytes)&pr,
+ (phys_bytes)sizeof(pr));
if (r != OK) return(r);
if (pr.pr_space != TS_INS && pr.pr_space != TS_DATA) return(EINVAL);
if (r != OK) return(r);
- mp->mp_reply.PM_PTRACE_DATA = 0;
+ mp->mp_reply.m_pm_lc_ptrace.data = 0;
return(OK);
case T_DETACH: /* detach from traced process */
- if (m_in.PM_PTRACE_DATA < 0 || m_in.PM_PTRACE_DATA >= _NSIG)
+ if (m_in.m_lc_pm_ptrace.data < 0 || m_in.m_lc_pm_ptrace.data >= _NSIG)
return(EINVAL);
child->mp_tracer = NO_TRACER;
}
}
- if (m_in.PM_PTRACE_DATA > 0) { /* issue signal */
- sig_proc(child, (int) m_in.PM_PTRACE_DATA, TRUE /*trace*/,
+ if (m_in.m_lc_pm_ptrace.data > 0) { /* issue signal */
+ sig_proc(child, m_in.m_lc_pm_ptrace.data, TRUE /*trace*/,
FALSE /* ksig */);
}
case T_RESUME:
case T_STEP:
case T_SYSCALL: /* resume execution */
- if (m_in.PM_PTRACE_DATA < 0 || m_in.PM_PTRACE_DATA >= _NSIG)
+ if (m_in.m_lc_pm_ptrace.data < 0 || m_in.m_lc_pm_ptrace.data >= _NSIG)
return(EINVAL);
- if (m_in.PM_PTRACE_DATA > 0) { /* issue signal */
- sig_proc(child, (int) m_in.PM_PTRACE_DATA, FALSE /*trace*/,
+ if (m_in.m_lc_pm_ptrace.data > 0) { /* issue signal */
+ sig_proc(child, m_in.m_lc_pm_ptrace.data, FALSE /*trace*/,
FALSE /* ksig */);
}
*/
for (i = 1; i < _NSIG; i++) {
if (sigismember(&child->mp_sigtrace, i)) {
- mp->mp_reply.PM_PTRACE_DATA = 0;
+ mp->mp_reply.m_pm_lc_ptrace.data = 0;
return(OK);
}
}
break;
}
- r = sys_trace(req, child->mp_endpoint, m_in.PM_PTRACE_ADDR,
- &m_in.PM_PTRACE_DATA);
+ r = sys_trace(req, child->mp_endpoint, m_in.m_lc_pm_ptrace.addr,
+ &m_in.m_lc_pm_ptrace.data);
if (r != OK) return(r);
- mp->mp_reply.PM_PTRACE_DATA = m_in.PM_PTRACE_DATA;
+ mp->mp_reply.m_pm_lc_ptrace.data = m_in.m_lc_pm_ptrace.data;
return(OK);
}