Get a list of the active breakpoints for the process associated with the file descriptor.

#include <sys/procfs.h>


The arguments to devctl() are:

Argument Value
filedes A file descriptor for the process. You must have opened the file descriptor for writing.
dev_data_ptr NULL, or an array of procfs_break structures
n_bytes 0, or the size of the array
dev_info_ptr A pointer to an integer where the number of breakpoints can be stored

Call this the first time with an argument of NULL to get the number of breakpoints:

devctl( fd, DCMD_PROC_GET_BREAKLIST, NULL, 0, &n);

The total number of breakpoints returned is provided as the extra field. Next, allocate a buffer that's large enough to hold a procfs_break structure (see debug_break_t in <sys/debug.h>) for each breakpoint, and pass it to another devctl() call:

my_buffer = (procfs_break *) malloc( sizeof(procfs_break) * n );
if ( my_buffer == NULL ) {
  /* Not enough memory. */
devctl( fd, DCMD_PROC_GET_BREAKLIST, my_buffer,
        sizeof(procfs_break) * n, &dummy);  

To set or clear breakpoints, use DCMD_PROC_BREAK.