1 /* $NetBSD: dwarf_dump.c,v 1.2 2014/03/09 16:58:03 christos Exp $ */
4 * Copyright (c) 2007 John Birrell (jb@freebsd.org)
5 * Copyright (c) 2009 Kai Wang
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
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.
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
30 #include "_libdwarf.h"
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 ");
36 dwarf_get_ACCESS_name(unsigned access
, const char **s
)
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;
49 return (DW_DLV_NO_ENTRY
);
56 dwarf_get_AT_name(unsigned attr
, const char **s
)
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;
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;
81 *s
= "DW_AT_bit_size"; break;
82 case DW_AT_bit_stride
:
83 *s
= "DW_AT_bit_stride"; break;
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;
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;
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;
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;
141 *s
= "DW_AT_encoding"; break;
142 case DW_AT_enum_class
:
143 *s
= "DW_AT_enum_class"; break;
145 *s
= "DW_AT_external"; break;
147 *s
= "DW_AT_entry_pc"; break;
148 case DW_AT_extension
:
149 *s
= "DW_AT_extension"; break;
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;
159 *s
= "DW_AT_friend"; break;
161 *s
= "DW_AT_high_pc"; break;
163 *s
= "DW_AT_hi_user"; break;
164 case DW_AT_identifier_case
:
165 *s
= "DW_AT_identifier_case"; break;
167 *s
= "DW_AT_import"; break;
169 *s
= "DW_AT_inline"; break;
170 case DW_AT_is_optional
:
171 *s
= "DW_AT_is_optional"; break;
173 *s
= "DW_AT_language"; break;
174 case DW_AT_linkage_name
:
175 *s
= "DW_AT_linkage_name"; break;
177 *s
= "DW_AT_lo_user"; break;
179 *s
= "DW_AT_location"; break;
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;
189 *s
= "DW_AT_mutable"; break;
191 *s
= "DW_AT_member"; break;
193 *s
= "DW_AT_name"; break;
194 case DW_AT_namelist_item
:
195 *s
= "DW_AT_namelist_item"; break;
197 *s
= "DW_AT_ordering"; break;
198 case DW_AT_object_pointer
:
199 *s
= "DW_AT_object_pointer"; break;
201 *s
= "DW_AT_priority"; break;
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;
209 *s
= "DW_AT_pure"; break;
210 case DW_AT_return_addr
:
211 *s
= "DW_AT_return_addr"; break;
213 *s
= "DW_AT_ranges"; break;
214 case DW_AT_recursive
:
215 *s
= "DW_AT_recursive"; break;
217 *s
= "DW_AT_segment"; break;
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;
235 *s
= "DW_AT_small"; break;
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;
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;
257 return (DW_DLV_NO_ENTRY
);
264 dwarf_get_ATE_name(unsigned ate
, const char **s
)
271 *s
= "DW_ATE_address"; break;
273 *s
= "DW_ATE_boolean"; break;
274 case DW_ATE_complex_float
:
275 *s
= "DW_ATE_complex_float"; break;
277 *s
= "DW_ATE_float"; break;
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;
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;
301 *s
= "DW_ATE_lo_user"; break;
303 *s
= "DW_ATE_hi_user"; break;
305 return (DW_DLV_NO_ENTRY
);
312 dwarf_get_CC_name(unsigned cc
, const char **s
)
319 *s
= "DW_CC_normal"; break;
321 *s
= "DW_CC_program"; break;
323 *s
= "DW_CC_nocall"; break;
325 *s
= "DW_CC_lo_user"; break;
327 *s
= "DW_CC_hi_user"; break;
329 return (DW_DLV_NO_ENTRY
);
336 dwarf_get_CFA_name(unsigned cfa
, const char **s
)
342 case DW_CFA_advance_loc
:
343 *s
= "DW_CFA_advance_loc"; break;
345 *s
= "DW_CFA_offset"; break;
347 *s
= "DW_CFA_restore"; break;
349 *s
= "DW_CFA_nop"; break;
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;
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;
395 *s
= "DW_CFA_lo_user"; break;
396 case DW_CFA_high_user
:
397 *s
= "DW_CFA_high_user"; break;
399 return (DW_DLV_NO_ENTRY
);
406 dwarf_get_CHILDREN_name(unsigned children
, const char **s
)
413 *s
= "DW_CHILDREN_no"; break;
414 case DW_CHILDREN_yes
:
415 *s
= "DW_CHILDREN_yes"; break;
417 return (DW_DLV_NO_ENTRY
);
424 dwarf_get_FORM_name(unsigned form
, const char **s
)
431 *s
= "DW_FORM_addr"; break;
433 *s
= "DW_FORM_block"; break;
435 *s
= "DW_FORM_block1"; break;
437 *s
= "DW_FORM_block2"; break;
439 *s
= "DW_FORM_block4"; break;
441 *s
= "DW_FORM_data1"; break;
443 *s
= "DW_FORM_data2"; break;
445 *s
= "DW_FORM_data4"; break;
447 *s
= "DW_FORM_data8"; break;
448 case DW_FORM_exprloc
:
449 *s
= "DW_FORM_exprloc"; break;
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;
457 *s
= "DW_FORM_ref1"; break;
459 *s
= "DW_FORM_ref2"; break;
461 *s
= "DW_FORM_ref4"; break;
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;
471 *s
= "DW_FORM_sdata"; break;
472 case DW_FORM_sec_offset
:
473 *s
= "DW_FORM_sec_offset"; break;
475 *s
= "DW_FORM_string"; break;
477 *s
= "DW_FORM_strp"; break;
479 *s
= "DW_FORM_udata"; break;
481 return (DW_DLV_NO_ENTRY
);
488 dwarf_get_DS_name(unsigned ds
, const char **s
)
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";
505 return (DW_DLV_NO_ENTRY
);
512 dwarf_get_DSC_name(unsigned dsc
, const char **s
)
519 *s
= "DW_DSC_label"; break;
521 *s
= "DW_DSC_range"; break;
523 return (DW_DLV_NO_ENTRY
);
530 dwarf_get_EH_name(unsigned eh
, const char **s
)
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;
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;
565 *s
= "DW_EH_PE_omit"; break;
567 return (DW_DLV_NO_ENTRY
);
574 dwarf_get_END_name(unsigned end
, const char **s
)
581 *s
= "DW_END_default"; break;
583 *s
= "DW_END_big"; break;
585 *s
= "DW_END_little"; break;
587 *s
= "DW_END_lo_user"; break;
588 case DW_END_high_user
:
589 *s
= "DW_END_high_user"; break;
591 return (DW_DLV_NO_ENTRY
);
598 dwarf_get_ID_name(unsigned id
, const char **s
)
604 case DW_ID_case_sensitive
:
605 *s
= "DW_ID_case_sensitive"; break;
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;
613 return (DW_DLV_NO_ENTRY
);
620 dwarf_get_INL_name(unsigned inl
, const char **s
)
626 case DW_INL_not_inlined
:
627 *s
= "DW_INL_not_inlined"; break;
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;
635 return (DW_DLV_NO_ENTRY
);
642 dwarf_get_LANG_name(unsigned lang
, const char **s
)
649 *s
= "DW_LANG_C89"; break;
651 *s
= "DW_LANG_C"; break;
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;
669 *s
= "DW_LANG_Java"; break;
671 *s
= "DW_LANG_C99"; break;
673 *s
= "DW_LANG_Ada95"; break;
674 case DW_LANG_Fortran95
:
675 *s
= "DW_LANG_Fortran95"; break;
677 *s
= "DW_LANG_PLI"; break;
679 *s
= "DW_LANG_ObjC"; break;
680 case DW_LANG_ObjC_plus_plus
:
681 *s
= "DW_LANG_ObjC_plus_plus"; break;
683 *s
= "DW_LANG_UPC"; break;
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;
691 return (DW_DLV_NO_ENTRY
);
698 dwarf_get_LNE_name(unsigned lne
, const char **s
)
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;
711 *s
= "DW_LNE_lo_user"; break;
713 *s
= "DW_LNE_hi_user"; break;
715 return (DW_DLV_NO_ENTRY
);
722 dwarf_get_LNS_name(unsigned lns
, const char **s
)
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;
751 *s
= "DW_LNS_set_isa"; break;
753 return (DW_DLV_NO_ENTRY
);
760 dwarf_get_MACINFO_name(unsigned mi
, const char **s
)
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;
777 return (DW_DLV_NO_ENTRY
);
784 dwarf_get_OP_name(unsigned op
, const char **s
)
791 *s
= "DW_OP_deref"; break;
793 *s
= "DW_OP_reg0"; break;
795 *s
= "DW_OP_reg1"; break;
797 *s
= "DW_OP_reg2"; break;
799 *s
= "DW_OP_reg3"; break;
801 *s
= "DW_OP_reg4"; break;
803 *s
= "DW_OP_reg5"; break;
805 *s
= "DW_OP_reg6"; break;
807 *s
= "DW_OP_reg7"; break;
809 *s
= "DW_OP_reg8"; break;
811 *s
= "DW_OP_reg9"; break;
813 *s
= "DW_OP_reg10"; break;
815 *s
= "DW_OP_reg11"; break;
817 *s
= "DW_OP_reg12"; break;
819 *s
= "DW_OP_reg13"; break;
821 *s
= "DW_OP_reg14"; break;
823 *s
= "DW_OP_reg15"; break;
825 *s
= "DW_OP_reg16"; break;
827 *s
= "DW_OP_reg17"; break;
829 *s
= "DW_OP_reg18"; break;
831 *s
= "DW_OP_reg19"; break;
833 *s
= "DW_OP_reg20"; break;
835 *s
= "DW_OP_reg21"; break;
837 *s
= "DW_OP_reg22"; break;
839 *s
= "DW_OP_reg23"; break;
841 *s
= "DW_OP_reg24"; break;
843 *s
= "DW_OP_reg25"; break;
845 *s
= "DW_OP_reg26"; break;
847 *s
= "DW_OP_reg27"; break;
849 *s
= "DW_OP_reg28"; break;
851 *s
= "DW_OP_reg29"; break;
853 *s
= "DW_OP_reg30"; break;
855 *s
= "DW_OP_reg31"; break;
857 *s
= "DW_OP_lit0"; break;
859 *s
= "DW_OP_lit1"; break;
861 *s
= "DW_OP_lit2"; break;
863 *s
= "DW_OP_lit3"; break;
865 *s
= "DW_OP_lit4"; break;
867 *s
= "DW_OP_lit5"; break;
869 *s
= "DW_OP_lit6"; break;
871 *s
= "DW_OP_lit7"; break;
873 *s
= "DW_OP_lit8"; break;
875 *s
= "DW_OP_lit9"; break;
877 *s
= "DW_OP_lit10"; break;
879 *s
= "DW_OP_lit11"; break;
881 *s
= "DW_OP_lit12"; break;
883 *s
= "DW_OP_lit13"; break;
885 *s
= "DW_OP_lit14"; break;
887 *s
= "DW_OP_lit15"; break;
889 *s
= "DW_OP_lit16"; break;
891 *s
= "DW_OP_lit17"; break;
893 *s
= "DW_OP_lit18"; break;
895 *s
= "DW_OP_lit19"; break;
897 *s
= "DW_OP_lit20"; break;
899 *s
= "DW_OP_lit21"; break;
901 *s
= "DW_OP_lit22"; break;
903 *s
= "DW_OP_lit23"; break;
905 *s
= "DW_OP_lit24"; break;
907 *s
= "DW_OP_lit25"; break;
909 *s
= "DW_OP_lit26"; break;
911 *s
= "DW_OP_lit27"; break;
913 *s
= "DW_OP_lit28"; break;
915 *s
= "DW_OP_lit29"; break;
917 *s
= "DW_OP_lit30"; break;
919 *s
= "DW_OP_lit31"; break;
921 *s
= "DW_OP_dup"; break;
923 *s
= "DW_OP_drop"; break;
925 *s
= "DW_OP_over"; break;
927 *s
= "DW_OP_swap"; break;
929 *s
= "DW_OP_rot"; break;
931 *s
= "DW_OP_xderef"; break;
933 *s
= "DW_OP_abs"; break;
935 *s
= "DW_OP_and"; break;
937 *s
= "DW_OP_div"; break;
939 *s
= "DW_OP_minus"; break;
941 *s
= "DW_OP_mod"; break;
943 *s
= "DW_OP_mul"; break;
945 *s
= "DW_OP_neg"; break;
947 *s
= "DW_OP_not"; break;
949 *s
= "DW_OP_or"; break;
951 *s
= "DW_OP_plus"; break;
953 *s
= "DW_OP_shl"; break;
955 *s
= "DW_OP_shr"; break;
957 *s
= "DW_OP_shra"; break;
959 *s
= "DW_OP_xor"; break;
961 *s
= "DW_OP_eq"; break;
963 *s
= "DW_OP_ge"; break;
965 *s
= "DW_OP_gt"; break;
967 *s
= "DW_OP_le"; break;
969 *s
= "DW_OP_lt"; break;
971 *s
= "DW_OP_ne"; break;
973 *s
= "DW_OP_nop"; break;
975 *s
= "DW_OP_const1u"; break;
977 *s
= "DW_OP_const1s"; break;
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;
985 *s
= "DW_OP_const2u"; break;
987 *s
= "DW_OP_const2s"; break;
989 *s
= "DW_OP_bra"; break;
991 *s
= "DW_OP_skip"; break;
993 *s
= "DW_OP_const4u"; break;
995 *s
= "DW_OP_const4s"; break;
997 *s
= "DW_OP_const8u"; break;
999 *s
= "DW_OP_const8s"; break;
1001 *s
= "DW_OP_constu"; break;
1002 case DW_OP_plus_uconst
:
1003 *s
= "DW_OP_plus_uconst"; break;
1005 *s
= "DW_OP_regx"; break;
1007 *s
= "DW_OP_piece"; break;
1009 *s
= "DW_OP_consts"; break;
1011 *s
= "DW_OP_breg0"; break;
1013 *s
= "DW_OP_breg1"; break;
1015 *s
= "DW_OP_breg2"; break;
1017 *s
= "DW_OP_breg3"; break;
1019 *s
= "DW_OP_breg4"; break;
1021 *s
= "DW_OP_breg5"; break;
1023 *s
= "DW_OP_breg6"; break;
1025 *s
= "DW_OP_breg7"; break;
1027 *s
= "DW_OP_breg8"; break;
1029 *s
= "DW_OP_breg9"; break;
1031 *s
= "DW_OP_breg10"; break;
1033 *s
= "DW_OP_breg11"; break;
1035 *s
= "DW_OP_breg12"; break;
1037 *s
= "DW_OP_breg13"; break;
1039 *s
= "DW_OP_breg14"; break;
1041 *s
= "DW_OP_breg15"; break;
1043 *s
= "DW_OP_breg16"; break;
1045 *s
= "DW_OP_breg17"; break;
1047 *s
= "DW_OP_breg18"; break;
1049 *s
= "DW_OP_breg19"; break;
1051 *s
= "DW_OP_breg20"; break;
1053 *s
= "DW_OP_breg21"; break;
1055 *s
= "DW_OP_breg22"; break;
1057 *s
= "DW_OP_breg23"; break;
1059 *s
= "DW_OP_breg24"; break;
1061 *s
= "DW_OP_breg25"; break;
1063 *s
= "DW_OP_breg26"; break;
1065 *s
= "DW_OP_breg27"; break;
1067 *s
= "DW_OP_breg28"; break;
1069 *s
= "DW_OP_breg29"; break;
1071 *s
= "DW_OP_breg30"; break;
1073 *s
= "DW_OP_breg31"; break;
1075 *s
= "DW_OP_fbreg"; break;
1077 *s
= "DW_OP_bregx"; break;
1079 *s
= "DW_OP_addr"; break;
1080 case DW_OP_push_object_address
:
1081 *s
= "DW_OP_push_object_address"; break;
1083 *s
= "DW_OP_call2"; break;
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;
1101 return (DW_DLV_NO_ENTRY
);
1108 dwarf_get_ORD_name(unsigned ord
, const char **s
)
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;
1119 return (DW_DLV_NO_ENTRY
);
1126 dwarf_get_TAG_name(unsigned tag
, const char **s
)
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;
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;
1179 *s
= "DW_TAG_label"; break;
1180 case DW_TAG_lexical_block
:
1181 *s
= "DW_TAG_lexical_block"; break;
1183 *s
= "DW_TAG_member"; break;
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;
1251 return (DW_DLV_NO_ENTRY
);
1258 dwarf_get_VIRTUALITY_name(unsigned vir
, const char **s
)
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;
1271 return (DW_DLV_NO_ENTRY
);
1278 dwarf_get_VIS_name(unsigned vis
, const char **s
)
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;
1291 return (DW_DLV_NO_ENTRY
);