1 PADDR_TO_CTF(3PROC) Process Control Library Functions PADDR_TO_CTF(3PROC) 2 3 NAME 4 Paddr_to_ctf, Plmid_to_ctf, Pname_to_ctf - lookup CTF data 5 6 LIBRARY 7 Process Control Library (libproc, -lproc) 8 9 SYNOPSIS 10 #include <libproc.h> 11 12 ctf_file_t * 13 Paddr_to_ctf(struct ps_prochandle *P, uintptr_t addr); 14 15 ctf_file_t * 16 Plmid_to_ctf(struct ps_prochandle *P, Lmid_t lmid, const char *name); 17 18 ctf_file_t * 19 Pname_to_ctf(struct ps_prochandle *P, const char *name); 20 21 DESCRIPTION 22 The Paddr_to_ctf(), Plmid_to_ctf(), and Pname_to_ctf() functions lookup 23 CTF (Compact C Type Format) data, for use with libctf, from the process 24 represented by the handle P. In all cases, the CTF sections of both the 25 running executable and its shared libraries are searched. 26 27 The CTF container returned is valid as long as the process handle P is 28 valid. That is, until a call to Prelease(3PROC) is made. Further, 29 consumers must not close the CTF container. 30 31 The Paddr_to_ctf() function attempts to find the CTF section, if any, 32 that exists for the address addr. Note, not all addresses correspond to 33 memory regions that have CTF data. For example, if a user creates a 34 region of anonymous memory through the mmap(2) function, then it will not 35 have any corresponding CTF information. 36 37 The Pname_to_ctf() function looks up the object named name and returns 38 the corresponding CTF section, if any exists. Two special values may be 39 used for name. The macro PR_OBJ_EXEC refers to the executable object 40 itself and the macro PR_OBJ_LDSO refers to the object ld.so.1. 41 42 The Plmid_to_ctf() function is similar to Pname_to_ctf(). It allows the 43 passing of a link-map identifier, lmid, which constricts the search of 44 the object named with name to that link-map. The special value of 45 PR_LMID_EVERY indicates that every link-map should be searched, which is 46 equivalent in behavior to the Pname_to_ctf() function. 47 48 RETURN VALUES 49 Upon successful completion, the Paddr_to_ctf(), Plmid_to_ctf(), and 50 Pname_to_ctf() functions return a pointer to the corresponding CTF 51 container. Otherwise, if none exists then NULL is returned. 52 53 INTERFACE STABILITY 54 Uncommitted 55 56 MT-LEVEL 57 See LOCKING in libproc(3LIB). 58 59 SEE ALSO 60 libproc(3LIB), ctf(4) 61 62 illumos May 11, 2016 illumos