Get a list of the active breakpoints for the process associated with the file descriptor. You must have opened the file descriptor for writing.

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.