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

Paddr_to_ctf, Plmid_to_ctf, Pname_to_ctflookup CTF data

Process Control Library (libproc, -lproc)

#include <libproc.h>

ctf_file_t *
Paddr_to_ctf(struct ps_prochandle *P, uintptr_t addr);

ctf_file_t *
Plmid_to_ctf(struct ps_prochandle *P, Lmid_t lmid, const char *name);

ctf_file_t *
Pname_to_ctf(struct ps_prochandle *P, const char *name);

The (), Plmid_to_ctf(), and Pname_to_ctf() functions lookup CTF (Compact C Type Format) data, for use with , from the process represented by the handle P. In all cases, the CTF sections of both the running executable and its shared libraries are searched.

The CTF container returned is valid as long as the process handle P is valid. That is, until a call to Prelease(3PROC) is made. Further, consumers must not close the CTF container.

The () function attempts to find the CTF section, if any, that exists for the address addr. Note, not all addresses correspond to memory regions that have CTF data. For example, if a user creates a region of anonymous memory through the mmap(2) function, then it will not have any corresponding CTF information.

The () function looks up the object named name and returns the corresponding CTF section, if any exists. Two special values may be used for name. The macro PR_OBJ_EXEC refers to the executable object itself and the macro PR_OBJ_LDSO refers to the object ld.so.1.

The () function is similar to Pname_to_ctf(). It allows the passing of a link-map identifier, lmid, which constricts the search of the object named with name to that link-map. The special value of PR_LMID_EVERY indicates that every link-map should be searched, which is equivalent in behavior to the Pname_to_ctf() function.

Upon successful completion, the Paddr_to_ctf(), Plmid_to_ctf(), and Pname_to_ctf() functions return a pointer to the corresponding CTF container. Otherwise, if none exists then NULL is returned.

See in libproc(3LIB).

libproc(3LIB), ctf(5)

May 11, 2016 OmniOS