Several of the devctl() commands use a procfs_status structure (which is the same as debug_thread_t), so let's look at this structure before going into the commands themselves.
The debug_thread_t structure is defined for 64-bit architectures as follows in <sys/debug.h>:
#define BLOCKED_CONNECT_FLAGS_SERVERMON 0x01u
typedef struct _debug_thread_info64 {
pid_t pid;
pthread_t tid;
uint32_t flags;
uint16_t why;
uint16_t what;
uint64_t ip;
uint64_t sp;
uint64_t stkbase;
uint64_t tls;
uint32_t stksize;
uint32_t tid_flags;
uint8_t priority;
uint8_t real_priority;
uint8_t policy;
uint8_t state;
int16_t syscall;
uint16_t last_cpu;
uint32_t timeout;
int32_t last_chid;
sigset_t sig_blocked;
sigset_t sig_pending;
__siginfo32_t __info32;
union {
struct {
pthread_t tid;
} join;
struct {
intptr64_t id;
uintptr64_t sync;
} sync;
struct {
uint32_t nd;
pid_t pid;
int32_t coid;
int32_t chid;
int32_t scoid;
uint32_t flags;
} connect;
struct {
int32_t chid;
} channel;
struct {
pid_t pid;
uint32_t flags;
uintptr64_t vaddr;
} waitpage;
struct {
size64_t size;
} stack;
struct {
pthread_t tid;
} thread_event;
struct {
pid_t child;
} fork_event;
uint64_t filler[4];
} blocked;
uint64_t start_time;
uint64_t sutime;
uint8_t extsched[8];
uint64_t nsec_since_block;
union {
__siginfo32_t info32;
__siginfo64_t info64;
siginfo_t info;
};
uint64_t reserved2[4];
} debug_thread64_t;
The members include:
| why | Description | what |
|---|---|---|
| _DEBUG_WHY_CHILD | A child process is ready to run; the parent gets a chance to connect to it | The child's process ID |
| _DEBUG_WHY_EXEC | The process was created by a call to an exec*() function | 0 |
| _DEBUG_WHY_FAULTED | The thread faulted | The fault number; see siginfo_t |
| _DEBUG_WHY_JOBCONTROL | The thread is under job control | The signal number |
| _DEBUG_WHY_REQUESTED | The thread was working normally before being stopped by request | 0 |
| _DEBUG_WHY_SIGNALLED | The thread received a signal | The signal number |
| _DEBUG_WHY_TERMINATED | The thread terminated | The process's exit status |
| _DEBUG_WHY_THREAD | (QNX Neutrino 6.6 or later) A thread was created or destroyed | The thread ID |