| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
#ifndef _DWARF2_H |
| 43 |
#define _DWARF2_H |
| 44 |
|
| 45 |
#define DW_TAG(name, value) , name = value |
| 46 |
#define DW_TAG_DUP(name, value) , name = value |
| 47 |
#define DW_FORM(name, value) , name = value |
| 48 |
#define DW_AT(name, value) , name = value |
| 49 |
#define DW_AT_DUP(name, value) , name = value |
| 50 |
#define DW_OP(name, value) , name = value |
| 51 |
#define DW_OP_DUP(name, value) , name = value |
| 52 |
#define DW_ATE(name, value) , name = value |
| 53 |
#define DW_ATE_DUP(name, value) , name = value |
| 54 |
#define DW_CFA(name, value) , name = value |
| 55 |
|
| 56 |
#define DW_FIRST_TAG(name, value) enum dwarf_tag { \ |
| 57 |
name = value |
| 58 |
#define DW_END_TAG }; |
| 59 |
#define DW_FIRST_FORM(name, value) enum dwarf_form { \ |
| 60 |
name = value |
| 61 |
#define DW_END_FORM }; |
| 62 |
#define DW_FIRST_AT(name, value) enum dwarf_attribute { \ |
| 63 |
name = value |
| 64 |
#define DW_END_AT }; |
| 65 |
#define DW_FIRST_OP(name, value) enum dwarf_location_atom { \ |
| 66 |
name = value |
| 67 |
#define DW_END_OP }; |
| 68 |
#define DW_FIRST_ATE(name, value) enum dwarf_type { \ |
| 69 |
name = value |
| 70 |
#define DW_END_ATE }; |
| 71 |
#define DW_FIRST_CFA(name, value) enum dwarf_call_frame_info { \ |
| 72 |
name = value |
| 73 |
#define DW_END_CFA }; |
| 74 |
|
| 75 |
#include "dwarf2.def" |
| 76 |
|
| 77 |
#undef DW_FIRST_TAG |
| 78 |
#undef DW_END_TAG |
| 79 |
#undef DW_FIRST_FORM |
| 80 |
#undef DW_END_FORM |
| 81 |
#undef DW_FIRST_AT |
| 82 |
#undef DW_END_AT |
| 83 |
#undef DW_FIRST_OP |
| 84 |
#undef DW_END_OP |
| 85 |
#undef DW_FIRST_ATE |
| 86 |
#undef DW_END_ATE |
| 87 |
#undef DW_FIRST_CFA |
| 88 |
#undef DW_END_CFA |
| 89 |
|
| 90 |
#undef DW_TAG |
| 91 |
#undef DW_TAG_DUP |
| 92 |
#undef DW_FORM |
| 93 |
#undef DW_AT |
| 94 |
#undef DW_AT_DUP |
| 95 |
#undef DW_OP |
| 96 |
#undef DW_OP_DUP |
| 97 |
#undef DW_ATE |
| 98 |
#undef DW_ATE_DUP |
| 99 |
#undef DW_CFA |
| 100 |
|
| 101 |
|
| 102 |
#define DW_children_no 0 |
| 103 |
#define DW_children_yes 1 |
| 104 |
|
| 105 |
#define DW_AT_stride_size DW_AT_bit_stride |
| 106 |
#define DW_AT_stride DW_AT_byte_stride |
| 107 |
|
| 108 |
|
| 109 |
enum dwarf_decimal_sign_encoding |
| 110 |
{ |
| 111 |
|
| 112 |
DW_DS_unsigned = 0x01, |
| 113 |
DW_DS_leading_overpunch = 0x02, |
| 114 |
DW_DS_trailing_overpunch = 0x03, |
| 115 |
DW_DS_leading_separate = 0x04, |
| 116 |
DW_DS_trailing_separate = 0x05 |
| 117 |
}; |
| 118 |
|
| 119 |
|
| 120 |
enum dwarf_endianity_encoding |
| 121 |
{ |
| 122 |
|
| 123 |
DW_END_default = 0x00, |
| 124 |
DW_END_big = 0x01, |
| 125 |
DW_END_little = 0x02, |
| 126 |
|
| 127 |
DW_END_lo_user = 0x40, |
| 128 |
DW_END_hi_user = 0xff |
| 129 |
}; |
| 130 |
|
| 131 |
|
| 132 |
enum dwarf_array_dim_ordering |
| 133 |
{ |
| 134 |
DW_ORD_row_major = 0, |
| 135 |
DW_ORD_col_major = 1 |
| 136 |
}; |
| 137 |
|
| 138 |
|
| 139 |
enum dwarf_access_attribute |
| 140 |
{ |
| 141 |
DW_ACCESS_public = 1, |
| 142 |
DW_ACCESS_protected = 2, |
| 143 |
DW_ACCESS_private = 3 |
| 144 |
}; |
| 145 |
|
| 146 |
|
| 147 |
enum dwarf_visibility_attribute |
| 148 |
{ |
| 149 |
DW_VIS_local = 1, |
| 150 |
DW_VIS_exported = 2, |
| 151 |
DW_VIS_qualified = 3 |
| 152 |
}; |
| 153 |
|
| 154 |
|
| 155 |
enum dwarf_virtuality_attribute |
| 156 |
{ |
| 157 |
DW_VIRTUALITY_none = 0, |
| 158 |
DW_VIRTUALITY_virtual = 1, |
| 159 |
DW_VIRTUALITY_pure_virtual = 2 |
| 160 |
}; |
| 161 |
|
| 162 |
|
| 163 |
enum dwarf_id_case |
| 164 |
{ |
| 165 |
DW_ID_case_sensitive = 0, |
| 166 |
DW_ID_up_case = 1, |
| 167 |
DW_ID_down_case = 2, |
| 168 |
DW_ID_case_insensitive = 3 |
| 169 |
}; |
| 170 |
|
| 171 |
|
| 172 |
enum dwarf_calling_convention |
| 173 |
{ |
| 174 |
DW_CC_normal = 0x1, |
| 175 |
DW_CC_program = 0x2, |
| 176 |
DW_CC_nocall = 0x3, |
| 177 |
|
| 178 |
|
| 179 |
DW_CC_pass_by_reference = 0x4, |
| 180 |
DW_CC_pass_by_value = 0x5, |
| 181 |
|
| 182 |
DW_CC_lo_user = 0x40, |
| 183 |
DW_CC_hi_user = 0xff, |
| 184 |
|
| 185 |
DW_CC_GNU_renesas_sh = 0x40, |
| 186 |
DW_CC_GNU_borland_fastcall_i386 = 0x41, |
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
DW_CC_GDB_IBM_OpenCL = 0xff |
| 195 |
}; |
| 196 |
|
| 197 |
|
| 198 |
enum dwarf_inline_attribute |
| 199 |
{ |
| 200 |
DW_INL_not_inlined = 0, |
| 201 |
DW_INL_inlined = 1, |
| 202 |
DW_INL_declared_not_inlined = 2, |
| 203 |
DW_INL_declared_inlined = 3 |
| 204 |
}; |
| 205 |
|
| 206 |
|
| 207 |
enum dwarf_discrim_list |
| 208 |
{ |
| 209 |
DW_DSC_label = 0, |
| 210 |
DW_DSC_range = 1 |
| 211 |
}; |
| 212 |
|
| 213 |
|
| 214 |
enum dwarf_line_number_ops |
| 215 |
{ |
| 216 |
DW_LNS_extended_op = 0, |
| 217 |
DW_LNS_copy = 1, |
| 218 |
DW_LNS_advance_pc = 2, |
| 219 |
DW_LNS_advance_line = 3, |
| 220 |
DW_LNS_set_file = 4, |
| 221 |
DW_LNS_set_column = 5, |
| 222 |
DW_LNS_negate_stmt = 6, |
| 223 |
DW_LNS_set_basic_block = 7, |
| 224 |
DW_LNS_const_add_pc = 8, |
| 225 |
DW_LNS_fixed_advance_pc = 9, |
| 226 |
|
| 227 |
DW_LNS_set_prologue_end = 10, |
| 228 |
DW_LNS_set_epilogue_begin = 11, |
| 229 |
DW_LNS_set_isa = 12 |
| 230 |
}; |
| 231 |
|
| 232 |
|
| 233 |
enum dwarf_line_number_x_ops |
| 234 |
{ |
| 235 |
DW_LNE_end_sequence = 1, |
| 236 |
DW_LNE_set_address = 2, |
| 237 |
DW_LNE_define_file = 3, |
| 238 |
DW_LNE_set_discriminator = 4, |
| 239 |
|
| 240 |
DW_LNE_HP_negate_is_UV_update = 0x11, |
| 241 |
DW_LNE_HP_push_context = 0x12, |
| 242 |
DW_LNE_HP_pop_context = 0x13, |
| 243 |
DW_LNE_HP_set_file_line_column = 0x14, |
| 244 |
DW_LNE_HP_set_routine_name = 0x15, |
| 245 |
DW_LNE_HP_set_sequence = 0x16, |
| 246 |
DW_LNE_HP_negate_post_semantics = 0x17, |
| 247 |
DW_LNE_HP_negate_function_exit = 0x18, |
| 248 |
DW_LNE_HP_negate_front_end_logical = 0x19, |
| 249 |
DW_LNE_HP_define_proc = 0x20, |
| 250 |
DW_LNE_HP_source_file_correlation = 0x80, |
| 251 |
|
| 252 |
DW_LNE_lo_user = 0x80, |
| 253 |
DW_LNE_hi_user = 0xff |
| 254 |
}; |
| 255 |
|
| 256 |
|
| 257 |
enum dwarf_line_number_hp_sfc_ops |
| 258 |
{ |
| 259 |
DW_LNE_HP_SFC_formfeed = 1, |
| 260 |
DW_LNE_HP_SFC_set_listing_line = 2, |
| 261 |
DW_LNE_HP_SFC_associate = 3 |
| 262 |
}; |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
enum dwarf_line_number_content_type |
| 267 |
{ |
| 268 |
DW_LNCT_path = 0x1, |
| 269 |
DW_LNCT_directory_index = 0x2, |
| 270 |
DW_LNCT_timestamp = 0x3, |
| 271 |
DW_LNCT_size = 0x4, |
| 272 |
DW_LNCT_MD5 = 0x5, |
| 273 |
DW_LNCT_lo_user = 0x2000, |
| 274 |
DW_LNCT_hi_user = 0x3fff |
| 275 |
}; |
| 276 |
|
| 277 |
|
| 278 |
enum dwarf_location_list_entry_type |
| 279 |
{ |
| 280 |
DW_LLE_end_of_list = 0x00, |
| 281 |
DW_LLE_base_addressx = 0x01, |
| 282 |
DW_LLE_startx_endx = 0x02, |
| 283 |
DW_LLE_startx_length = 0x03, |
| 284 |
DW_LLE_offset_pair = 0x04, |
| 285 |
DW_LLE_default_location = 0x05, |
| 286 |
DW_LLE_base_address = 0x06, |
| 287 |
DW_LLE_start_end = 0x07, |
| 288 |
DW_LLE_start_length = 0x08, |
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
DW_LLE_GNU_end_of_list_entry = 0x00, |
| 293 |
DW_LLE_GNU_base_address_selection_entry = 0x01, |
| 294 |
DW_LLE_GNU_start_end_entry = 0x02, |
| 295 |
DW_LLE_GNU_start_length_entry = 0x03 |
| 296 |
}; |
| 297 |
|
| 298 |
#define DW_CIE_ID 0xffffffff |
| 299 |
#define DW64_CIE_ID 0xffffffffffffffffULL |
| 300 |
#define DW_CIE_VERSION 1 |
| 301 |
|
| 302 |
#define DW_CFA_extended 0 |
| 303 |
|
| 304 |
#define DW_CHILDREN_no 0x00 |
| 305 |
#define DW_CHILDREN_yes 0x01 |
| 306 |
|
| 307 |
#define DW_ADDR_none 0 |
| 308 |
|
| 309 |
|
| 310 |
enum dwarf_source_language |
| 311 |
{ |
| 312 |
DW_LANG_C89 = 0x0001, |
| 313 |
DW_LANG_C = 0x0002, |
| 314 |
DW_LANG_Ada83 = 0x0003, |
| 315 |
DW_LANG_C_plus_plus = 0x0004, |
| 316 |
DW_LANG_Cobol74 = 0x0005, |
| 317 |
DW_LANG_Cobol85 = 0x0006, |
| 318 |
DW_LANG_Fortran77 = 0x0007, |
| 319 |
DW_LANG_Fortran90 = 0x0008, |
| 320 |
DW_LANG_Pascal83 = 0x0009, |
| 321 |
DW_LANG_Modula2 = 0x000a, |
| 322 |
|
| 323 |
DW_LANG_Java = 0x000b, |
| 324 |
DW_LANG_C99 = 0x000c, |
| 325 |
DW_LANG_Ada95 = 0x000d, |
| 326 |
DW_LANG_Fortran95 = 0x000e, |
| 327 |
DW_LANG_PLI = 0x000f, |
| 328 |
DW_LANG_ObjC = 0x0010, |
| 329 |
DW_LANG_ObjC_plus_plus = 0x0011, |
| 330 |
DW_LANG_UPC = 0x0012, |
| 331 |
DW_LANG_D = 0x0013, |
| 332 |
|
| 333 |
DW_LANG_Python = 0x0014, |
| 334 |
|
| 335 |
DW_LANG_OpenCL = 0x0015, |
| 336 |
DW_LANG_Go = 0x0016, |
| 337 |
DW_LANG_Modula3 = 0x0017, |
| 338 |
DW_LANG_Haskell = 0x0018, |
| 339 |
DW_LANG_C_plus_plus_03 = 0x0019, |
| 340 |
DW_LANG_C_plus_plus_11 = 0x001a, |
| 341 |
DW_LANG_OCaml = 0x001b, |
| 342 |
DW_LANG_Rust = 0x001c, |
| 343 |
DW_LANG_C11 = 0x001d, |
| 344 |
DW_LANG_Swift = 0x001e, |
| 345 |
DW_LANG_Julia = 0x001f, |
| 346 |
DW_LANG_Dylan = 0x0020, |
| 347 |
DW_LANG_C_plus_plus_14 = 0x0021, |
| 348 |
DW_LANG_Fortran03 = 0x0022, |
| 349 |
DW_LANG_Fortran08 = 0x0023, |
| 350 |
DW_LANG_RenderScript = 0x0024, |
| 351 |
|
| 352 |
DW_LANG_lo_user = 0x8000, |
| 353 |
DW_LANG_hi_user = 0xffff, |
| 354 |
|
| 355 |
|
| 356 |
DW_LANG_Mips_Assembler = 0x8001, |
| 357 |
|
| 358 |
DW_LANG_Upc = 0x8765, |
| 359 |
|
| 360 |
DW_LANG_HP_Bliss = 0x8003, |
| 361 |
DW_LANG_HP_Basic91 = 0x8004, |
| 362 |
DW_LANG_HP_Pascal91 = 0x8005, |
| 363 |
DW_LANG_HP_IMacro = 0x8006, |
| 364 |
DW_LANG_HP_Assembler = 0x8007, |
| 365 |
|
| 366 |
|
| 367 |
DW_LANG_Rust_old = 0x9000 |
| 368 |
}; |
| 369 |
|
| 370 |
|
| 371 |
enum dwarf_macinfo_record_type |
| 372 |
{ |
| 373 |
DW_MACINFO_define = 1, |
| 374 |
DW_MACINFO_undef = 2, |
| 375 |
DW_MACINFO_start_file = 3, |
| 376 |
DW_MACINFO_end_file = 4, |
| 377 |
DW_MACINFO_vendor_ext = 255 |
| 378 |
}; |
| 379 |
|
| 380 |
|
| 381 |
enum dwarf_defaulted_attribute |
| 382 |
{ |
| 383 |
DW_DEFAULTED_no = 0x00, |
| 384 |
DW_DEFAULTED_in_class = 0x01, |
| 385 |
DW_DEFAULTED_out_of_class = 0x02 |
| 386 |
}; |
| 387 |
|
| 388 |
|
| 389 |
enum dwarf_macro_record_type |
| 390 |
{ |
| 391 |
DW_MACRO_define = 0x01, |
| 392 |
DW_MACRO_undef = 0x02, |
| 393 |
DW_MACRO_start_file = 0x03, |
| 394 |
DW_MACRO_end_file = 0x04, |
| 395 |
DW_MACRO_define_strp = 0x05, |
| 396 |
DW_MACRO_undef_strp = 0x06, |
| 397 |
DW_MACRO_import = 0x07, |
| 398 |
DW_MACRO_define_sup = 0x08, |
| 399 |
DW_MACRO_undef_sup = 0x09, |
| 400 |
DW_MACRO_import_sup = 0x0a, |
| 401 |
DW_MACRO_define_strx = 0x0b, |
| 402 |
DW_MACRO_undef_strx = 0x0c, |
| 403 |
DW_MACRO_lo_user = 0xe0, |
| 404 |
DW_MACRO_hi_user = 0xff, |
| 405 |
|
| 406 |
|
| 407 |
DW_MACRO_GNU_define = 0x01, |
| 408 |
DW_MACRO_GNU_undef = 0x02, |
| 409 |
DW_MACRO_GNU_start_file = 0x03, |
| 410 |
DW_MACRO_GNU_end_file = 0x04, |
| 411 |
DW_MACRO_GNU_define_indirect = 0x05, |
| 412 |
DW_MACRO_GNU_undef_indirect = 0x06, |
| 413 |
DW_MACRO_GNU_transparent_include = 0x07, |
| 414 |
|
| 415 |
|
| 416 |
DW_MACRO_GNU_define_indirect_alt = 0x08, |
| 417 |
DW_MACRO_GNU_undef_indirect_alt = 0x09, |
| 418 |
DW_MACRO_GNU_transparent_include_alt = 0x0a, |
| 419 |
DW_MACRO_GNU_lo_user = 0xe0, |
| 420 |
DW_MACRO_GNU_hi_user = 0xff |
| 421 |
}; |
| 422 |
|
| 423 |
|
| 424 |
enum dwarf_name_index_attribute |
| 425 |
{ |
| 426 |
DW_IDX_compile_unit = 1, |
| 427 |
DW_IDX_type_unit = 2, |
| 428 |
DW_IDX_die_offset = 3, |
| 429 |
DW_IDX_parent = 4, |
| 430 |
DW_IDX_type_hash = 5, |
| 431 |
DW_IDX_lo_user = 0x2000, |
| 432 |
DW_IDX_hi_user = 0x3fff |
| 433 |
}; |
| 434 |
|
| 435 |
|
| 436 |
enum dwarf_range_list_entry |
| 437 |
{ |
| 438 |
DW_RLE_end_of_list = 0x00, |
| 439 |
DW_RLE_base_addressx = 0x01, |
| 440 |
DW_RLE_startx_endx = 0x02, |
| 441 |
DW_RLE_startx_length = 0x03, |
| 442 |
DW_RLE_offset_pair = 0x04, |
| 443 |
DW_RLE_base_address = 0x05, |
| 444 |
DW_RLE_start_end = 0x06, |
| 445 |
DW_RLE_start_length = 0x07 |
| 446 |
}; |
| 447 |
|
| 448 |
|
| 449 |
enum dwarf_unit_type |
| 450 |
{ |
| 451 |
DW_UT_compile = 0x01, |
| 452 |
DW_UT_type = 0x02, |
| 453 |
DW_UT_partial = 0x03, |
| 454 |
DW_UT_skeleton = 0x04, |
| 455 |
DW_UT_split_compile = 0x05, |
| 456 |
DW_UT_split_type = 0x06, |
| 457 |
DW_UT_lo_user = 0x80, |
| 458 |
DW_UT_hi_user = 0xff |
| 459 |
}; |
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
#define DW_EH_PE_absptr 0x00 |
| 464 |
#define DW_EH_PE_omit 0xff |
| 465 |
|
| 466 |
#define DW_EH_PE_uleb128 0x01 |
| 467 |
#define DW_EH_PE_udata2 0x02 |
| 468 |
#define DW_EH_PE_udata4 0x03 |
| 469 |
#define DW_EH_PE_udata8 0x04 |
| 470 |
#define DW_EH_PE_sleb128 0x09 |
| 471 |
#define DW_EH_PE_sdata2 0x0A |
| 472 |
#define DW_EH_PE_sdata4 0x0B |
| 473 |
#define DW_EH_PE_sdata8 0x0C |
| 474 |
#define DW_EH_PE_signed 0x08 |
| 475 |
|
| 476 |
#define DW_EH_PE_pcrel 0x10 |
| 477 |
#define DW_EH_PE_textrel 0x20 |
| 478 |
#define DW_EH_PE_datarel 0x30 |
| 479 |
#define DW_EH_PE_funcrel 0x40 |
| 480 |
#define DW_EH_PE_aligned 0x50 |
| 481 |
|
| 482 |
#define DW_EH_PE_indirect 0x80 |
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
enum dwarf_sect |
| 487 |
{ |
| 488 |
DW_SECT_INFO = 1, |
| 489 |
DW_SECT_TYPES = 2, |
| 490 |
DW_SECT_ABBREV = 3, |
| 491 |
DW_SECT_LINE = 4, |
| 492 |
DW_SECT_LOC = 5, |
| 493 |
DW_SECT_STR_OFFSETS = 6, |
| 494 |
DW_SECT_MACINFO = 7, |
| 495 |
DW_SECT_MACRO = 8, |
| 496 |
DW_SECT_MAX = 8 |
| 497 |
}; |
| 498 |
|
| 499 |
#ifdef __cplusplus |
| 500 |
extern "C" { |
| 501 |
#endif |
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
extern const char *get_DW_TAG_name (unsigned int tag); |
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
extern const char *get_DW_AT_name (unsigned int attr); |
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
extern const char *get_DW_FORM_name (unsigned int form); |
| 514 |
|
| 515 |
|
| 516 |
|
| 517 |
extern const char *get_DW_OP_name (unsigned int op); |
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
extern const char *get_DW_ATE_name (unsigned int enc); |
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
extern const char *get_DW_CFA_name (unsigned int opc); |
| 526 |
|
| 527 |
#ifdef __cplusplus |
| 528 |
} |
| 529 |
#endif |
| 530 |
|
| 531 |
#endif |