Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

librtld_db(3) [freebsd man page]

LIBRTLD_DB(3)						   BSD Library Functions Manual 					     LIBRTLD_DB(3)

NAME
librtld_db -- library for run-time linker debugging LIBRARY
library ``librtld_db'' SYNOPSIS
#include <rtld_db.h> void rd_delete(rd_agent_t *rdap); char * rd_errstr(rd_err_e rderr); rd_err_e rd_event_addr(rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify); rd_err_e rd_event_enable(rd_agent_t *rdap, int onoff); rd_err_e rd_event_getmsg(rd_agent_t *rdap, rd_event_msg_t *msg); rd_err_e rd_init(int version); typedef int rl_iter_f(const rd_loadobj_t *, void *); rd_err_e rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data); void rd_log(const int onoff); rd_agent_t * rd_new(struct proc_handle *php); rd_err_e rd_objpad_enable(rd_agent_t *rdap, size_t padsize); rd_err_e rd_plt_resolution(rd_agent_t *rdap, uintptr_t pc, struct proc *proc, uintptr_t plt_base, rd_plt_info_t *rpi); rd_err_e rd_reset(rd_agent_t *rdap); DESCRIPTION
The librtld_db library provides a debugging interface to the run-time linker (rtld). This library must be used along with libproc(3). Most library functions take a rd_agent_t argument. This argument is an opaque structure containing information associated with the current status of the agent. Before you start using librtld_db you should call rd_init() with the RD_VERSION argument. This initializes the library to the correct ver- sion your program was compiled with and provides proper ABI stability. What follows is a description of what each function. rd_new() creates a new librtld_db agent. The php argument should be the proc_handle you received from libproc(3). rd_reset() resets your previously created agent. rd_delete() deallocates the resources associated with the agent. rd_errstr() returns an error string describing the error present in rderr. rd_event_enable() enables reporting of events. This function always returns RD_OK. rd_event_addr() returns the event address corresponding to the event parameter. At the moment we only report events of type RD_NOTIFY_BPT. rd_event_getmsg() returns the message associated with the latest event. At the moment only RD_POSTINIT events are supported. rd_loadobj_iter() allows you to iterate over the program's loaded objects. cb is a callback of type rl_iter_f(). RETURN VALUES
Most functions return an rd_err_e type error. The error codes are described in the header file for this library. You can get the error string using rd_errstr(). SEE ALSO
ld(1), ld-elf.so.1(1), ld.so(1), rtld(1), libproc(3) HISTORY
The librtld_db library first appeared in FreeBSD 9.0 and was modeled after the same library present in the Solaris operating system. AUTHORS
The librtld_db library and this manual page were written by Rui Paulo <rpaulo@FreeBSD.org> under sponsorship from the FreeBSD Foundation. CAVEATS
The functions rd_event_enable(), rd_log(), rd_objpad_enable() and rd_plt_resolution() are not yet implemented. BSD
June 10, 2010 BSD

Check Out this Related Man Page

rtld_db(3EXT)						    Extended Library Functions						     rtld_db(3EXT)

NAME
rtld_db, rd_delete, rd_errstr, rd_event_addr, rd_event_enable, rd_event_getmsg, rd_init, rd_loadobj_iter, rd_log, rd_new, rd_objpad_enable, rd_plt_resolution, rd_reset - runtime linker debugging functions SYNOPSIS
cc [ flag ... ] file ... -lrtld_db [ library ... ] #include <proc_service.h> #include <rtld_db.h> void rd_delete(struct rd_agent *rdap); char *rd_errstr(rd_err_e rderr); rd_err_e rd_event_addr(rd_agent *rdap, rd_notify_t *notify); rd_err_e rd_event_enable(struct rd_agent *rdap, int onoff); rd_err_e rd_event_getmsg(struct rd_agent *rdap, rd_event_msg_t *msg); rd_err_e rd_init(int version); typedef int rl_iter_f(const rd_loadobj_t *, void *); rd_err_e rd_loadobj_iter(rd_agent_t *rap, rl_iter_f *cb, void *clnt_data); void rd_log(const int onoff); rd_agent_t *rd_new(struct ps_prochandle *php); rd_err_e rd_objpad_enable(struct rd_agent *rdap, size_t padsize); rd_err_e rd_plt_resolution(rd_agent *rdap, paddr_t pc, lwpid_t lwpid, paddr_t plt_base, rd_plt_info_t *rpi); rd_err_e rd_reset(struct rd_agent *rdap); DESCRIPTION
The librtld_db library provides support for monitoring and manipulating runtime linking aspects of a program. There are at least two pro- cesses involved, the controlling process and one or more target processes. The controlling process is the librtld_db client that links with librtld_db and uses librtld_db to inspect or modify runtime linking aspects of one or more target processes. See the Linker and Libraries Guide for a full description of the runtime linker debugger interface mechanism. ATTRIBUTES
See attributes(5) for description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
ld.so.1(1), libc_db(3LIB), librtld_db(3LIB), attributes(5) Linker and Libraries Guide SunOS 5.10 19 Apr 2002 rtld_db(3EXT)
Man Page