d1a86fc14027d49b2cfd347c20648a90a3843b35
[pyelftools.git] / elftools / dwarf / constants.py
1 #-------------------------------------------------------------------------------
2 # elftools: dwarf/constants.py
3 #
4 # Constants and flags
5 #
6 # Eli Bendersky (eliben@gmail.com)
7 # This code is in the public domain
8 #-------------------------------------------------------------------------------
9
10 # Inline codes
11 #
12 DW_INL_not_inlined = 0
13 DW_INL_inlined = 1
14 DW_INL_declared_not_inlined = 2
15 DW_INL_declared_inlined = 3
16
17
18 # Source languages
19 #
20 DW_LANG_C89 = 0x0001
21 DW_LANG_C = 0x0002
22 DW_LANG_Ada83 = 0x0003
23 DW_LANG_C_plus_plus = 0x0004
24 DW_LANG_Cobol74 = 0x0005
25 DW_LANG_Cobol85 = 0x0006
26 DW_LANG_Fortran77 = 0x0007
27 DW_LANG_Fortran90 = 0x0008
28 DW_LANG_Pascal83 = 0x0009
29 DW_LANG_Modula2 = 0x000a
30 DW_LANG_Java = 0x000b
31 DW_LANG_C99 = 0x000c
32 DW_LANG_Ada95 = 0x000d
33 DW_LANG_Fortran95 = 0x000e
34 DW_LANG_PLI = 0x000f
35 DW_LANG_ObjC = 0x0010
36 DW_LANG_ObjC_plus_plus = 0x0011
37 DW_LANG_UPC = 0x0012
38 DW_LANG_D = 0x0013
39 DW_LANG_Python = 0x0014
40 DW_LANG_OpenCL = 0x0015
41 DW_LANG_Go = 0x0016
42 DW_LANG_Modula3 = 0x0017
43 DW_LANG_Haskell = 0x0018
44 DW_LANG_C_plus_plus_03 = 0x0019
45 DW_LANG_C_plus_plus_11 = 0x001a
46 DW_LANG_OCaml = 0x001b
47 DW_LANG_Rust = 0x001c
48 DW_LANG_C11 = 0x001d
49 DW_LANG_Swift = 0x001e
50 DW_LANG_Julia = 0x001f
51 DW_LANG_Dylan = 0x0020
52 DW_LANG_C_plus_plus_14 = 0x0021
53 DW_LANG_Fortran03 = 0x0022
54 DW_LANG_Fortran08 = 0x0023
55 DW_LANG_RenderScript = 0x0024
56 DW_LANG_BLISS = 0x0025
57 DW_LANG_Mips_Assembler = 0x8001
58 DW_LANG_Upc = 0x8765
59 DW_LANG_HP_Bliss = 0x8003
60 DW_LANG_HP_Basic91 = 0x8004
61 DW_LANG_HP_Pascal91 = 0x8005
62 DW_LANG_HP_IMacro = 0x8006
63 DW_LANG_HP_Assembler = 0x8007
64 DW_LANG_GOOGLE_RenderScript = 0x8e57
65 DW_LANG_BORLAND_Delphi = 0xb000
66
67
68 # Encoding
69 #
70 DW_ATE_void = 0x0
71 DW_ATE_address = 0x1
72 DW_ATE_boolean = 0x2
73 DW_ATE_complex_float = 0x3
74 DW_ATE_float = 0x4
75 DW_ATE_signed = 0x5
76 DW_ATE_signed_char = 0x6
77 DW_ATE_unsigned = 0x7
78 DW_ATE_unsigned_char = 0x8
79 DW_ATE_imaginary_float = 0x9
80 DW_ATE_packed_decimal = 0xa
81 DW_ATE_numeric_string = 0xb
82 DW_ATE_edited = 0xc
83 DW_ATE_signed_fixed = 0xd
84 DW_ATE_unsigned_fixed = 0xe
85 DW_ATE_decimal_float = 0xf
86 DW_ATE_UTF = 0x10
87 DW_ATE_UCS = 0x11
88 DW_ATE_ASCII = 0x12
89 DW_ATE_lo_user = 0x80
90 DW_ATE_hi_user = 0xff
91 DW_ATE_HP_float80 = 0x80
92 DW_ATE_HP_complex_float80 = 0x81
93 DW_ATE_HP_float128 = 0x82
94 DW_ATE_HP_complex_float128 = 0x83
95 DW_ATE_HP_floathpintel = 0x84
96 DW_ATE_HP_imaginary_float80 = 0x85
97 DW_ATE_HP_imaginary_float128 = 0x86
98
99
100 # Access
101 #
102 DW_ACCESS_public = 1
103 DW_ACCESS_protected = 2
104 DW_ACCESS_private = 3
105
106
107 # Visibility
108 #
109 DW_VIS_local = 1
110 DW_VIS_exported = 2
111 DW_VIS_qualified = 3
112
113
114 # Virtuality
115 #
116 DW_VIRTUALITY_none = 0
117 DW_VIRTUALITY_virtual = 1
118 DW_VIRTUALITY_pure_virtual = 2
119
120
121 # ID case
122 #
123 DW_ID_case_sensitive = 0
124 DW_ID_up_case = 1
125 DW_ID_down_case = 2
126 DW_ID_case_insensitive = 3
127
128
129 # Calling convention
130 #
131 DW_CC_normal = 0x1
132 DW_CC_program = 0x2
133 DW_CC_nocall = 0x3
134
135
136 # Ordering
137 #
138 DW_ORD_row_major = 0
139 DW_ORD_col_major = 1
140
141
142 # Line program opcodes
143 #
144 DW_LNS_copy = 0x01
145 DW_LNS_advance_pc = 0x02
146 DW_LNS_advance_line = 0x03
147 DW_LNS_set_file = 0x04
148 DW_LNS_set_column = 0x05
149 DW_LNS_negate_stmt = 0x06
150 DW_LNS_set_basic_block = 0x07
151 DW_LNS_const_add_pc = 0x08
152 DW_LNS_fixed_advance_pc = 0x09
153 DW_LNS_set_prologue_end = 0x0a
154 DW_LNS_set_epilogue_begin = 0x0b
155 DW_LNS_set_isa = 0x0c
156 DW_LNE_end_sequence = 0x01
157 DW_LNE_set_address = 0x02
158 DW_LNE_define_file = 0x03
159 DW_LNE_set_discriminator = 0x04
160 DW_LNE_lo_user = 0x80
161 DW_LNE_hi_user = 0xff
162
163 # Line program header content types
164 #
165 DW_LNCT_path = 0x01
166 DW_LNCT_directory_index = 0x02
167 DW_LNCT_timestamp = 0x03
168 DW_LNCT_size = 0x04
169 DW_LNCT_MD5 = 0x05
170 DW_LNCT_lo_user = 0x2000
171 DW_LNCT_hi_user = 0x3fff
172
173 # Call frame instructions
174 #
175 # Note that the first 3 instructions have the so-called "primary opcode"
176 # (as described in DWARFv3 7.23), so only their highest 2 bits take part
177 # in the opcode decoding. They are kept as constants with the low bits masked
178 # out, and the callframe module knows how to handle this.
179 # The other instructions use an "extended opcode" encoded just in the low 6
180 # bits, with the high 2 bits, so these constants are exactly as they would
181 # appear in an actual file.
182 #
183 DW_CFA_advance_loc = 0b01000000
184 DW_CFA_offset = 0b10000000
185 DW_CFA_restore = 0b11000000
186 DW_CFA_nop = 0x00
187 DW_CFA_set_loc = 0x01
188 DW_CFA_advance_loc1 = 0x02
189 DW_CFA_advance_loc2 = 0x03
190 DW_CFA_advance_loc4 = 0x04
191 DW_CFA_offset_extended = 0x05
192 DW_CFA_restore_extended = 0x06
193 DW_CFA_undefined = 0x07
194 DW_CFA_same_value = 0x08
195 DW_CFA_register = 0x09
196 DW_CFA_remember_state = 0x0a
197 DW_CFA_restore_state = 0x0b
198 DW_CFA_def_cfa = 0x0c
199 DW_CFA_def_cfa_register = 0x0d
200 DW_CFA_def_cfa_offset = 0x0e
201 DW_CFA_def_cfa_expression = 0x0f
202 DW_CFA_expression = 0x10
203 DW_CFA_offset_extended_sf = 0x11
204 DW_CFA_def_cfa_sf = 0x12
205 DW_CFA_def_cfa_offset_sf = 0x13
206 DW_CFA_val_offset = 0x14
207 DW_CFA_val_offset_sf = 0x15
208 DW_CFA_val_expression = 0x16
209 DW_CFA_GNU_args_size = 0x2e