some cosmetic changes + updating README
[pyelftools.git] / elftools / dwarf / enums.py
1 #-------------------------------------------------------------------------------
2 # elftools: dwarf/enums.py
3 #
4 # Mappings of enum names to values
5 #
6 # Eli Bendersky (eliben@gmail.com)
7 # This code is in the public domain
8 #-------------------------------------------------------------------------------
9 from ..construct import Pass
10
11
12 ENUM_DW_TAG = dict(
13 DW_TAG_null = 0x00,
14 DW_TAG_array_type = 0x01,
15 DW_TAG_class_type = 0x02,
16 DW_TAG_entry_point = 0x03,
17 DW_TAG_enumeration_type = 0x04,
18 DW_TAG_formal_parameter = 0x05,
19 DW_TAG_imported_declaration = 0x08,
20 DW_TAG_label = 0x0a,
21 DW_TAG_lexical_block = 0x0b,
22 DW_TAG_member = 0x0d,
23 DW_TAG_pointer_type = 0x0f,
24 DW_TAG_reference_type = 0x10,
25 DW_TAG_compile_unit = 0x11,
26 DW_TAG_string_type = 0x12,
27 DW_TAG_structure_type = 0x13,
28 DW_TAG_subroutine_type = 0x15,
29 DW_TAG_typedef = 0x16,
30 DW_TAG_union_type = 0x17,
31 DW_TAG_unspecified_parameters = 0x18,
32 DW_TAG_variant = 0x19,
33 DW_TAG_common_block = 0x1a,
34 DW_TAG_common_inclusion = 0x1b,
35 DW_TAG_inheritance = 0x1c,
36 DW_TAG_inlined_subroutine = 0x1d,
37 DW_TAG_module = 0x1e,
38 DW_TAG_ptr_to_member_type = 0x1f,
39 DW_TAG_set_type = 0x20,
40 DW_TAG_subrange_type = 0x21,
41 DW_TAG_with_stmt = 0x22,
42 DW_TAG_access_declaration = 0x23,
43 DW_TAG_base_type = 0x24,
44 DW_TAG_catch_block = 0x25,
45 DW_TAG_const_type = 0x26,
46 DW_TAG_constant = 0x27,
47 DW_TAG_enumerator = 0x28,
48 DW_TAG_file_type = 0x29,
49 DW_TAG_friend = 0x2a,
50 DW_TAG_namelist = 0x2b,
51 DW_TAG_namelist_item = 0x2c,
52 DW_TAG_namelist_items = 0x2c,
53 DW_TAG_packed_type = 0x2d,
54 DW_TAG_subprogram = 0x2e,
55 DW_TAG_template_type_parameter = 0x2f,
56 DW_TAG_template_type_param = 0x2f,
57 DW_TAG_template_value_parameter = 0x30,
58 DW_TAG_template_value_param = 0x30,
59 DW_TAG_thrown_type = 0x31,
60 DW_TAG_try_block = 0x32,
61 DW_TAG_variant_part = 0x33,
62 DW_TAG_variable = 0x34,
63 DW_TAG_volatile_type = 0x35,
64 DW_TAG_dwarf_procedure = 0x36,
65 DW_TAG_restrict_type = 0x37,
66 DW_TAG_interface_type = 0x38,
67 DW_TAG_namespace = 0x39,
68 DW_TAG_imported_module = 0x3a,
69 DW_TAG_unspecified_type = 0x3b,
70 DW_TAG_partial_unit = 0x3c,
71 DW_TAG_imported_unit = 0x3d,
72 DW_TAG_mutable_type = 0x3e,
73 DW_TAG_condition = 0x3f,
74 DW_TAG_shared_type = 0x40,
75 DW_TAG_type_unit = 0x41,
76 DW_TAG_rvalue_reference_type = 0x42,
77
78 DW_TAG_lo_user = 0x4080,
79 DW_TAG_hi_user = 0xffff,
80
81 _default_ = Pass,
82 )
83
84
85 ENUM_DW_CHILDREN = dict(
86 DW_CHILDREN_no = 0x00,
87 DW_CHILDREN_yes = 0x01,
88 )
89
90
91 ENUM_DW_AT = dict(
92 DW_AT_null = 0x00,
93 DW_AT_sibling = 0x01,
94 DW_AT_location = 0x02,
95 DW_AT_name = 0x03,
96 DW_AT_ordering = 0x09,
97 DW_AT_subscr_data = 0x0a,
98 DW_AT_byte_size = 0x0b,
99 DW_AT_bit_offset = 0x0c,
100 DW_AT_bit_size = 0x0d,
101 DW_AT_element_list = 0x0f,
102 DW_AT_stmt_list = 0x10,
103 DW_AT_low_pc = 0x11,
104 DW_AT_high_pc = 0x12,
105 DW_AT_language = 0x13,
106 DW_AT_member = 0x14,
107 DW_AT_discr = 0x15,
108 DW_AT_discr_value = 0x16,
109 DW_AT_visibility = 0x17,
110 DW_AT_import = 0x18,
111 DW_AT_string_length = 0x19,
112 DW_AT_common_reference = 0x1a,
113 DW_AT_comp_dir = 0x1b,
114 DW_AT_const_value = 0x1c,
115 DW_AT_containing_type = 0x1d,
116 DW_AT_default_value = 0x1e,
117 DW_AT_inline = 0x20,
118 DW_AT_is_optional = 0x21,
119 DW_AT_lower_bound = 0x22,
120 DW_AT_producer = 0x25,
121 DW_AT_prototyped = 0x27,
122 DW_AT_return_addr = 0x2a,
123 DW_AT_start_scope = 0x2c,
124 DW_AT_bit_stride = 0x2e,
125 DW_AT_stride_size = 0x2e,
126 DW_AT_upper_bound = 0x2f,
127 DW_AT_abstract_origin = 0x31,
128 DW_AT_accessibility = 0x32,
129 DW_AT_address_class = 0x33,
130 DW_AT_artificial = 0x34,
131 DW_AT_base_types = 0x35,
132 DW_AT_calling_convention = 0x36,
133 DW_AT_count = 0x37,
134 DW_AT_data_member_location = 0x38,
135 DW_AT_decl_column = 0x39,
136 DW_AT_decl_file = 0x3a,
137 DW_AT_decl_line = 0x3b,
138 DW_AT_declaration = 0x3c,
139 DW_AT_discr_list = 0x3d,
140 DW_AT_encoding = 0x3e,
141 DW_AT_external = 0x3f,
142 DW_AT_frame_base = 0x40,
143 DW_AT_friend = 0x41,
144 DW_AT_identifier_case = 0x42,
145 DW_AT_macro_info = 0x43,
146 DW_AT_namelist_item = 0x44,
147 DW_AT_priority = 0x45,
148 DW_AT_segment = 0x46,
149 DW_AT_specification = 0x47,
150 DW_AT_static_link = 0x48,
151 DW_AT_type = 0x49,
152 DW_AT_use_location = 0x4a,
153 DW_AT_variable_parameter = 0x4b,
154 DW_AT_virtuality = 0x4c,
155 DW_AT_vtable_elem_location = 0x4d,
156 DW_AT_allocated = 0x4e,
157 DW_AT_associated = 0x4f,
158 DW_AT_data_location = 0x50,
159 DW_AT_byte_stride = 0x51,
160 DW_AT_stride = 0x51,
161 DW_AT_entry_pc = 0x52,
162 DW_AT_use_UTF8 = 0x53,
163 DW_AT_extension = 0x54,
164 DW_AT_ranges = 0x55,
165 DW_AT_trampoline = 0x56,
166 DW_AT_call_column = 0x57,
167 DW_AT_call_file = 0x58,
168 DW_AT_call_line = 0x59,
169 DW_AT_description = 0x5a,
170 DW_AT_binary_scale = 0x5b,
171 DW_AT_decimal_scale = 0x5c,
172 DW_AT_small = 0x5d,
173 DW_AT_decimal_sign = 0x5e,
174 DW_AT_digit_count = 0x5f,
175 DW_AT_picture_string = 0x60,
176 DW_AT_mutable = 0x61,
177 DW_AT_threads_scaled = 0x62,
178 DW_AT_explicit = 0x63,
179 DW_AT_object_pointer = 0x64,
180 DW_AT_endianity = 0x65,
181 DW_AT_elemental = 0x66,
182 DW_AT_pure = 0x67,
183 DW_AT_recursive = 0x68,
184 DW_AT_signature = 0x69,
185 DW_AT_main_subprogram = 0x6a,
186 DW_AT_data_bit_offset = 0x6b,
187 DW_AT_const_expr = 0x6c,
188
189 DW_AT_MIPS_fde = 0x2001,
190 DW_AT_MIPS_loop_begin = 0x2002,
191 DW_AT_MIPS_tail_loop_begin = 0x2003,
192 DW_AT_MIPS_epilog_begin = 0x2004,
193 DW_AT_MIPS_loop_unroll_factor = 0x2005,
194 DW_AT_MIPS_software_pipeline_depth = 0x2006,
195 DW_AT_MIPS_linkage_name = 0x2007,
196 DW_AT_MIPS_stride = 0x2008,
197 DW_AT_MIPS_abstract_name = 0x2009,
198 DW_AT_MIPS_clone_origin = 0x200a,
199 DW_AT_MIPS_has_inlines = 0x200b,
200
201 _default_ = Pass,
202 )
203
204
205 ENUM_DW_FORM = dict(
206 DW_FORM_null = 0x00,
207 DW_FORM_addr = 0x01,
208 DW_FORM_block2 = 0x03,
209 DW_FORM_block4 = 0x04,
210 DW_FORM_data2 = 0x05,
211 DW_FORM_data4 = 0x06,
212 DW_FORM_data8 = 0x07,
213 DW_FORM_string = 0x08,
214 DW_FORM_block = 0x09,
215 DW_FORM_block1 = 0x0a,
216 DW_FORM_data1 = 0x0b,
217 DW_FORM_flag = 0x0c,
218 DW_FORM_sdata = 0x0d,
219 DW_FORM_strp = 0x0e,
220 DW_FORM_udata = 0x0f,
221 DW_FORM_ref_addr = 0x10,
222 DW_FORM_ref1 = 0x11,
223 DW_FORM_ref2 = 0x12,
224 DW_FORM_ref4 = 0x13,
225 DW_FORM_ref8 = 0x14,
226 DW_FORM_ref_udata = 0x15,
227 DW_FORM_indirect = 0x16,
228
229 _default_ = Pass,
230 )
231