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 as follows in <sys/debug.h>:
typedef struct _debug_thread_info {
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;
siginfo_t info;
union {
struct {
pthread_t tid;
} join;
struct {
int32_t id;
uintptr_t sync;
} sync;
struct {
uint32_t nd;
pid_t pid;
int32_t coid;
int32_t chid;
int32_t scoid;
} connect;
struct {
int32_t chid;
} channel;
struct {
pid_t pid;
uintptr_t vaddr;
uint32_t flags;
} waitpage;
struct {
uint32_t size;
} stack;
uint64_t filler[4];
} blocked;
uint64_t start_time;
uint64_t sutime;
uint8_t extsched[8];
uint64_t reserved2[5];
} debug_thread_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 |