Home | History | Annotate | Download | only in strace

Lines Matching refs:pid

622  * move `len' bytes of data from process `pid'
634 int pid = tcp->pid;
647 u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
663 u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
680 int pid = tcp->pid;
693 u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
703 u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
717 if (ptrace(PTRACE_READDATA, pid,
786 int pid = tcp->pid;
798 pid, (char *)addr, 0);
816 u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0);
847 uload(cmd, pid, addr, len, laddr)
849 int pid;
860 if (ptrace(cmd, pid, (char *)addr, n, laddr) < 0) {
889 u.val = ptrace(peek, pid, (char *) addr, 0);
895 if (ptrace(poke, pid, (char *)addr, u.val) < 0) {
903 u.val = ptrace(peek, pid, (char *) addr, 0);
905 if (ptrace(poke, pid, (char *) addr, u.val) < 0) {
916 tload(pid, addr, len, laddr)
917 int pid;
921 return uload(PTRACE_WRITETEXT, pid, addr, len, laddr);
925 dload(pid, addr, len, laddr)
926 int pid;
931 return uload(PTRACE_WRITEDATA, pid, addr, len, laddr);
939 upeek(pid, off, res)
940 int pid;
971 val = ptrace(PTRACE_PEEKUSER, pid, (char *) off, 0);
974 sprintf(buf,"upeek: ptrace(PTRACE_PEEKUSER,%d,%lu,0)",pid,off);
993 if (upeek(tcp->pid, 4*EIP, &pc) < 0)
996 if (upeek(tcp->pid, 8*RIP, &pc) < 0)
999 if (upeek(tcp->pid, PT_B0, &pc) < 0)
1002 if (upeek(tcp->pid, 4*15, &pc) < 0)
1005 if (upeek(tcp->pid, sizeof(unsigned long)*PT_NIP, &pc) < 0)
1008 if (upeek(tcp->pid, 4*PT_PC, &pc) < 0)
1011 if (upeek(tcp->pid, REG_PC, &pc) < 0)
1014 if (upeek(tcp->pid, REG_EPC, &pc) < 0)
1018 if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0)
1022 if(upeek(tcp->pid,PT_PSWADDR,&pc) < 0)
1025 if(upeek(tcp->pid,PT_IAOQ0,&pc) < 0)
1028 if (upeek(tcp->pid, 4*REG_PC ,&pc) < 0)
1031 if (upeek(tcp->pid, REG_PC ,&pc) < 0)
1039 * Return current program counter for `pid'
1044 if (ptrace(PTRACE_GETREGS, tcp->pid, (char *) &regs, 0) < 0) {
1076 if (upeek(tcp->pid, 4*EIP, &eip) < 0) {
1084 if(upeek(tcp->pid,PT_PSWADDR,&psw) < 0) {
1097 if (upeek(tcp->pid, 8*RIP, &rip) < 0) {
1105 if (upeek(tcp->pid, PT_B0, &ip) < 0) {
1113 if (upeek(tcp->pid, sizeof(unsigned long)*PT_NIP, &pc) < 0) {
1121 if (upeek(tcp->pid, 4*PT_PC, &pc) < 0) {
1129 if (upeek(tcp->pid, REG_PC, &pc) < 0) {
1136 if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0) {
1144 if(upeek(tcp->pid,PT_IAOQ0,&pc) < 0) {
1152 if (upeek(tcp->pid, REG_EPC, &pc) < 0) {
1160 if (upeek(tcp->pid, 4*REG_PC, &pc) < 0) {
1168 if (upeek(tcp->pid, REG_PC, &pc) < 0) {
1176 if (upeek(tcp->pid, 4*15, &pc) < 0) {
1187 if (ptrace(PTRACE_GETREGS, tcp->pid, (char *) &regs, 0) < 0) {
1236 if (upeek(tcp->pid, PT_AR_BSP, (long *) &bsp) < 0)
1238 if (upeek(tcp->pid, PT_CFM, (long *) &cfm) < 0)
1258 ret = upeek (tcp->pid, PT_R11, valp);
1272 ret = upeek (tcp->pid, PT_R9, valp);
1293 ptrace(req, tcp->pid, ap, val);
1309 ptrace(req, tcp->pid, ap, val);
1318 (ptrace (PTRACE_GETREGS, tcp->pid, (char *) (state), 0))
1320 (ptrace (PTRACE_SETREGS, tcp->pid, (char *) (state), 0))
1375 (upeek ((tcp)->pid, arg0_offset, (valp)))
1377 (upeek ((tcp)->pid, arg1_offset, (valp)))
1382 return ptrace (PTRACE_POKEUSER, tcp->pid, (char*)arg0_offset, val);
1388 return ptrace (PTRACE_POKEUSER, tcp->pid, (char*)arg1_offset, val);
1413 fprintf(stderr, "PANIC: TCB already set in pid %u\n", tcp->pid);
1456 tcp->scno, tcp->pid);
1493 fprintf(stderr, "PANIC: TCB already set in pid %u\n", tcp->pid);
1496 if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
1502 tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)tcp->baddr, 0);
1524 ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, inst);
1536 fprintf(stderr, "PANIC: bpt already set in pid %u\n",
1537 tcp->pid);
1540 if (upeek(tcp->pid, PT_CR_IIP, &tcp->baddr) < 0)
1544 tcp->pid, tcp->baddr);
1545 tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, tcp->pid,
1551 ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, LOOP);
1571 pid_t pid;
1573 pid = tcp->pid;
1574 if (upeek(pid, PT_CR_IPSR, &ipsr) < 0)
1576 if (upeek(pid, PT_CR_IIP, &addr) < 0)
1582 tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, pid, (char *) addr + 0,
1584 tcp->inst[1] = ptrace(PTRACE_PEEKTEXT, pid, (char *) addr + 8,
1592 ptrace(PTRACE_POKETEXT, pid, (char *) addr + 0, LOOP0);
1593 ptrace(PTRACE_POKETEXT, pid, (char *) addr + 8, LOOP1);
1631 fprintf(stderr, "PANIC: bpt already set in pid %u\n", tcp->pid);
1635 if (upeek(tcp->pid, 4*EIP, &tcp->baddr) < 0)
1638 if (upeek(tcp->pid, 8*RIP, &tcp->baddr) < 0)
1641 if (upeek(tcp->pid, 4*PT_PC, &tcp->baddr) < 0)
1650 if (upeek(tcp->pid, sizeof(unsigned long)*PT_NIP, &tcp->baddr) < 0)
1653 if (upeek(tcp->pid,PT_PSWADDR, &tcp->baddr) < 0)
1656 if (upeek(tcp->pid, PT_IAOQ0, &tcp->baddr) < 0)
1660 if (upeek(tcp->pid, 4*REG_PC, &tcp->baddr) < 0)
1666 fprintf(stderr, "[%d] setting bpt at %lx\n", tcp->pid, tcp->baddr);
1667 tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *) tcp->baddr, 0);
1672 ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, LOOP);
1698 fprintf(stderr, "PANIC: TCB already set in pid %u\n", tcp->pid);
1701 if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
1706 if (ptrace(PTRACE_READTEXT, tcp->pid, (char *)tcp->baddr,
1722 if (ptrace(PTRACE_WRITETEXT, tcp->pid, (char *) tcp->baddr,
1758 fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
1762 ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, tcp->inst[0]);
1773 fprintf(stderr, "[%d] clearing bpt\n", tcp->pid);
1775 fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
1779 ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, tcp->inst[0]);
1786 if (upeek(tcp->pid, PT_CR_IIP, &addr) < 0)
1798 pid_t pid;
1800 pid = tcp->pid;
1802 if (upeek(pid, PT_CR_IPSR, &ipsr) < 0)
1804 if (upeek(pid, PT_CR_IIP, &addr) < 0)
1809 ptrace(PTRACE_POKETEXT, pid, (char *) addr + 0, tcp->inst[0]);
1810 ptrace(PTRACE_POKETEXT, pid, (char *) addr + 8, tcp->inst[1]);
1819 ptrace(PTRACE_POKEUSER, pid, (char *) PT_CR_IPSR, ipsr);
1838 fprintf(stderr, "[%d] clearing bpt\n", tcp->pid);
1840 fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
1844 ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, tcp->inst[0]);
1852 if (upeek(tcp->pid, 4*EIP, &eip) < 0)
1863 if (upeek(tcp->pid, 8*RIP, &eip) < 0)
1874 if (upeek(tcp->pid, sizeof(unsigned long)*PT_NIP, &pc) < 0)
1884 if (upeek(tcp->pid, 4*PT_PC, &pc) < 0)
1894 if (upeek(tcp->pid, REG_PC, &pc) < 0)
1904 if (upeek(tcp->pid, PT_IAOQ0, &iaoq) < 0)
1919 ptrace(PTRACE_POKEUSER, tcp->pid, (void *)PT_IAOQ0, iaoq);
1920 ptrace(PTRACE_POKEUSER, tcp->pid, (void *)PT_IAOQ1, iaoq);
1922 if (upeek(tcp->pid, 4*REG_PC, &pc) < 0)
1944 fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
1947 if (ptrace(PTRACE_WRITETEXT, tcp->pid, (char *) tcp->baddr,
1959 if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
1978 if (ptrace(PTRACE_SETREGS, tcp->pid, (char *)&regs, 0) < 0) {
1996 getex(pid, hdr)
1997 int pid;
2004 if (upeek(pid, uoff(u_exdata) + n, &res) < 0)
2021 int pid = tcp->pid;
2032 if (getex(pid, &hdr) < 0)
2074 if (tload(pid, (int)ld.ld_symbols+(int)N_TXTADDR(hdr),