7 #include <sys/ptrace.h>
11 * Call ptrace and check for error if debugging running process
12 * Otherwise read 'core' file
14 long mdbtrace(req
, pid
, addr
, data
)
23 if (debug
) Printf("ptrace: req=%d pid=%d addr=%lx data=%lx\n",
24 req
, pid
, addr
, data
);
30 /* Call normal ptrace and check for error */
31 val
= ptrace(req
, pid
, addr
, data
);
33 do_error("mdb ptrace error ");
37 if (debug
) Printf("ptrace: val=>%lx\n", val
);
42 return read_core(req
, addr
, data
);
45 /* Used by disassembler */
46 u32_t
peek_dword(addr
)
49 return mdbtrace(T_GETINS
, curpid
, addr
, 0L);