]>
Commit | Line | Data |
---|---|---|
ba7eb55e DL |
1 | <html> |
2 | <!-- | |
3 | - 2019 by David Lamparter, placed in public domain | |
4 | --> | |
5 | <head> | |
6 | <title>Symalyzer report</title> | |
7 | <style type="text/css"> | |
8 | html { | |
9 | margin:auto; | |
10 | max-width:70em; | |
11 | font-family:Fira Sans, sans-serif; | |
12 | } | |
13 | dl { | |
14 | display:grid; | |
15 | grid-template-columns: 1.4em 1.4em 1fr 1fr; | |
16 | grid-auto-rows: auto; | |
17 | } | |
18 | dt.dir { | |
19 | background-color:#ff8; | |
20 | color:#000; | |
21 | border:1px solid #000; | |
22 | border-bottom:2px solid #000; | |
23 | font-size:14pt; | |
24 | padding:2pt 15pt; | |
25 | margin:0pt; | |
26 | margin-top:10pt; | |
27 | grid-column:1 / -1; | |
28 | } | |
29 | dt.file { | |
30 | background-color:#ffa; | |
31 | color:#000; | |
32 | border-bottom:1px solid #000; | |
33 | font-size:12pt; | |
34 | padding:2pt 15pt; | |
35 | margin:5pt 0pt; | |
36 | grid-column:1 / -1; | |
37 | } | |
38 | dt.file.filehidden { | |
39 | background-color:#ffc; | |
40 | font-size:10pt; | |
41 | padding:0.5pt 15pt; | |
42 | margin-bottom:-5pt; | |
43 | } | |
44 | dd { | |
45 | display:inline-block; | |
46 | vertical-align:middle; | |
47 | margin:0; | |
48 | } | |
49 | dd.symtype { | |
50 | grid-column:1; | |
51 | ||
52 | border:1px solid #666; | |
53 | text-align:center; | |
54 | } | |
55 | dd.symklass { | |
56 | grid-column:2; | |
57 | ||
58 | border:1px solid #666; | |
59 | text-align:center; | |
60 | } | |
61 | dd.symname { | |
62 | grid-column:3; | |
63 | ||
64 | font-family:monospace; | |
65 | padding:0 0.5em; | |
66 | padding-top:2px; | |
67 | border-bottom:1px dashed #ccc; | |
68 | } | |
69 | dd.symloc { | |
70 | grid-column:4; | |
71 | ||
72 | padding:0 0.5em; | |
73 | border-bottom:1px dashed #ccc; | |
74 | } | |
75 | .symloc-unknown { | |
76 | font-style:italic; | |
77 | color:#aaa; | |
78 | } | |
79 | ||
80 | .symtype.sym-static { | |
81 | background-color:#cf4; | |
82 | color:#000; | |
83 | } | |
84 | .symtype.sym-extrastatic { | |
85 | background-color:#fe8; | |
86 | color:#000; | |
87 | } | |
88 | .symtype.sym-liblocal { | |
89 | background-color:#fc6; | |
90 | color:#000; | |
91 | } | |
92 | ||
93 | .symklass.symk-T { | |
94 | background-color:#ddd; | |
95 | color:#000; | |
96 | } | |
97 | .symklass.symk-B, | |
98 | .symklass.symk-C, | |
99 | .symklass.symk-D { | |
100 | background-color:#faa; | |
101 | color:#000; | |
102 | } | |
103 | .symklass.symk-R { | |
104 | background-color:#fd8; | |
105 | color:#000; | |
106 | } | |
107 | ||
108 | .symtype.sym-api { | |
109 | background-color:#d9f; | |
110 | color:#000; | |
111 | } | |
112 | .symname.sym-api, | |
113 | .symloc.sym-api { | |
114 | background-color:#f8e8ff; | |
115 | } | |
116 | ||
117 | dt.file.dirhidden, | |
118 | dd.dirhidden { | |
119 | display:none; | |
120 | } | |
121 | dd.filehidden { | |
122 | display:none; | |
123 | } | |
124 | dd.symhidden { | |
125 | display:none; | |
126 | } | |
127 | ||
128 | ul { | |
129 | font-size:10pt; | |
130 | } | |
131 | li { | |
132 | margin-bottom:6pt; | |
133 | text-indent:-2.5em; | |
134 | margin-left:2.5em; | |
135 | } | |
136 | code { | |
137 | background-color:#eee; | |
138 | color:#060; | |
139 | text-decoration:underline; | |
140 | } | |
141 | b.symtype, | |
142 | b.symklass { | |
143 | display:inline-block; | |
144 | text-align:center; | |
145 | border:1px solid #666; | |
146 | width:1.4em; | |
147 | text-indent:0; | |
148 | } | |
149 | </style> | |
150 | <script src="jquery-3.4.1.min.js"></script> | |
151 | <script> | |
152 | ||
153 | function dirtoggle(elem, visible) { | |
154 | if (visible) { | |
155 | elem.removeClass("dirhidden"); | |
156 | } else { | |
157 | elem.addClass("dirhidden"); | |
158 | } | |
159 | ||
160 | var next = elem.next(); | |
161 | while (next.is("dd") || next.is("dt.file")) { | |
162 | if (visible) { | |
163 | next.removeClass("dirhidden"); | |
164 | } else { | |
165 | next.addClass("dirhidden"); | |
166 | } | |
167 | next = next.next(); | |
168 | } | |
169 | } | |
170 | ||
171 | function filetoggle(elem, visible) { | |
172 | if (visible) { | |
173 | elem.removeClass("filehidden"); | |
174 | } else { | |
175 | elem.addClass("filehidden"); | |
176 | } | |
177 | ||
178 | var next = elem.next(); | |
179 | while (next.is("dd")) { | |
180 | if (visible) { | |
181 | next.removeClass("filehidden"); | |
182 | } else { | |
183 | next.addClass("filehidden"); | |
184 | } | |
185 | next = next.next(); | |
186 | } | |
187 | } | |
188 | ||
189 | function symtoggle(elem, visible) { | |
190 | if (visible) { | |
191 | elem.removeClass("symhidden"); | |
192 | } else { | |
193 | elem.addClass("symhidden"); | |
194 | } | |
195 | ||
196 | var next = elem.next(); | |
197 | while (next.is(".symklass") || next.is(".symname") || next.is(".symloc")) { | |
198 | if (visible) { | |
199 | next.removeClass("symhidden"); | |
200 | } else { | |
201 | next.addClass("symhidden"); | |
202 | } | |
203 | next = next.next(); | |
204 | } | |
205 | } | |
206 | ||
207 | ||
208 | $(document).ready(function(){ | |
209 | $("dt.dir").each(function(){ | |
210 | var elem = $(this); | |
211 | ||
212 | elem.click(function(){ | |
213 | dirtoggle(elem, elem.is(".dirhidden")); | |
214 | }); | |
215 | ||
216 | dirtoggle(elem, false); | |
217 | }); | |
218 | ||
219 | $("dt.file").each(function(){ | |
220 | var elem = $(this); | |
221 | ||
222 | elem.click(function(){ | |
223 | filetoggle(elem, elem.is(".filehidden")); | |
224 | }); | |
225 | ||
226 | /* filetoggle(elem, false); */ | |
227 | }); | |
228 | ||
229 | $("#f_hide_all").click(function(){ | |
230 | $("dt.file").each(function(){ | |
231 | filetoggle($(this), false); | |
232 | }); | |
233 | }); | |
234 | $("#f_show_all").click(function(){ | |
235 | $("dt.file").each(function(){ | |
236 | filetoggle($(this), true); | |
237 | }); | |
238 | }); | |
239 | ||
240 | $("#s_show_all").click(function(){ | |
241 | $("dd.symtype").each(function(){ | |
242 | symtoggle($(this), true); | |
243 | }); | |
244 | }); | |
245 | $("#s_hide_all").click(function(){ | |
246 | $("dd.symtype").each(function(){ | |
247 | symtoggle($(this), false); | |
248 | }); | |
249 | }); | |
250 | $("#s_show_vars").click(function(){ | |
251 | $("dd.symtype").each(function(){ | |
252 | var elem_type = $(this); | |
253 | if (elem_type.text() === "A") { | |
254 | return; | |
255 | } | |
256 | ||
257 | var elem_klass = elem_type.next(); | |
258 | ||
259 | if ("BbCDdGgnRrSs".indexOf(elem_klass.text()) >= 0) { | |
260 | symtoggle(elem_type, true); | |
261 | } | |
262 | }); | |
263 | }); | |
264 | $("#s_show_funcs").click(function(){ | |
265 | $("dd.symtype").each(function(){ | |
266 | var elem_type = $(this); | |
267 | if (elem_type.text() === "A") { | |
268 | return; | |
269 | } | |
270 | ||
271 | var elem_klass = elem_type.next(); | |
272 | ||
273 | if ("Tt".indexOf(elem_klass.text()) >= 0) { | |
274 | symtoggle(elem_type, true); | |
275 | } | |
276 | }); | |
277 | }); | |
278 | $("#s_show_api").click(function(){ | |
279 | $("dd.sym-api").each(function(){ | |
280 | symtoggle($(this), true); | |
281 | }); | |
282 | }); | |
283 | ||
284 | $("#jsbuttons").show(); | |
285 | }); | |
286 | </script> | |
287 | </head> | |
288 | <body> | |
289 | <table style="display:none" id="jsbuttons"> | |
290 | <tr><td>Files</td><td> | |
291 | <button type="button" id="f_hide_all">Hide all</button> | |
292 | <button type="button" id="f_show_all">Show all</button> | |
293 | </td></tr> | |
294 | <tr><td>Symbols</td><td> | |
295 | <button type="button" id="s_hide_all">Hide all</button> | |
296 | <button type="button" id="s_show_all">Show all</button><br> | |
297 | <button type="button" id="s_show_vars">Show variables</button> | |
298 | <button type="button" id="s_show_funcs">Show functions</button> | |
299 | <button type="button" id="s_show_api">Show module/API usage</button> | |
300 | </td></tr> | |
301 | </table> | |
302 | <div style="display:grid;grid-template-columns:1fr 1fr;"> | |
303 | <ul> | |
304 | <li><b class="symtype sym-static">S</b> means the symbol is not used outside its own file. | |
305 | It could either be completely unused or used locally. It might be appropriate to make it | |
306 | <code>static</code>.</li> | |
307 | <li><b class="symtype sym-extrastatic">Z</b> means the symbol is not used outside its own file, | |
308 | and it's not visible to the outside of the library or daemon (i.e. ELF hidden linkage.) | |
309 | It could still be completely unused, or used within the library. It might be appropriate to make it | |
310 | <code>static</code>.</li> | |
311 | <li><b class="symtype sym-liblocal">L</b> means the symbol is used from other files in the library, | |
312 | but not from outside. It might be appropriate to make it <code>DSO_LOCAL</code>.</li> | |
313 | <li><b class="symtype sym-api">A</b> means the symbol is used from some other file, most likely a | |
314 | loadable module. Note this is only flagged for symbols in executable files, not libraries.</li> | |
315 | </ul> | |
316 | <ul> | |
317 | <li><b class="symklass symk-T">T</b> are normal functions ("program <u>T</u>ext")</li> | |
318 | <li style="text-indent:0;margin-left:0"> | |
319 | <b class="symklass symk-B">B</b> (<u>B</u>SS),<br> | |
320 | <b class="symklass symk-C">C</b> (<u>C</u>ommon),<br> | |
321 | <b class="symklass symk-D">D</b> (<u>D</u>ata)<br> | |
322 | are various types of writable global variables</li> | |
323 | <li><b class="symklass symk-R">R</b> are read-only global variables ("<u>R</u>odata")</li> | |
324 | </ul> | |
325 | </div> | |
326 | <dl> | |
327 | {%- for subdir, subreport in dirgroups.items()|sort %} | |
328 | <dt class="dir">{{ subdir }}</dt> | |
329 | {%- for obj, reports in subreport.items()|sort %} | |
330 | <dt class="file">{{ obj }}</dt> | |
331 | {%- for report in reports|sort %} | |
332 | {#- <dd class="{{ report.idlong }}"> #} | |
333 | <dd class="sym-{{ report.idlong }} symtype" title="{{ report.title }}">{{ report.idshort }}</dd> | |
334 | <dd class="sym-{{ report.idlong }} symk-{{ report.sym.klass }} symklass" title="{{ klasses.get(report.sym.klass, '???') }}">{{ report.sym.klass }}</dd> | |
335 | <dd class="sym-{{ report.idlong }} symname">{{ report.sym.name }}</dd> | |
336 | {% if report.sym.loc %} | |
337 | <dd class="sym-{{ report.idlong }} symloc">{{ report.sym.loc }}</dd> | |
338 | {% else %} | |
339 | <dd class="sym-{{ report.idlong }} symloc symloc-unknown">unknown</dd> | |
340 | {% endif %} | |
341 | {#- </dd> #} | |
342 | {%- endfor %} | |
343 | {%- endfor %} | |
344 | {%- endfor %} | |
345 | </dl> | |
346 | </body> | |
347 | </html> |