1 /* $NetBSD: dwarf_dump.c,v 1.2 2014/03/09 16:58:03 christos Exp $ */
2
3 /*-
4 * Copyright (c) 2007 John Birrell (jb@freebsd.org)
5 * Copyright (c) 2009 Kai Wang
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30 #include "_libdwarf.h"
31
32 __RCSID("$NetBSD: dwarf_dump.c,v 1.2 2014/03/09 16:58:03 christos Exp $");
33 ELFTC_VCSID("Id: dwarf_dump.c 2073 2011-10-27 03:30:47Z jkoshy ");
34
35 int
dwarf_get_ACCESS_name(unsigned access,const char ** s)36 dwarf_get_ACCESS_name(unsigned access, const char **s)
37 {
38
39 assert(s != NULL);
40
41 switch (access) {
42 case DW_ACCESS_public:
43 *s = "DW_ACCESS_public"; break;
44 case DW_ACCESS_protected:
45 *s = "DW_ACCESS_protected"; break;
46 case DW_ACCESS_private:
47 *s = "DW_ACCESS_private"; break;
48 default:
49 return (DW_DLV_NO_ENTRY);
50 }
51
52 return (DW_DLV_OK);
53 }
54
55 int
dwarf_get_AT_name(unsigned attr,const char ** s)56 dwarf_get_AT_name(unsigned attr, const char **s)
57 {
58
59 assert(s != NULL);
60
61 switch (attr) {
62 case DW_AT_abstract_origin:
63 *s = "DW_AT_abstract_origin"; break;
64 case DW_AT_accessibility:
65 *s = "DW_AT_accessibility"; break;
66 case DW_AT_address_class:
67 *s = "DW_AT_address_class"; break;
68 case DW_AT_artificial:
69 *s = "DW_AT_artificial"; break;
70 case DW_AT_allocated:
71 *s = "DW_AT_allocated"; break;
72 case DW_AT_associated:
73 *s = "DW_AT_associated"; break;
74 case DW_AT_base_types:
75 *s = "DW_AT_base_types"; break;
76 case DW_AT_binary_scale:
77 *s = "DW_AT_binary_scale"; break;
78 case DW_AT_bit_offset:
79 *s = "DW_AT_bit_offset"; break;
80 case DW_AT_bit_size:
81 *s = "DW_AT_bit_size"; break;
82 case DW_AT_bit_stride:
83 *s = "DW_AT_bit_stride"; break;
84 case DW_AT_byte_size:
85 *s = "DW_AT_byte_size"; break;
86 case DW_AT_byte_stride:
87 *s = "DW_AT_byte_stride"; break;
88 case DW_AT_calling_convention:
89 *s = "DW_AT_calling_convention"; break;
90 case DW_AT_common_reference:
91 *s = "DW_AT_common_reference"; break;
92 case DW_AT_comp_dir:
93 *s = "DW_AT_comp_dir"; break;
94 case DW_AT_const_expr:
95 *s = "DW_AT_const_expr"; break;
96 case DW_AT_const_value:
97 *s = "DW_AT_const_value"; break;
98 case DW_AT_containing_type:
99 *s = "DW_AT_containing_type"; break;
100 case DW_AT_count:
101 *s = "DW_AT_count"; break;
102 case DW_AT_call_column:
103 *s = "DW_AT_call_column"; break;
104 case DW_AT_call_file:
105 *s = "DW_AT_call_file"; break;
106 case DW_AT_call_line:
107 *s = "DW_AT_call_line"; break;
108 case DW_AT_data_bit_offset:
109 *s = "DW_AT_data_bit_offset"; break;
110 case DW_AT_data_location:
111 *s = "DW_AT_data_location"; break;
112 case DW_AT_data_member_location:
113 *s = "DW_AT_data_member_location"; break;
114 case DW_AT_decl_column:
115 *s = "DW_AT_decl_column"; break;
116 case DW_AT_decl_file:
117 *s = "DW_AT_decl_file"; break;
118 case DW_AT_decl_line:
119 *s = "DW_AT_decl_line"; break;
120 case DW_AT_declaration:
121 *s = "DW_AT_declaration"; break;
122 case DW_AT_default_value:
123 *s = "DW_AT_default_value"; break;
124 case DW_AT_decimal_scale:
125 *s = "DW_AT_decimal_scale"; break;
126 case DW_AT_decimal_sign:
127 *s = "DW_AT_decimal_sign"; break;
128 case DW_AT_description:
129 *s = "DW_AT_description"; break;
130 case DW_AT_digit_count:
131 *s = "DW_AT_digit_count"; break;
132 case DW_AT_discr:
133 *s = "DW_AT_discr"; break;
134 case DW_AT_discr_list:
135 *s = "DW_AT_discr_list"; break;
136 case DW_AT_discr_value:
137 *s = "DW_AT_discr_value"; break;
138 case DW_AT_element_list:
139 *s = "DW_AT_element_list"; break;
140 case DW_AT_encoding:
141 *s = "DW_AT_encoding"; break;
142 case DW_AT_enum_class:
143 *s = "DW_AT_enum_class"; break;
144 case DW_AT_external:
145 *s = "DW_AT_external"; break;
146 case DW_AT_entry_pc:
147 *s = "DW_AT_entry_pc"; break;
148 case DW_AT_extension:
149 *s = "DW_AT_extension"; break;
150 case DW_AT_explicit:
151 *s = "DW_AT_explicit"; break;
152 case DW_AT_endianity:
153 *s = "DW_AT_endianity"; break;
154 case DW_AT_elemental:
155 *s = "DW_AT_elemental"; break;
156 case DW_AT_frame_base:
157 *s = "DW_AT_frame_base"; break;
158 case DW_AT_friend:
159 *s = "DW_AT_friend"; break;
160 case DW_AT_high_pc:
161 *s = "DW_AT_high_pc"; break;
162 case DW_AT_hi_user:
163 *s = "DW_AT_hi_user"; break;
164 case DW_AT_identifier_case:
165 *s = "DW_AT_identifier_case"; break;
166 case DW_AT_import:
167 *s = "DW_AT_import"; break;
168 case DW_AT_inline:
169 *s = "DW_AT_inline"; break;
170 case DW_AT_is_optional:
171 *s = "DW_AT_is_optional"; break;
172 case DW_AT_language:
173 *s = "DW_AT_language"; break;
174 case DW_AT_linkage_name:
175 *s = "DW_AT_linkage_name"; break;
176 case DW_AT_lo_user:
177 *s = "DW_AT_lo_user"; break;
178 case DW_AT_location:
179 *s = "DW_AT_location"; break;
180 case DW_AT_low_pc:
181 *s = "DW_AT_low_pc"; break;
182 case DW_AT_lower_bound:
183 *s = "DW_AT_lower_bound"; break;
184 case DW_AT_macro_info:
185 *s = "DW_AT_macro_info"; break;
186 case DW_AT_main_subprogram:
187 *s = "DW_AT_main_subprogram"; break;
188 case DW_AT_mutable:
189 *s = "DW_AT_mutable"; break;
190 case DW_AT_member:
191 *s = "DW_AT_member"; break;
192 case DW_AT_name:
193 *s = "DW_AT_name"; break;
194 case DW_AT_namelist_item:
195 *s = "DW_AT_namelist_item"; break;
196 case DW_AT_ordering:
197 *s = "DW_AT_ordering"; break;
198 case DW_AT_object_pointer:
199 *s = "DW_AT_object_pointer"; break;
200 case DW_AT_priority:
201 *s = "DW_AT_priority"; break;
202 case DW_AT_producer:
203 *s = "DW_AT_producer"; break;
204 case DW_AT_prototyped:
205 *s = "DW_AT_prototyped"; break;
206 case DW_AT_picture_string:
207 *s = "DW_AT_picture_string"; break;
208 case DW_AT_pure:
209 *s = "DW_AT_pure"; break;
210 case DW_AT_return_addr:
211 *s = "DW_AT_return_addr"; break;
212 case DW_AT_ranges:
213 *s = "DW_AT_ranges"; break;
214 case DW_AT_recursive:
215 *s = "DW_AT_recursive"; break;
216 case DW_AT_segment:
217 *s = "DW_AT_segment"; break;
218 case DW_AT_sibling:
219 *s = "DW_AT_sibling"; break;
220 case DW_AT_signature:
221 *s = "DW_AT_signature"; break;
222 case DW_AT_specification:
223 *s = "DW_AT_specification"; break;
224 case DW_AT_start_scope:
225 *s = "DW_AT_start_scope"; break;
226 case DW_AT_static_link:
227 *s = "DW_AT_static_link"; break;
228 case DW_AT_stmt_list:
229 *s = "DW_AT_stmt_list"; break;
230 case DW_AT_string_length:
231 *s = "DW_AT_string_length"; break;
232 case DW_AT_subscr_data:
233 *s = "DW_AT_subscr_data"; break;
234 case DW_AT_small:
235 *s = "DW_AT_small"; break;
236 case DW_AT_type:
237 *s = "DW_AT_type"; break;
238 case DW_AT_trampoline:
239 *s = "DW_AT_trampoline"; break;
240 case DW_AT_threads_scaled:
241 *s = "DW_AT_threads_scaled"; break;
242 case DW_AT_upper_bound:
243 *s = "DW_AT_upper_bound"; break;
244 case DW_AT_use_location:
245 *s = "DW_AT_use_location"; break;
246 case DW_AT_use_UTF8:
247 *s = "DW_AT_use_UTF8"; break;
248 case DW_AT_variable_parameter:
249 *s = "DW_AT_variable_parameter"; break;
250 case DW_AT_virtuality:
251 *s = "DW_AT_virtuality"; break;
252 case DW_AT_visibility:
253 *s = "DW_AT_visibility"; break;
254 case DW_AT_vtable_elem_location:
255 *s = "DW_AT_vtable_elem_location"; break;
256 default:
257 return (DW_DLV_NO_ENTRY);
258 }
259
260 return (DW_DLV_OK);
261 }
262
263 int
dwarf_get_ATE_name(unsigned ate,const char ** s)264 dwarf_get_ATE_name(unsigned ate, const char **s)
265 {
266
267 assert(s != NULL);
268
269 switch(ate) {
270 case DW_ATE_address:
271 *s = "DW_ATE_address"; break;
272 case DW_ATE_boolean:
273 *s = "DW_ATE_boolean"; break;
274 case DW_ATE_complex_float:
275 *s = "DW_ATE_complex_float"; break;
276 case DW_ATE_float:
277 *s = "DW_ATE_float"; break;
278 case DW_ATE_signed:
279 *s = "DW_ATE_signed"; break;
280 case DW_ATE_signed_char:
281 *s = "DW_ATE_signed_char"; break;
282 case DW_ATE_unsigned:
283 *s = "DW_ATE_unsigned"; break;
284 case DW_ATE_unsigned_char:
285 *s = "DW_ATE_unsigned_char"; break;
286 case DW_ATE_imaginary_float:
287 *s = "DW_ATE_imaginary_float"; break;
288 case DW_ATE_packed_decimal:
289 *s = "DW_ATE_packed_decimal"; break;
290 case DW_ATE_numeric_string:
291 *s = "DW_ATE_numeric_string"; break;
292 case DW_ATE_edited:
293 *s = "DW_ATE_edited"; break;
294 case DW_ATE_signed_fixed:
295 *s = "DW_ATE_signed_fixed"; break;
296 case DW_ATE_unsigned_fixed:
297 *s = "DW_ATE_unsigned_fixed"; break;
298 case DW_ATE_decimal_float:
299 *s = "DW_ATE_decimal_float"; break;
300 case DW_ATE_lo_user:
301 *s = "DW_ATE_lo_user"; break;
302 case DW_ATE_hi_user:
303 *s = "DW_ATE_hi_user"; break;
304 default:
305 return (DW_DLV_NO_ENTRY);
306 }
307
308 return (DW_DLV_OK);
309 }
310
311 int
dwarf_get_CC_name(unsigned cc,const char ** s)312 dwarf_get_CC_name(unsigned cc, const char **s)
313 {
314
315 assert(s != NULL);
316
317 switch (cc) {
318 case DW_CC_normal:
319 *s = "DW_CC_normal"; break;
320 case DW_CC_program:
321 *s = "DW_CC_program"; break;
322 case DW_CC_nocall:
323 *s = "DW_CC_nocall"; break;
324 case DW_CC_lo_user:
325 *s = "DW_CC_lo_user"; break;
326 case DW_CC_hi_user:
327 *s = "DW_CC_hi_user"; break;
328 default:
329 return (DW_DLV_NO_ENTRY);
330 }
331
332 return (DW_DLV_OK);
333 }
334
335 int
dwarf_get_CFA_name(unsigned cfa,const char ** s)336 dwarf_get_CFA_name(unsigned cfa, const char **s)
337 {
338
339 assert(s != NULL);
340
341 switch (cfa) {
342 case DW_CFA_advance_loc:
343 *s = "DW_CFA_advance_loc"; break;
344 case DW_CFA_offset:
345 *s = "DW_CFA_offset"; break;
346 case DW_CFA_restore:
347 *s = "DW_CFA_restore"; break;
348 case DW_CFA_nop:
349 *s = "DW_CFA_nop"; break;
350 case DW_CFA_set_loc:
351 *s = "DW_CFA_set_loc"; break;
352 case DW_CFA_advance_loc1:
353 *s = "DW_CFA_advance_loc1"; break;
354 case DW_CFA_advance_loc2:
355 *s = "DW_CFA_advance_loc2"; break;
356 case DW_CFA_advance_loc4:
357 *s = "DW_CFA_advance_loc4"; break;
358 case DW_CFA_offset_extended:
359 *s = "DW_CFA_offset_extended"; break;
360 case DW_CFA_restore_extended:
361 *s = "DW_CFA_restore_extended"; break;
362 case DW_CFA_undefined:
363 *s = "DW_CFA_undefined"; break;
364 case DW_CFA_same_value:
365 *s = "DW_CFA_same_value"; break;
366 case DW_CFA_register:
367 *s = "DW_CFA_register"; break;
368 case DW_CFA_remember_state:
369 *s = "DW_CFA_remember_state"; break;
370 case DW_CFA_restore_state:
371 *s = "DW_CFA_restore_state"; break;
372 case DW_CFA_def_cfa:
373 *s = "DW_CFA_def_cfa"; break;
374 case DW_CFA_def_cfa_register:
375 *s = "DW_CFA_def_cfa_register"; break;
376 case DW_CFA_def_cfa_offset:
377 *s = "DW_CFA_def_cfa_offset"; break;
378 case DW_CFA_def_cfa_expression:
379 *s = "DW_CFA_def_cfa_expression"; break;
380 case DW_CFA_expression:
381 *s = "DW_CFA_expression"; break;
382 case DW_CFA_offset_extended_sf:
383 *s = "DW_CFA_offset_extended_sf"; break;
384 case DW_CFA_def_cfa_sf:
385 *s = "DW_CFA_def_cfa_sf"; break;
386 case DW_CFA_def_cfa_offset_sf:
387 *s = "DW_CFA_def_cfa_offset_sf"; break;
388 case DW_CFA_val_offset:
389 *s = "DW_CFA_val_offset"; break;
390 case DW_CFA_val_offset_sf:
391 *s = "DW_CFA_val_offset_sf"; break;
392 case DW_CFA_val_expression:
393 *s = "DW_CFA_val_expression"; break;
394 case DW_CFA_lo_user:
395 *s = "DW_CFA_lo_user"; break;
396 case DW_CFA_high_user:
397 *s = "DW_CFA_high_user"; break;
398 default:
399 return (DW_DLV_NO_ENTRY);
400 }
401
402 return (DW_DLV_OK);
403 }
404
405 int
dwarf_get_CHILDREN_name(unsigned children,const char ** s)406 dwarf_get_CHILDREN_name(unsigned children, const char **s)
407 {
408
409 assert(s != NULL);
410
411 switch (children) {
412 case DW_CHILDREN_no:
413 *s = "DW_CHILDREN_no"; break;
414 case DW_CHILDREN_yes:
415 *s = "DW_CHILDREN_yes"; break;
416 default:
417 return (DW_DLV_NO_ENTRY);
418 }
419
420 return (DW_DLV_OK);
421 }
422
423 int
dwarf_get_FORM_name(unsigned form,const char ** s)424 dwarf_get_FORM_name(unsigned form, const char **s)
425 {
426
427 assert(s != NULL);
428
429 switch (form) {
430 case DW_FORM_addr:
431 *s = "DW_FORM_addr"; break;
432 case DW_FORM_block:
433 *s = "DW_FORM_block"; break;
434 case DW_FORM_block1:
435 *s = "DW_FORM_block1"; break;
436 case DW_FORM_block2:
437 *s = "DW_FORM_block2"; break;
438 case DW_FORM_block4:
439 *s = "DW_FORM_block4"; break;
440 case DW_FORM_data1:
441 *s = "DW_FORM_data1"; break;
442 case DW_FORM_data2:
443 *s = "DW_FORM_data2"; break;
444 case DW_FORM_data4:
445 *s = "DW_FORM_data4"; break;
446 case DW_FORM_data8:
447 *s = "DW_FORM_data8"; break;
448 case DW_FORM_exprloc:
449 *s = "DW_FORM_exprloc"; break;
450 case DW_FORM_flag:
451 *s = "DW_FORM_flag"; break;
452 case DW_FORM_flag_present:
453 *s = "DW_FORM_flag_present"; break;
454 case DW_FORM_indirect:
455 *s = "DW_FORM_indirect"; break;
456 case DW_FORM_ref1:
457 *s = "DW_FORM_ref1"; break;
458 case DW_FORM_ref2:
459 *s = "DW_FORM_ref2"; break;
460 case DW_FORM_ref4:
461 *s = "DW_FORM_ref4"; break;
462 case DW_FORM_ref8:
463 *s = "DW_FORM_ref8"; break;
464 case DW_FORM_ref_addr:
465 *s = "DW_FORM_ref_addr"; break;
466 case DW_FORM_ref_sig8:
467 *s = "DW_FORM_ref_sig8"; break;
468 case DW_FORM_ref_udata:
469 *s = "DW_FORM_ref_udata"; break;
470 case DW_FORM_sdata:
471 *s = "DW_FORM_sdata"; break;
472 case DW_FORM_sec_offset:
473 *s = "DW_FORM_sec_offset"; break;
474 case DW_FORM_string:
475 *s = "DW_FORM_string"; break;
476 case DW_FORM_strp:
477 *s = "DW_FORM_strp"; break;
478 case DW_FORM_udata:
479 *s = "DW_FORM_udata"; break;
480 default:
481 return (DW_DLV_NO_ENTRY);
482 }
483
484 return (DW_DLV_OK);
485 }
486
487 int
dwarf_get_DS_name(unsigned ds,const char ** s)488 dwarf_get_DS_name(unsigned ds, const char **s)
489 {
490
491 assert(s != NULL);
492
493 switch (ds) {
494 case DW_DS_unsigned:
495 *s = "DW_DS_unsigned"; break;
496 case DW_DS_leading_overpunch:
497 *s = "DW_DS_leading_overpunch"; break;
498 case DW_DS_trailing_overpunch:
499 *s = "DW_DS_trailing_overpunch"; break;
500 case DW_DS_leading_separate:
501 *s = "DW_DS_leading_separate"; break;
502 case DW_DS_trailing_separate:
503 *s = "DW_DS_trailing_separate";
504 default:
505 return (DW_DLV_NO_ENTRY);
506 }
507
508 return (DW_DLV_OK);
509 }
510
511 int
dwarf_get_DSC_name(unsigned dsc,const char ** s)512 dwarf_get_DSC_name(unsigned dsc, const char **s)
513 {
514
515 assert(s != NULL);
516
517 switch (dsc) {
518 case DW_DSC_label:
519 *s = "DW_DSC_label"; break;
520 case DW_DSC_range:
521 *s = "DW_DSC_range"; break;
522 default:
523 return (DW_DLV_NO_ENTRY);
524 }
525
526 return (DW_DLV_OK);
527 }
528
529 int
dwarf_get_EH_name(unsigned eh,const char ** s)530 dwarf_get_EH_name(unsigned eh, const char **s)
531 {
532
533 assert(s != NULL);
534
535 switch (eh) {
536 case DW_EH_PE_absptr:
537 *s = "DW_EH_PE_absptr"; break;
538 case DW_EH_PE_uleb128:
539 *s = "DW_EH_PE_uleb128"; break;
540 case DW_EH_PE_udata2:
541 *s = "DW_EH_PE_udata2"; break;
542 case DW_EH_PE_udata4:
543 *s = "DW_EH_PE_udata4"; break;
544 case DW_EH_PE_udata8:
545 *s = "DW_EH_PE_udata8"; break;
546 case DW_EH_PE_sleb128:
547 *s = "DW_EH_PE_sleb128"; break;
548 case DW_EH_PE_sdata2:
549 *s = "DW_EH_PE_sdata2"; break;
550 case DW_EH_PE_sdata4:
551 *s = "DW_EH_PE_sdata4"; break;
552 case DW_EH_PE_sdata8:
553 *s = "DW_EH_PE_sdata8"; break;
554 case DW_EH_PE_pcrel:
555 *s = "DW_EH_PE_pcrel"; break;
556 case DW_EH_PE_textrel:
557 *s = "DW_EH_PE_textrel"; break;
558 case DW_EH_PE_datarel:
559 *s = "DW_EH_PE_datarel"; break;
560 case DW_EH_PE_funcrel:
561 *s = "DW_EH_PE_funcrel"; break;
562 case DW_EH_PE_aligned:
563 *s = "DW_EH_PE_aligned"; break;
564 case DW_EH_PE_omit:
565 *s = "DW_EH_PE_omit"; break;
566 default:
567 return (DW_DLV_NO_ENTRY);
568 }
569
570 return (DW_DLV_OK);
571 }
572
573 int
dwarf_get_END_name(unsigned end,const char ** s)574 dwarf_get_END_name(unsigned end, const char **s)
575 {
576
577 assert(s != NULL);
578
579 switch (end) {
580 case DW_END_default:
581 *s = "DW_END_default"; break;
582 case DW_END_big:
583 *s = "DW_END_big"; break;
584 case DW_END_little:
585 *s = "DW_END_little"; break;
586 case DW_END_lo_user:
587 *s = "DW_END_lo_user"; break;
588 case DW_END_high_user:
589 *s = "DW_END_high_user"; break;
590 default:
591 return (DW_DLV_NO_ENTRY);
592 }
593
594 return (DW_DLV_OK);
595 }
596
597 int
dwarf_get_ID_name(unsigned id,const char ** s)598 dwarf_get_ID_name(unsigned id, const char **s)
599 {
600
601 assert(s != NULL);
602
603 switch (id) {
604 case DW_ID_case_sensitive:
605 *s = "DW_ID_case_sensitive"; break;
606 case DW_ID_up_case:
607 *s = "DW_ID_up_case"; break;
608 case DW_ID_down_case:
609 *s = "DW_ID_down_case"; break;
610 case DW_ID_case_insensitive:
611 *s = "DW_ID_case_insensitive"; break;
612 default:
613 return (DW_DLV_NO_ENTRY);
614 }
615
616 return (DW_DLV_OK);
617 }
618
619 int
dwarf_get_INL_name(unsigned inl,const char ** s)620 dwarf_get_INL_name(unsigned inl, const char **s)
621 {
622
623 assert(s != NULL);
624
625 switch (inl) {
626 case DW_INL_not_inlined:
627 *s = "DW_INL_not_inlined"; break;
628 case DW_INL_inlined:
629 *s = "DW_INL_inlined"; break;
630 case DW_INL_declared_not_inlined:
631 *s = "DW_INL_declared_not_inlined"; break;
632 case DW_INL_declared_inlined:
633 *s = "DW_INL_declared_inlined"; break;
634 default:
635 return (DW_DLV_NO_ENTRY);
636 }
637
638 return (DW_DLV_OK);
639 }
640
641 int
dwarf_get_LANG_name(unsigned lang,const char ** s)642 dwarf_get_LANG_name(unsigned lang, const char **s)
643 {
644
645 assert(s != NULL);
646
647 switch (lang) {
648 case DW_LANG_C89:
649 *s = "DW_LANG_C89"; break;
650 case DW_LANG_C:
651 *s = "DW_LANG_C"; break;
652 case DW_LANG_Ada83:
653 *s = "DW_LANG_Ada83"; break;
654 case DW_LANG_C_plus_plus:
655 *s = "DW_LANG_C_plus_plus"; break;
656 case DW_LANG_Cobol74:
657 *s = "DW_LANG_Cobol74"; break;
658 case DW_LANG_Cobol85:
659 *s = "DW_LANG_Cobol85"; break;
660 case DW_LANG_Fortran77:
661 *s = "DW_LANG_Fortran77"; break;
662 case DW_LANG_Fortran90:
663 *s = "DW_LANG_Fortran90"; break;
664 case DW_LANG_Pascal83:
665 *s = "DW_LANG_Pascal83"; break;
666 case DW_LANG_Modula2:
667 *s = "DW_LANG_Modula2"; break;
668 case DW_LANG_Java:
669 *s = "DW_LANG_Java"; break;
670 case DW_LANG_C99:
671 *s = "DW_LANG_C99"; break;
672 case DW_LANG_Ada95:
673 *s = "DW_LANG_Ada95"; break;
674 case DW_LANG_Fortran95:
675 *s = "DW_LANG_Fortran95"; break;
676 case DW_LANG_PLI:
677 *s = "DW_LANG_PLI"; break;
678 case DW_LANG_ObjC:
679 *s = "DW_LANG_ObjC"; break;
680 case DW_LANG_ObjC_plus_plus:
681 *s = "DW_LANG_ObjC_plus_plus"; break;
682 case DW_LANG_UPC:
683 *s = "DW_LANG_UPC"; break;
684 case DW_LANG_D:
685 *s = "DW_LANG_D"; break;
686 case DW_LANG_lo_user:
687 *s = "DW_LANG_lo_user"; break;
688 case DW_LANG_hi_user:
689 *s = "DW_LANG_hi_user"; break;
690 default:
691 return (DW_DLV_NO_ENTRY);
692 }
693
694 return (DW_DLV_OK);
695 }
696
697 int
dwarf_get_LNE_name(unsigned lne,const char ** s)698 dwarf_get_LNE_name(unsigned lne, const char **s)
699 {
700
701 assert(s != NULL);
702
703 switch (lne) {
704 case DW_LNE_end_sequence:
705 *s = "DW_LNE_end_sequence"; break;
706 case DW_LNE_set_address:
707 *s = "DW_LNE_set_address"; break;
708 case DW_LNE_define_file:
709 *s = "DW_LNE_define_file"; break;
710 case DW_LNE_lo_user:
711 *s = "DW_LNE_lo_user"; break;
712 case DW_LNE_hi_user:
713 *s = "DW_LNE_hi_user"; break;
714 default:
715 return (DW_DLV_NO_ENTRY);
716 }
717
718 return (DW_DLV_OK);
719 }
720
721 int
dwarf_get_LNS_name(unsigned lns,const char ** s)722 dwarf_get_LNS_name(unsigned lns, const char **s)
723 {
724
725 assert(s != NULL);
726
727 switch (lns) {
728 case DW_LNS_copy:
729 *s = "DW_LNS_copy"; break;
730 case DW_LNS_advance_pc:
731 *s = "DW_LNS_advance_pc"; break;
732 case DW_LNS_advance_line:
733 *s = "DW_LNS_advance_line"; break;
734 case DW_LNS_set_file:
735 *s = "DW_LNS_set_file"; break;
736 case DW_LNS_set_column:
737 *s = "DW_LNS_set_column"; break;
738 case DW_LNS_negate_stmt:
739 *s = "DW_LNS_negate_stmt"; break;
740 case DW_LNS_set_basic_block:
741 *s = "DW_LNS_set_basic_block"; break;
742 case DW_LNS_const_add_pc:
743 *s = "DW_LNS_const_add_pc"; break;
744 case DW_LNS_fixed_advance_pc:
745 *s = "DW_LNS_fixed_advance_pc"; break;
746 case DW_LNS_set_prologue_end:
747 *s = "DW_LNS_set_prologue_end"; break;
748 case DW_LNS_set_epilogue_begin:
749 *s = "DW_LNS_set_epilogue_begin"; break;
750 case DW_LNS_set_isa:
751 *s = "DW_LNS_set_isa"; break;
752 default:
753 return (DW_DLV_NO_ENTRY);
754 }
755
756 return (DW_DLV_OK);
757 }
758
759 int
dwarf_get_MACINFO_name(unsigned mi,const char ** s)760 dwarf_get_MACINFO_name(unsigned mi, const char **s)
761 {
762
763 assert(s != NULL);
764
765 switch (mi) {
766 case DW_MACINFO_define:
767 *s = "DW_MACINFO_define"; break;
768 case DW_MACINFO_undef:
769 *s = "DW_MACINFO_undef"; break;
770 case DW_MACINFO_start_file:
771 *s = "DW_MACINFO_start_file"; break;
772 case DW_MACINFO_end_file:
773 *s = "DW_MACINFO_end_file"; break;
774 case DW_MACINFO_vendor_ext:
775 *s = "DW_MACINFO_vendor_ext"; break;
776 default:
777 return (DW_DLV_NO_ENTRY);
778 }
779
780 return (DW_DLV_OK);
781 }
782
783 int
dwarf_get_OP_name(unsigned op,const char ** s)784 dwarf_get_OP_name(unsigned op, const char **s)
785 {
786
787 assert(s != NULL);
788
789 switch (op) {
790 case DW_OP_deref:
791 *s = "DW_OP_deref"; break;
792 case DW_OP_reg0:
793 *s = "DW_OP_reg0"; break;
794 case DW_OP_reg1:
795 *s = "DW_OP_reg1"; break;
796 case DW_OP_reg2:
797 *s = "DW_OP_reg2"; break;
798 case DW_OP_reg3:
799 *s = "DW_OP_reg3"; break;
800 case DW_OP_reg4:
801 *s = "DW_OP_reg4"; break;
802 case DW_OP_reg5:
803 *s = "DW_OP_reg5"; break;
804 case DW_OP_reg6:
805 *s = "DW_OP_reg6"; break;
806 case DW_OP_reg7:
807 *s = "DW_OP_reg7"; break;
808 case DW_OP_reg8:
809 *s = "DW_OP_reg8"; break;
810 case DW_OP_reg9:
811 *s = "DW_OP_reg9"; break;
812 case DW_OP_reg10:
813 *s = "DW_OP_reg10"; break;
814 case DW_OP_reg11:
815 *s = "DW_OP_reg11"; break;
816 case DW_OP_reg12:
817 *s = "DW_OP_reg12"; break;
818 case DW_OP_reg13:
819 *s = "DW_OP_reg13"; break;
820 case DW_OP_reg14:
821 *s = "DW_OP_reg14"; break;
822 case DW_OP_reg15:
823 *s = "DW_OP_reg15"; break;
824 case DW_OP_reg16:
825 *s = "DW_OP_reg16"; break;
826 case DW_OP_reg17:
827 *s = "DW_OP_reg17"; break;
828 case DW_OP_reg18:
829 *s = "DW_OP_reg18"; break;
830 case DW_OP_reg19:
831 *s = "DW_OP_reg19"; break;
832 case DW_OP_reg20:
833 *s = "DW_OP_reg20"; break;
834 case DW_OP_reg21:
835 *s = "DW_OP_reg21"; break;
836 case DW_OP_reg22:
837 *s = "DW_OP_reg22"; break;
838 case DW_OP_reg23:
839 *s = "DW_OP_reg23"; break;
840 case DW_OP_reg24:
841 *s = "DW_OP_reg24"; break;
842 case DW_OP_reg25:
843 *s = "DW_OP_reg25"; break;
844 case DW_OP_reg26:
845 *s = "DW_OP_reg26"; break;
846 case DW_OP_reg27:
847 *s = "DW_OP_reg27"; break;
848 case DW_OP_reg28:
849 *s = "DW_OP_reg28"; break;
850 case DW_OP_reg29:
851 *s = "DW_OP_reg29"; break;
852 case DW_OP_reg30:
853 *s = "DW_OP_reg30"; break;
854 case DW_OP_reg31:
855 *s = "DW_OP_reg31"; break;
856 case DW_OP_lit0:
857 *s = "DW_OP_lit0"; break;
858 case DW_OP_lit1:
859 *s = "DW_OP_lit1"; break;
860 case DW_OP_lit2:
861 *s = "DW_OP_lit2"; break;
862 case DW_OP_lit3:
863 *s = "DW_OP_lit3"; break;
864 case DW_OP_lit4:
865 *s = "DW_OP_lit4"; break;
866 case DW_OP_lit5:
867 *s = "DW_OP_lit5"; break;
868 case DW_OP_lit6:
869 *s = "DW_OP_lit6"; break;
870 case DW_OP_lit7:
871 *s = "DW_OP_lit7"; break;
872 case DW_OP_lit8:
873 *s = "DW_OP_lit8"; break;
874 case DW_OP_lit9:
875 *s = "DW_OP_lit9"; break;
876 case DW_OP_lit10:
877 *s = "DW_OP_lit10"; break;
878 case DW_OP_lit11:
879 *s = "DW_OP_lit11"; break;
880 case DW_OP_lit12:
881 *s = "DW_OP_lit12"; break;
882 case DW_OP_lit13:
883 *s = "DW_OP_lit13"; break;
884 case DW_OP_lit14:
885 *s = "DW_OP_lit14"; break;
886 case DW_OP_lit15:
887 *s = "DW_OP_lit15"; break;
888 case DW_OP_lit16:
889 *s = "DW_OP_lit16"; break;
890 case DW_OP_lit17:
891 *s = "DW_OP_lit17"; break;
892 case DW_OP_lit18:
893 *s = "DW_OP_lit18"; break;
894 case DW_OP_lit19:
895 *s = "DW_OP_lit19"; break;
896 case DW_OP_lit20:
897 *s = "DW_OP_lit20"; break;
898 case DW_OP_lit21:
899 *s = "DW_OP_lit21"; break;
900 case DW_OP_lit22:
901 *s = "DW_OP_lit22"; break;
902 case DW_OP_lit23:
903 *s = "DW_OP_lit23"; break;
904 case DW_OP_lit24:
905 *s = "DW_OP_lit24"; break;
906 case DW_OP_lit25:
907 *s = "DW_OP_lit25"; break;
908 case DW_OP_lit26:
909 *s = "DW_OP_lit26"; break;
910 case DW_OP_lit27:
911 *s = "DW_OP_lit27"; break;
912 case DW_OP_lit28:
913 *s = "DW_OP_lit28"; break;
914 case DW_OP_lit29:
915 *s = "DW_OP_lit29"; break;
916 case DW_OP_lit30:
917 *s = "DW_OP_lit30"; break;
918 case DW_OP_lit31:
919 *s = "DW_OP_lit31"; break;
920 case DW_OP_dup:
921 *s = "DW_OP_dup"; break;
922 case DW_OP_drop:
923 *s = "DW_OP_drop"; break;
924 case DW_OP_over:
925 *s = "DW_OP_over"; break;
926 case DW_OP_swap:
927 *s = "DW_OP_swap"; break;
928 case DW_OP_rot:
929 *s = "DW_OP_rot"; break;
930 case DW_OP_xderef:
931 *s = "DW_OP_xderef"; break;
932 case DW_OP_abs:
933 *s = "DW_OP_abs"; break;
934 case DW_OP_and:
935 *s = "DW_OP_and"; break;
936 case DW_OP_div:
937 *s = "DW_OP_div"; break;
938 case DW_OP_minus:
939 *s = "DW_OP_minus"; break;
940 case DW_OP_mod:
941 *s = "DW_OP_mod"; break;
942 case DW_OP_mul:
943 *s = "DW_OP_mul"; break;
944 case DW_OP_neg:
945 *s = "DW_OP_neg"; break;
946 case DW_OP_not:
947 *s = "DW_OP_not"; break;
948 case DW_OP_or:
949 *s = "DW_OP_or"; break;
950 case DW_OP_plus:
951 *s = "DW_OP_plus"; break;
952 case DW_OP_shl:
953 *s = "DW_OP_shl"; break;
954 case DW_OP_shr:
955 *s = "DW_OP_shr"; break;
956 case DW_OP_shra:
957 *s = "DW_OP_shra"; break;
958 case DW_OP_xor:
959 *s = "DW_OP_xor"; break;
960 case DW_OP_eq:
961 *s = "DW_OP_eq"; break;
962 case DW_OP_ge:
963 *s = "DW_OP_ge"; break;
964 case DW_OP_gt:
965 *s = "DW_OP_gt"; break;
966 case DW_OP_le:
967 *s = "DW_OP_le"; break;
968 case DW_OP_lt:
969 *s = "DW_OP_lt"; break;
970 case DW_OP_ne:
971 *s = "DW_OP_ne"; break;
972 case DW_OP_nop:
973 *s = "DW_OP_nop"; break;
974 case DW_OP_const1u:
975 *s = "DW_OP_const1u"; break;
976 case DW_OP_const1s:
977 *s = "DW_OP_const1s"; break;
978 case DW_OP_pick:
979 *s = "DW_OP_pick"; break;
980 case DW_OP_deref_size:
981 *s = "DW_OP_deref_size"; break;
982 case DW_OP_xderef_size:
983 *s = "DW_OP_xderef_size"; break;
984 case DW_OP_const2u:
985 *s = "DW_OP_const2u"; break;
986 case DW_OP_const2s:
987 *s = "DW_OP_const2s"; break;
988 case DW_OP_bra:
989 *s = "DW_OP_bra"; break;
990 case DW_OP_skip:
991 *s = "DW_OP_skip"; break;
992 case DW_OP_const4u:
993 *s = "DW_OP_const4u"; break;
994 case DW_OP_const4s:
995 *s = "DW_OP_const4s"; break;
996 case DW_OP_const8u:
997 *s = "DW_OP_const8u"; break;
998 case DW_OP_const8s:
999 *s = "DW_OP_const8s"; break;
1000 case DW_OP_constu:
1001 *s = "DW_OP_constu"; break;
1002 case DW_OP_plus_uconst:
1003 *s = "DW_OP_plus_uconst"; break;
1004 case DW_OP_regx:
1005 *s = "DW_OP_regx"; break;
1006 case DW_OP_piece:
1007 *s = "DW_OP_piece"; break;
1008 case DW_OP_consts:
1009 *s = "DW_OP_consts"; break;
1010 case DW_OP_breg0:
1011 *s = "DW_OP_breg0"; break;
1012 case DW_OP_breg1:
1013 *s = "DW_OP_breg1"; break;
1014 case DW_OP_breg2:
1015 *s = "DW_OP_breg2"; break;
1016 case DW_OP_breg3:
1017 *s = "DW_OP_breg3"; break;
1018 case DW_OP_breg4:
1019 *s = "DW_OP_breg4"; break;
1020 case DW_OP_breg5:
1021 *s = "DW_OP_breg5"; break;
1022 case DW_OP_breg6:
1023 *s = "DW_OP_breg6"; break;
1024 case DW_OP_breg7:
1025 *s = "DW_OP_breg7"; break;
1026 case DW_OP_breg8:
1027 *s = "DW_OP_breg8"; break;
1028 case DW_OP_breg9:
1029 *s = "DW_OP_breg9"; break;
1030 case DW_OP_breg10:
1031 *s = "DW_OP_breg10"; break;
1032 case DW_OP_breg11:
1033 *s = "DW_OP_breg11"; break;
1034 case DW_OP_breg12:
1035 *s = "DW_OP_breg12"; break;
1036 case DW_OP_breg13:
1037 *s = "DW_OP_breg13"; break;
1038 case DW_OP_breg14:
1039 *s = "DW_OP_breg14"; break;
1040 case DW_OP_breg15:
1041 *s = "DW_OP_breg15"; break;
1042 case DW_OP_breg16:
1043 *s = "DW_OP_breg16"; break;
1044 case DW_OP_breg17:
1045 *s = "DW_OP_breg17"; break;
1046 case DW_OP_breg18:
1047 *s = "DW_OP_breg18"; break;
1048 case DW_OP_breg19:
1049 *s = "DW_OP_breg19"; break;
1050 case DW_OP_breg20:
1051 *s = "DW_OP_breg20"; break;
1052 case DW_OP_breg21:
1053 *s = "DW_OP_breg21"; break;
1054 case DW_OP_breg22:
1055 *s = "DW_OP_breg22"; break;
1056 case DW_OP_breg23:
1057 *s = "DW_OP_breg23"; break;
1058 case DW_OP_breg24:
1059 *s = "DW_OP_breg24"; break;
1060 case DW_OP_breg25:
1061 *s = "DW_OP_breg25"; break;
1062 case DW_OP_breg26:
1063 *s = "DW_OP_breg26"; break;
1064 case DW_OP_breg27:
1065 *s = "DW_OP_breg27"; break;
1066 case DW_OP_breg28:
1067 *s = "DW_OP_breg28"; break;
1068 case DW_OP_breg29:
1069 *s = "DW_OP_breg29"; break;
1070 case DW_OP_breg30:
1071 *s = "DW_OP_breg30"; break;
1072 case DW_OP_breg31:
1073 *s = "DW_OP_breg31"; break;
1074 case DW_OP_fbreg:
1075 *s = "DW_OP_fbreg"; break;
1076 case DW_OP_bregx:
1077 *s = "DW_OP_bregx"; break;
1078 case DW_OP_addr:
1079 *s = "DW_OP_addr"; break;
1080 case DW_OP_push_object_address:
1081 *s = "DW_OP_push_object_address"; break;
1082 case DW_OP_call2:
1083 *s = "DW_OP_call2"; break;
1084 case DW_OP_call4:
1085 *s = "DW_OP_call4"; break;
1086 case DW_OP_call_ref:
1087 *s = "DW_OP_call_ref"; break;
1088 case DW_OP_form_tls_address:
1089 *s = "DW_OP_form_tls_address"; break;
1090 case DW_OP_call_frame_cfa:
1091 *s = "DW_OP_call_frame_cfa"; break;
1092 case DW_OP_bit_piece:
1093 *s = "DW_OP_bit_piece"; break;
1094 case DW_OP_implicit_value:
1095 *s = "DW_OP_implicit_value"; break;
1096 case DW_OP_stack_value:
1097 *s = "DW_OP_stack_value"; break;
1098 case DW_OP_GNU_push_tls_address:
1099 *s = "DW_OP_GNU_push_tls_address"; break;
1100 default:
1101 return (DW_DLV_NO_ENTRY);
1102 }
1103
1104 return (DW_DLV_OK);
1105 }
1106
1107 int
dwarf_get_ORD_name(unsigned ord,const char ** s)1108 dwarf_get_ORD_name(unsigned ord, const char **s)
1109 {
1110
1111 assert(s != NULL);
1112
1113 switch (ord) {
1114 case DW_ORD_row_major:
1115 *s = "DW_ORD_row_major"; break;
1116 case DW_ORD_col_major:
1117 *s = "DW_ORD_col_major"; break;
1118 default:
1119 return (DW_DLV_NO_ENTRY);
1120 }
1121
1122 return (DW_DLV_OK);
1123 }
1124
1125 int
dwarf_get_TAG_name(unsigned tag,const char ** s)1126 dwarf_get_TAG_name(unsigned tag, const char **s)
1127 {
1128
1129 assert(s != NULL);
1130
1131 switch (tag) {
1132 case DW_TAG_access_declaration:
1133 *s = "DW_TAG_access_declaration"; break;
1134 case DW_TAG_array_type:
1135 *s = "DW_TAG_array_type"; break;
1136 case DW_TAG_base_type:
1137 *s = "DW_TAG_base_type"; break;
1138 case DW_TAG_catch_block:
1139 *s = "DW_TAG_catch_block"; break;
1140 case DW_TAG_class_type:
1141 *s = "DW_TAG_class_type"; break;
1142 case DW_TAG_common_block:
1143 *s = "DW_TAG_common_block"; break;
1144 case DW_TAG_common_inclusion:
1145 *s = "DW_TAG_common_inclusion"; break;
1146 case DW_TAG_compile_unit:
1147 *s = "DW_TAG_compile_unit"; break;
1148 case DW_TAG_condition:
1149 *s = "DW_TAG_condition"; break;
1150 case DW_TAG_const_type:
1151 *s = "DW_TAG_const_type"; break;
1152 case DW_TAG_constant:
1153 *s = "DW_TAG_constant"; break;
1154 case DW_TAG_dwarf_procedure:
1155 *s = "DW_TAG_dwarf_procedure"; break;
1156 case DW_TAG_entry_point:
1157 *s = "DW_TAG_entry_point"; break;
1158 case DW_TAG_enumeration_type:
1159 *s = "DW_TAG_enumeration_type"; break;
1160 case DW_TAG_enumerator:
1161 *s = "DW_TAG_enumerator"; break;
1162 case DW_TAG_formal_parameter:
1163 *s = "DW_TAG_formal_parameter"; break;
1164 case DW_TAG_friend:
1165 *s = "DW_TAG_friend"; break;
1166 case DW_TAG_imported_declaration:
1167 *s = "DW_TAG_imported_declaration"; break;
1168 case DW_TAG_imported_module:
1169 *s = "DW_TAG_imported_module"; break;
1170 case DW_TAG_imported_unit:
1171 *s = "DW_TAG_imported_unit"; break;
1172 case DW_TAG_inheritance:
1173 *s = "DW_TAG_inheritance"; break;
1174 case DW_TAG_inlined_subroutine:
1175 *s = "DW_TAG_inlined_subroutine"; break;
1176 case DW_TAG_interface_type:
1177 *s = "DW_TAG_interface_type"; break;
1178 case DW_TAG_label:
1179 *s = "DW_TAG_label"; break;
1180 case DW_TAG_lexical_block:
1181 *s = "DW_TAG_lexical_block"; break;
1182 case DW_TAG_member:
1183 *s = "DW_TAG_member"; break;
1184 case DW_TAG_module:
1185 *s = "DW_TAG_module"; break;
1186 case DW_TAG_namelist:
1187 *s = "DW_TAG_namelist"; break;
1188 case DW_TAG_namelist_item:
1189 *s = "DW_TAG_namelist_item"; break;
1190 case DW_TAG_namespace:
1191 *s = "DW_TAG_namespace"; break;
1192 case DW_TAG_packed_type:
1193 *s = "DW_TAG_packed_type"; break;
1194 case DW_TAG_partial_unit:
1195 *s = "DW_TAG_partial_unit"; break;
1196 case DW_TAG_pointer_type:
1197 *s = "DW_TAG_pointer_type"; break;
1198 case DW_TAG_ptr_to_member_type:
1199 *s = "DW_TAG_ptr_to_member_type"; break;
1200 case DW_TAG_reference_type:
1201 *s = "DW_TAG_reference_type"; break;
1202 case DW_TAG_restrict_type:
1203 *s = "DW_TAG_restrict_type"; break;
1204 case DW_TAG_rvalue_reference_type:
1205 *s = "DW_TAG_rvalue_reference_type"; break;
1206 case DW_TAG_set_type:
1207 *s = "DW_TAG_set_type"; break;
1208 case DW_TAG_shared_type:
1209 *s = "DW_TAG_shared_type"; break;
1210 case DW_TAG_string_type:
1211 *s = "DW_TAG_string_type"; break;
1212 case DW_TAG_structure_type:
1213 *s = "DW_TAG_structure_type"; break;
1214 case DW_TAG_subprogram:
1215 *s = "DW_TAG_subprogram"; break;
1216 case DW_TAG_subrange_type:
1217 *s = "DW_TAG_subrange_type"; break;
1218 case DW_TAG_subroutine_type:
1219 *s = "DW_TAG_subroutine_type"; break;
1220 case DW_TAG_template_alias:
1221 *s = "DW_TAG_template_alias"; break;
1222 case DW_TAG_template_type_parameter:
1223 *s = "DW_TAG_template_type_parameter"; break;
1224 case DW_TAG_template_value_parameter:
1225 *s = "DW_TAG_template_value_parameter"; break;
1226 case DW_TAG_thrown_type:
1227 *s = "DW_TAG_thrown_type"; break;
1228 case DW_TAG_try_block:
1229 *s = "DW_TAG_try_block"; break;
1230 case DW_TAG_type_unit:
1231 *s = "DW_TAG_type_unit"; break;
1232 case DW_TAG_typedef:
1233 *s = "DW_TAG_typedef"; break;
1234 case DW_TAG_union_type:
1235 *s = "DW_TAG_union_type"; break;
1236 case DW_TAG_unspecified_parameters:
1237 *s = "DW_TAG_unspecified_parameters"; break;
1238 case DW_TAG_unspecified_type:
1239 *s = "DW_TAG_unspecified_type"; break;
1240 case DW_TAG_variable:
1241 *s = "DW_TAG_variable"; break;
1242 case DW_TAG_variant:
1243 *s = "DW_TAG_variant"; break;
1244 case DW_TAG_variant_part:
1245 *s = "DW_TAG_variant_part"; break;
1246 case DW_TAG_volatile_type:
1247 *s = "DW_TAG_volatile_type"; break;
1248 case DW_TAG_with_stmt:
1249 *s = "DW_TAG_with_stmt"; break;
1250 default:
1251 return (DW_DLV_NO_ENTRY);
1252 }
1253
1254 return (DW_DLV_OK);
1255 }
1256
1257 int
dwarf_get_VIRTUALITY_name(unsigned vir,const char ** s)1258 dwarf_get_VIRTUALITY_name(unsigned vir, const char **s)
1259 {
1260
1261 assert(s != NULL);
1262
1263 switch (vir) {
1264 case DW_VIRTUALITY_none:
1265 *s = "DW_VIRTUALITY_none"; break;
1266 case DW_VIRTUALITY_virtual:
1267 *s = "DW_VIRTUALITY_virtual"; break;
1268 case DW_VIRTUALITY_pure_virtual:
1269 *s = "DW_VIRTUALITY_pure_virtual"; break;
1270 default:
1271 return (DW_DLV_NO_ENTRY);
1272 }
1273
1274 return (DW_DLV_OK);
1275 }
1276
1277 int
dwarf_get_VIS_name(unsigned vis,const char ** s)1278 dwarf_get_VIS_name(unsigned vis, const char **s)
1279 {
1280
1281 assert(s != NULL);
1282
1283 switch (vis) {
1284 case DW_VIS_local:
1285 *s = "DW_VIS_local"; break;
1286 case DW_VIS_exported:
1287 *s = "DW_VIS_exported"; break;
1288 case DW_VIS_qualified:
1289 *s = "DW_VIS_qualified"; break;
1290 default:
1291 return (DW_DLV_NO_ENTRY);
1292 }
1293
1294 return (DW_DLV_OK);
1295 }
1296