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