1 PSETBKPT(3PROC) Process Control Library Functions PSETBKPT(3PROC) 2 3 NAME 4 Psetbkpt - set a breakpoint trap in a process 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 int 13 Psetbkpt(struct ps_prochandle *P, uintptr_t address, ulong_t *saved); 14 15 DESCRIPTION 16 The Psetbkpt() function sets a breakpoint instruction at the address 17 address in the process handle P. The instruction that used to be set 18 will be set in saved and should be retained. 19 20 A breakpoint will remain in place until a subsequent call to 21 Pdelbkpt(3PROC). The value stored in saved should be passed as the third 22 argument to Pdelbkpt(3PROC). 23 24 When a process executes an instruction that has been replaced with a 25 breakpoint it generates a FLTBPT trap causing the thread to stop. 26 27 Note, breakpoints may only be set in active processes. They may not be 28 set in process handles that refer to core files, zombie processes, or 29 files. 30 31 RETURN VALUES 32 Upon successful completion, the Psetbkpt() function sets the breakpoint 33 and returns 0. Otherwise, -1 is returned and errno is set to indicate 34 the error. 35 36 ERRORS 37 For a full list of possible errors see the DIAGNOSTICS section in 38 proc(4). 39 40 The Psetbkpt() function will fail if: 41 42 ENOENT P does not refer to an active process. 43 44 EBUSY A breakpoint instruction was already written by 45 another debugger. 46 47 INTERFACE STABILITY 48 Uncommitted 49 50 MT-LEVEL 51 See LOCKING in libproc(3LIB). 52 53 SEE ALSO 54 libproc(3LIB), Pdelbkpt(3PROC), proc(4) 55 56 illumos May 11, 2016 illumos