mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 05:09:43 +00:00
Adjust OpenBSD code to set the process state to be less wrong ##debug
Use the p_stat of the main thread to decide in which state the process is.
For multi-threaded applications this is still not quite correct but at
least this compiles on OpenBSD-current.
See also 290aac5691
This commit is contained in:
parent
f6585839ee
commit
cdf4e18dd0
@ -189,18 +189,20 @@ RDebugInfo *bsd_info(RDebug *dbg, const char *arg) {
|
||||
rdi->gid = kp->p__pgid;
|
||||
rdi->exe = strdup (kp->p_comm);
|
||||
|
||||
rdi->status = R_DBG_PROC_STOP;
|
||||
|
||||
if (kp->p_psflags & PS_ZOMBIE) {
|
||||
rdi->status = R_DBG_PROC_ZOMBIE;
|
||||
} else if (kp->p_psflags & PS_STOPPED) {
|
||||
switch (kp->p_stat) {
|
||||
case SDEAD:
|
||||
rdi->status = R_DBG_PROC_DEAD;
|
||||
break;
|
||||
case SSTOP:
|
||||
rdi->status = R_DBG_PROC_STOP;
|
||||
} else if (kp->p_psflags & PS_PPWAIT) {
|
||||
break;
|
||||
case SSLEEP:
|
||||
rdi->status = R_DBG_PROC_SLEEP;
|
||||
} else if ((kp->p_psflags & PS_EXEC) || (kp->p_psflags & PS_INEXEC)) {
|
||||
break;
|
||||
default:
|
||||
rdi->status = R_DBG_PROC_RUN;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
kvm_close (kd);
|
||||
|
Loading…
Reference in New Issue
Block a user