PSETBKPT(3PROC) Process Control Library Functions PSETBKPT(3PROC)

Psetbkptset a breakpoint trap in a process

Process Control Library (libproc, -lproc)

#include <libproc.h>

Psetbkpt(struct ps_prochandle *P, uintptr_t address, ulong_t *saved);

The () function sets a breakpoint instruction at the address address in the process handle P. The instruction that used to be set will be set in saved and should be retained.

A breakpoint will remain in place until a subsequent call to Pdelbkpt(3PROC). The value stored in saved should be passed as the third argument to Pdelbkpt(3PROC).

When a process executes an instruction that has been replaced with a breakpoint it generates a trap causing the thread to stop.

Note, breakpoints may only be set in active processes. They may not be set in process handles that refer to core files, zombie processes, or files.

Upon successful completion, the Psetbkpt() function sets the breakpoint and returns . Otherwise, is returned and is set to indicate the error.

For a full list of possible errors see the section in proc(5).

The Psetbkpt() function will fail if:

P does not refer to an active process.
A breakpoint instruction was already written by another debugger.

See in libproc(3LIB).

libproc(3LIB), Pdelbkpt(3PROC), proc(5)

May 11, 2016 OmniOS