Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3proc/Plookup_by_addr.3proc
+++ new/usr/src/man/man3proc/Plookup_by_addr.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
10 10 .\"
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\"
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 .Dd May 11, 2016
15 15 .Dt PLOOKUP_BY_ADDR 3PROC
16 16 .Os
17 17 .Sh NAME
18 18 .Nm Plookup_by_addr ,
19 19 .Nm Pxlookup_by_addr ,
20 20 .Nm Pxlookup_by_addr_resolved ,
21 21 .Nm Plookup_by_name ,
22 22 .Nm Pxlookup_by_name
23 23 .Nd lookup symbols in a process
24 -.Sh SYNOPSIS
24 +.Sh LIBRARY
25 25 .Lb libproc
26 +.Sh SYNOPSIS
26 27 .In libproc.h
27 28 .Ft int
28 29 .Fo Plookup_by_addr
29 30 .Fa "struct ps_prochandle *P"
30 31 .Fa "uintptr_t addr"
31 32 .Fa "char *buf"
32 33 .Fa "size_t size"
33 34 .Fa "Gelf_Sym *symp"
34 35 .Fc
35 36 .Ft int
36 37 .Fo Pxlookup_by_addr
37 38 .Fa "struct ps_prochandle *P"
38 39 .Fa "uintptr_t addr"
39 40 .Fa "char *buf"
40 41 .Fa "size_t size"
41 42 .Fa "Gelf_Sym *symp"
42 43 .Fa "prsyminfo_t *sip"
43 44 .Fc
44 45 .Ft int
45 46 .Fo Pxlookup_by_addr_resolved
46 47 .Fa "struct ps_prochandle *P"
47 48 .Fa "uintptr_t addr"
48 49 .Fa "char *buf"
49 50 .Fa "size_t size"
50 51 .Fa "Gelf_Sym *symp"
51 52 .Fa "prsyminfo_t *sip"
52 53 .Fc
53 54 .Ft int
54 55 .Fo Plookup_by_name
55 56 .Fa "struct ps_prochandle *P"
56 57 .Fa "const char *object"
57 58 .Fa "const char *symbol"
58 59 .Fa "GElf_Sym *symp"
59 60 .Fc
60 61 .Ft int
61 62 .Fo Pxlookup_by_name
62 63 .Fa "struct ps_prochandle *P"
63 64 .Fa "Lmid_t lmid"
64 65 .Fa "const char *object"
65 66 .Fa "const char *symbol"
66 67 .Fa "GElf_Sym *symp"
67 68 .Fa "prsyminfo_t *sip"
68 69 .Fc
69 70 .Sh DESCRIPTION
70 71 The
71 72 .Fn Plookup_by_addr ,
72 73 .Fn Pxlookup_by_addr ,
73 74 .Fn Pxlookup_by_addr_resolved ,
74 75 .Fn Plookup_by_name ,
75 76 and
76 77 .Fn Pxlookup_by_name
77 78 functions look up symbol information in the process handle
78 79 .Fa P
79 80 and fill in the ELF symbol information in
80 81 .Fa symp
81 82 with the found symbol.
82 83 Symbols may be looked up both by address and name.
83 84 .Pp
84 85 The
85 86 .Fn Plookup_by_addr
86 87 function looks up symbol information corresponding to the address
87 88 .Fa addr .
88 89 If found, up to
89 90 .Fa size
90 91 bytes of the symbol's name, including the null terminator will be filled
91 92 in to the buffer
92 93 .Fa buf .
93 94 .Pp
94 95 The
95 96 .Fn Pxlookup_by_addr
96 97 function is identical to the
97 98 .Fn Plookup_by_addr
98 99 function, except that it also fills in the structure
99 100 .Fa sip
100 101 with additional information.
101 102 The definition of the
102 103 .Sy prsyminfo_t
103 104 is found in
104 105 .Xr libproc 3LIB .
105 106 .Pp
106 107 The
107 108 .Fn Pxlookup_by_addr_resolved
108 109 function is similar to the
109 110 .Fn Pxlookup_by_addr
110 111 function; however, it attempts to resolve the paths present in the
111 112 .Sy prsyminfo_t
112 113 to an absolute path on the file system.
113 114 .Pp
114 115 The
115 116 .Fn Plookup_by_name
116 117 function attempts to look up a symbol based on its name.
117 118 The
118 119 .Fa object
119 120 argument allows the caller to specify a specific object that was mapped
120 121 in by the run-time link-editor to search for
121 122 .Fa symbol
122 123 in.
123 124 The system provides three special values which may be passed in for
124 125 .Fa object .
125 126 The value
126 127 .Dv PR_OBJ_EXEC
127 128 refers to the executable's object (a.out).
128 129 The value
129 130 .Dv PR_OBJ_LDSO
130 131 refers to the object
131 132 .Sy ld.so.1 .
132 133 The value
133 134 .Dv PR_OBJ_EVERY
134 135 indicates that every object should be searched.
135 136 .Pp
136 137 The
137 138 .Fn Pxlookup_by_name
138 139 function is similar to the
139 140 .Fn Plookup_by_name
140 141 function; however, it allows a link-map identifier,
141 142 .Fa lmid ,
142 143 to be specified and also provides additional information about the
143 144 symbol in the form of the
144 145 .Sy prsyminfo_t
145 146 .Fa sip .
146 147 The specification of
147 148 .Fa lmid
148 149 restricts the search for the object named
149 150 .Fa object
150 151 and symbol named
151 152 .Fa symbol
152 153 to the specified link-map.
153 154 .Pp
154 155 There are three special link-map identifiers that may be passed in.
155 156 The symbol
156 157 .Dv PR_LMID_EVERY
157 158 indicates that every link-map should be searched.
158 159 The symbol
159 160 .Dv LM_ID_BASE
160 161 indicates that the base link-map, the one that is used for the
161 162 executable should be searched.
162 163 Finally, the symbol
163 164 .Dv LM_ID_LDSO
164 165 refers to the link-map that is used by the run-time link editor, ld.so.1.
165 166 The
166 167 .Fn Plookup_by_name
167 168 function behaves like
168 169 .Fn Pxlookup_by_name
169 170 when the
170 171 .Dv PR_LMID_EVERY
171 172 argument is passed to
172 173 .Fa lmid ,
173 174 indicating that every link-map should be searched.
174 175 .Sh RETURN VALUES
175 176 Upon successful completion, the
176 177 .Fn Plookup_by_addr ,
177 178 .Fn Pxlookup_by_addr ,
178 179 .Fn Pxlookup_by_addr_resolved ,
179 180 .Fn Plookup_by_name ,
180 181 and
181 182 .Fn Pxlookup_by_name
182 183 functions return
183 184 .Sy 0
184 185 and fill in the symbol information.
185 186 Otherwise,
186 187 .Sy -1
187 188 is returned to indicate that the symbol could not be found.
188 189 .Sh INTERFACE STABILITY
189 190 .Sy Uncommitted
190 191 .Sh MT-LEVEL
191 192 See
192 193 .Sy LOCKING
193 194 in
194 195 .Xr libproc 3LIB .
195 196 .Sh SEE ALSO
196 197 .Xr elf 3ELF ,
197 198 .Xr gelf 3ELF ,
198 199 .Xr libproc 3LIB ,
199 200 .Xr proc 4
↓ open down ↓ |
164 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX