Resume the process that's associated with the file descriptor, if it has previously been stopped.
#include <sys/procfs.h> #define DCMD_PROC_RUN32 (__DIOT(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 9, procfs_run32)) #define DCMD_PROC_RUN64 (__DIOT(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 9, procfs_run64)) #define DCMD_PROC_RUN (__DIOT(_DCMD_PROC, __PROC_SUBCMD_PROCFS + 9, procfs_run))
The arguments to devctl() are:
Argument | Value |
---|---|
filedes | A file descriptor for the process. You must have opened the file descriptor for writing. |
dcmd | DCMD_PROC_RUN |
dev_data_ptr | A pointer to a procfs_run structure |
n_bytes | sizeof(procfs_run) |
dev_info_ptr | NULL |
To stop the process, use DCMD_PROC_STOP. The DCMD_PROC_RUN command also lets you set the points of interest (e.g., signals or faults you want to stop on) and other run flags (e.g., instruction pointer or single-step).
The argument is a pointer to a procfs_run structure (see debug_run_t in <sys/debug.h>). This structure is passed on as control information to the process before it resumes. For example:
procfs_run run; memset( &run, 0, sizeof(run) ); run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG; devctl( fd, DCMD_PROC_RUN, &run, sizeof(run), NULL);
The procfs_run or debug_run_t structure is defined for 64-bit architectures as follows:
typedef struct _debug_run64 { uint32_t flags; pthread_t tid; sigset_t trace; sigset_t hold; fltset_t fault; uintptr32_t __ip; uintptr64_t ip; } debug_run_t;
The members include:
Use sigemptyset() and sigaddset() to build the set of signals or faults for the trace, hold and fault members.