Home
last modified time | relevance | path

Searched refs:phdl (Results 1 – 7 of 7) sorted by relevance

/freebsd-12-stable/lib/libproc/tests/
Dproc_test.c54 struct proc_handle *phdl; in start_prog() local
68 error = proc_create(argv[0], argv, NULL, NULL, NULL, &phdl); in start_prog()
70 ATF_REQUIRE(phdl != NULL); in start_prog()
75 return (phdl); in start_prog()
79 set_bkpt(struct proc_handle *phdl, uintptr_t addr, u_long *saved) in set_bkpt() argument
83 error = proc_bkptset(phdl, addr, saved); in set_bkpt()
89 remove_bkpt(struct proc_handle *phdl, uintptr_t addr, u_long val) in remove_bkpt() argument
93 error = proc_bkptdel(phdl, addr, val); in remove_bkpt()
97 error = proc_regset(phdl, REG_PC, addr); in remove_bkpt()
105 verify_bkpt(struct proc_handle *phdl, GElf_Sym *sym, const char *symname, in verify_bkpt() argument
[all …]
/freebsd-12-stable/lib/libproc/
Dproc_util.c49 proc_clearflags(struct proc_handle *phdl, int mask) in proc_clearflags() argument
52 if (phdl == NULL) in proc_clearflags()
55 phdl->flags &= ~mask; in proc_clearflags()
64 proc_continue(struct proc_handle *phdl) in proc_continue() argument
68 if (phdl == NULL) in proc_continue()
71 if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) in proc_continue()
72 pending = WSTOPSIG(phdl->wstat); in proc_continue()
75 if (ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)(uintptr_t)1, in proc_continue()
79 phdl->status = PS_RUN; in proc_continue()
85 proc_detach(struct proc_handle *phdl, int reason) in proc_detach() argument
[all …]
Dproc_rtld.c50 struct proc_handle *phdl; in map_iter() local
53 phdl = arg; in map_iter()
54 if (phdl->nmappings >= phdl->maparrsz) { in map_iter()
55 phdl->maparrsz *= 2; in map_iter()
56 tmp = reallocarray(phdl->mappings, phdl->maparrsz, in map_iter()
57 sizeof(*phdl->mappings)); in map_iter()
60 phdl->mappings = tmp; in map_iter()
63 mapping = &phdl->mappings[phdl->nmappings]; in map_iter()
65 if (strcmp(lop->rdl_path, phdl->execpath) == 0 && in map_iter()
67 phdl->exec_map = phdl->nmappings; in map_iter()
[all …]
Dproc_create.c78 struct proc_handle *phdl; in proc_init() local
82 if ((phdl = malloc(sizeof(*phdl))) == NULL) in proc_init()
85 memset(phdl, 0, sizeof(*phdl)); in proc_init()
86 phdl->public.pid = pid; in proc_init()
87 phdl->flags = flags; in proc_init()
88 phdl->status = status; in proc_init()
89 phdl->procstat = procstat_open_sysctl(); in proc_init()
90 if (phdl->procstat == NULL) in proc_init()
94 if ((kp = procstat_getprocs(phdl->procstat, KERN_PROC_PID, pid, in proc_init()
97 error = procstat_getpathname(phdl->procstat, kp, phdl->execpath, in proc_init()
[all …]
Dproc_bkpt.c82 proc_stop(struct proc_handle *phdl) in proc_stop() argument
86 if (kill(proc_getpid(phdl), SIGSTOP) == -1) { in proc_stop()
87 DPRINTF("kill %d", proc_getpid(phdl)); in proc_stop()
89 } else if (waitpid(proc_getpid(phdl), &status, WSTOPPED) == -1) { in proc_stop()
90 DPRINTF("waitpid %d", proc_getpid(phdl)); in proc_stop()
101 proc_bkptset(struct proc_handle *phdl, uintptr_t address, in proc_bkptset() argument
109 if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || in proc_bkptset()
110 phdl->status == PS_IDLE) { in proc_bkptset()
118 if (phdl->status != PS_STOP) { in proc_bkptset()
119 if (proc_stop(phdl) != 0) in proc_bkptset()
[all …]
Dproc_regs.c47 proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue) in proc_regget() argument
51 if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || in proc_regget()
52 phdl->status == PS_IDLE) { in proc_regget()
57 if (ptrace(PT_GETREGS, proc_getpid(phdl), (caddr_t)&regs, 0) < 0) in proc_regget()
103 proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue) in proc_regset() argument
107 if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || in proc_regset()
108 phdl->status == PS_IDLE) { in proc_regset()
112 if (ptrace(PT_GETREGS, proc_getpid(phdl), (caddr_t)&regs, 0) < 0) in proc_regset()
153 if (ptrace(PT_SETREGS, proc_getpid(phdl), (caddr_t)&regs, 0) < 0) in proc_regset()
Dlibproc.h130 #define proc_getpid(phdl) (((struct proc_handle_public *)(phdl))->pid) argument