2
0

DWARFInfo.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. #pragma once
  2. enum Tag
  3. {
  4. DW_TAG_array_type = 0x01,
  5. DW_TAG_class_type = 0x02,
  6. DW_TAG_entry_point = 0x03,
  7. DW_TAG_enumeration_type = 0x04,
  8. DW_TAG_formal_parameter = 0x05,
  9. DW_TAG_imported_declaration = 0x08,
  10. DW_TAG_label = 0x0a,
  11. DW_TAG_lexical_block = 0x0b,
  12. DW_TAG_member = 0x0d,
  13. DW_TAG_pointer_type = 0x0f,
  14. DW_TAG_reference_type = 0x10,
  15. DW_TAG_compile_unit = 0x11,
  16. DW_TAG_string_type = 0x12,
  17. DW_TAG_structure_type = 0x13,
  18. DW_TAG_subroutine_type = 0x15,
  19. DW_TAG_typedef = 0x16,
  20. DW_TAG_union_type = 0x17,
  21. DW_TAG_unspecified_parameters = 0x18,
  22. DW_TAG_variant = 0x19,
  23. DW_TAG_common_block = 0x1a,
  24. DW_TAG_common_inclusion = 0x1b,
  25. DW_TAG_inheritance = 0x1c,
  26. DW_TAG_inlined_subroutine = 0x1d,
  27. DW_TAG_module = 0x1e,
  28. DW_TAG_ptr_to_member_type = 0x1f,
  29. DW_TAG_set_type = 0x20,
  30. DW_TAG_subrange_type = 0x21,
  31. DW_TAG_with_stmt = 0x22,
  32. DW_TAG_access_declaration = 0x23,
  33. DW_TAG_base_type = 0x24,
  34. DW_TAG_catch_block = 0x25,
  35. DW_TAG_const_type = 0x26,
  36. DW_TAG_constant = 0x27,
  37. DW_TAG_enumerator = 0x28,
  38. DW_TAG_file_type = 0x29,
  39. DW_TAG_friend = 0x2a,
  40. DW_TAG_namelist = 0x2b,
  41. DW_TAG_namelist_item = 0x2c,
  42. DW_TAG_packed_type = 0x2d,
  43. DW_TAG_subprogram = 0x2e,
  44. DW_TAG_template_type_parameter = 0x2f,
  45. DW_TAG_template_value_parameter = 0x30,
  46. DW_TAG_thrown_type = 0x31,
  47. DW_TAG_try_block = 0x32,
  48. DW_TAG_variant_part = 0x33,
  49. DW_TAG_variable = 0x34,
  50. DW_TAG_volatile_type = 0x35,
  51. DW_TAG_dwarf_procedure = 0x36,
  52. DW_TAG_restrict_type = 0x37,
  53. DW_TAG_interface_type = 0x38,
  54. DW_TAG_namespace = 0x39,
  55. DW_TAG_imported_module = 0x3a,
  56. DW_TAG_unspecified_type = 0x3b,
  57. DW_TAG_partial_unit = 0x3c,
  58. DW_TAG_imported_unit = 0x3d,
  59. DW_TAG_condition = 0x3f,
  60. DW_TAG_shared_type = 0x40,
  61. DW_TAG_type_unit = 0x41,
  62. DW_TAG_rvalue_reference_type = 0x42,
  63. DW_TAG_template_alias = 0x43,
  64. // New in DbgModule 5:
  65. DW_TAG_coarray_type = 0x44,
  66. DW_TAG_generic_subrange = 0x45,
  67. DW_TAG_dynamic_type = 0x46,
  68. DW_TAG_MIPS_loop = 0x4081,
  69. DW_TAG_format_label = 0x4101,
  70. DW_TAG_function_template = 0x4102,
  71. DW_TAG_class_template = 0x4103,
  72. DW_TAG_GNU_template_template_param = 0x4106,
  73. DW_TAG_GNU_template_parameter_pack = 0x4107,
  74. DW_TAG_GNU_formal_parameter_pack = 0x4108,
  75. DW_TAG_lo_user = 0x4080,
  76. DW_TAG_APPLE_property = 0x4200,
  77. DW_TAG_hi_user = 0xffff
  78. };
  79. enum Attribute
  80. {
  81. // Attributes
  82. DW_AT_sibling = 0x01,
  83. DW_AT_location = 0x02,
  84. DW_AT_name = 0x03,
  85. DW_AT_ordering = 0x09,
  86. DW_AT_byte_size = 0x0b,
  87. DW_AT_bit_offset = 0x0c,
  88. DW_AT_bit_size = 0x0d,
  89. DW_AT_stmt_list = 0x10,
  90. DW_AT_low_pc = 0x11,
  91. DW_AT_high_pc = 0x12,
  92. DW_AT_language = 0x13,
  93. DW_AT_discr = 0x15,
  94. DW_AT_discr_value = 0x16,
  95. DW_AT_visibility = 0x17,
  96. DW_AT_import = 0x18,
  97. DW_AT_string_length = 0x19,
  98. DW_AT_common_reference = 0x1a,
  99. DW_AT_comp_dir = 0x1b,
  100. DW_AT_const_value = 0x1c,
  101. DW_AT_containing_type = 0x1d,
  102. DW_AT_default_value = 0x1e,
  103. DW_AT_inline = 0x20,
  104. DW_AT_is_optional = 0x21,
  105. DW_AT_lower_bound = 0x22,
  106. DW_AT_producer = 0x25,
  107. DW_AT_prototyped = 0x27,
  108. DW_AT_return_addr = 0x2a,
  109. DW_AT_start_scope = 0x2c,
  110. DW_AT_bit_stride = 0x2e,
  111. DW_AT_upper_bound = 0x2f,
  112. DW_AT_abstract_origin = 0x31,
  113. DW_AT_accessibility = 0x32,
  114. DW_AT_address_class = 0x33,
  115. DW_AT_artificial = 0x34,
  116. DW_AT_base_types = 0x35,
  117. DW_AT_calling_convention = 0x36,
  118. DW_AT_count = 0x37,
  119. DW_AT_data_member_location = 0x38,
  120. DW_AT_decl_column = 0x39,
  121. DW_AT_decl_file = 0x3a,
  122. DW_AT_decl_line = 0x3b,
  123. DW_AT_declaration = 0x3c,
  124. DW_AT_discr_list = 0x3d,
  125. DW_AT_encoding = 0x3e,
  126. DW_AT_external = 0x3f,
  127. DW_AT_frame_base = 0x40,
  128. DW_AT_friend = 0x41,
  129. DW_AT_identifier_case = 0x42,
  130. DW_AT_macro_info = 0x43,
  131. DW_AT_namelist_item = 0x44,
  132. DW_AT_priority = 0x45,
  133. DW_AT_segment = 0x46,
  134. DW_AT_specification = 0x47,
  135. DW_AT_static_link = 0x48,
  136. DW_AT_type = 0x49,
  137. DW_AT_use_location = 0x4a,
  138. DW_AT_variable_parameter = 0x4b,
  139. DW_AT_virtuality = 0x4c,
  140. DW_AT_vtable_elem_location = 0x4d,
  141. DW_AT_allocated = 0x4e,
  142. DW_AT_associated = 0x4f,
  143. DW_AT_data_location = 0x50,
  144. DW_AT_byte_stride = 0x51,
  145. DW_AT_entry_pc = 0x52,
  146. DW_AT_use_UTF8 = 0x53,
  147. DW_AT_extension = 0x54,
  148. DW_AT_ranges = 0x55,
  149. DW_AT_trampoline = 0x56,
  150. DW_AT_call_column = 0x57,
  151. DW_AT_call_file = 0x58,
  152. DW_AT_call_line = 0x59,
  153. DW_AT_description = 0x5a,
  154. DW_AT_binary_scale = 0x5b,
  155. DW_AT_decimal_scale = 0x5c,
  156. DW_AT_small = 0x5d,
  157. DW_AT_decimal_sign = 0x5e,
  158. DW_AT_digit_count = 0x5f,
  159. DW_AT_picture_string = 0x60,
  160. DW_AT_mutable = 0x61,
  161. DW_AT_threads_scaled = 0x62,
  162. DW_AT_explicit = 0x63,
  163. DW_AT_object_pointer = 0x64,
  164. DW_AT_endianity = 0x65,
  165. DW_AT_elemental = 0x66,
  166. DW_AT_pure = 0x67,
  167. DW_AT_recursive = 0x68,
  168. DW_AT_signature = 0x69,
  169. DW_AT_main_subprogram = 0x6a,
  170. DW_AT_data_bit_offset = 0x6b,
  171. DW_AT_const_expr = 0x6c,
  172. DW_AT_enum_class = 0x6d,
  173. DW_AT_linkage_name = 0x6e,
  174. // New in DbgModule 5:
  175. DW_AT_string_length_bit_size = 0x6f,
  176. DW_AT_string_length_byte_size = 0x70,
  177. DW_AT_rank = 0x71,
  178. DW_AT_str_offsets_base = 0x72,
  179. DW_AT_addr_base = 0x73,
  180. DW_AT_ranges_base = 0x74,
  181. DW_AT_dwo_id = 0x75,
  182. DW_AT_dwo_name = 0x76,
  183. DW_AT_reference = 0x77,
  184. DW_AT_rvalue_reference = 0x78,
  185. DW_AT_lo_user = 0x2000,
  186. DW_AT_hi_user = 0x3fff,
  187. DW_AT_MIPS_loop_begin = 0x2002,
  188. DW_AT_MIPS_tail_loop_begin = 0x2003,
  189. DW_AT_MIPS_epilog_begin = 0x2004,
  190. DW_AT_MIPS_loop_unroll_factor = 0x2005,
  191. DW_AT_MIPS_software_pipeline_depth = 0x2006,
  192. DW_AT_MIPS_linkage_name = 0x2007,
  193. DW_AT_MIPS_stride = 0x2008,
  194. DW_AT_MIPS_abstract_name = 0x2009,
  195. DW_AT_MIPS_clone_origin = 0x200a,
  196. DW_AT_MIPS_has_inlines = 0x200b,
  197. DW_AT_MIPS_stride_byte = 0x200c,
  198. DW_AT_MIPS_stride_elem = 0x200d,
  199. DW_AT_MIPS_ptr_dopetype = 0x200e,
  200. DW_AT_MIPS_allocatable_dopetype = 0x200f,
  201. DW_AT_MIPS_assumed_shape_dopetype = 0x2010,
  202. // This one appears to have only been implemented by Open64 for
  203. // fortran and may conflict with other extensions.
  204. DW_AT_MIPS_assumed_size = 0x2011,
  205. // GNU extensions
  206. DW_AT_sf_names = 0x2101,
  207. DW_AT_src_info = 0x2102,
  208. DW_AT_mac_info = 0x2103,
  209. DW_AT_src_coords = 0x2104,
  210. DW_AT_body_begin = 0x2105,
  211. DW_AT_body_end = 0x2106,
  212. DW_AT_GNU_vector = 0x2107,
  213. DW_AT_GNU_template_name = 0x2110,
  214. DW_AT_GNU_odr_signature = 0x210f,
  215. // Extensions for Fission proposal.
  216. DW_AT_GNU_dwo_name = 0x2130,
  217. DW_AT_GNU_dwo_id = 0x2131,
  218. DW_AT_GNU_ranges_base = 0x2132,
  219. DW_AT_GNU_addr_base = 0x2133,
  220. DW_AT_GNU_pubnames = 0x2134,
  221. DW_AT_GNU_pubtypes = 0x2135,
  222. // Apple extensions.
  223. DW_AT_APPLE_optimized = 0x3fe1,
  224. DW_AT_APPLE_flags = 0x3fe2,
  225. DW_AT_APPLE_isa = 0x3fe3,
  226. DW_AT_APPLE_block = 0x3fe4,
  227. DW_AT_APPLE_major_runtime_vers = 0x3fe5,
  228. DW_AT_APPLE_runtime_class = 0x3fe6,
  229. DW_AT_APPLE_omit_frame_ptr = 0x3fe7,
  230. DW_AT_APPLE_property_name = 0x3fe8,
  231. DW_AT_APPLE_property_getter = 0x3fe9,
  232. DW_AT_APPLE_property_setter = 0x3fea,
  233. DW_AT_APPLE_property_attribute = 0x3feb,
  234. DW_AT_APPLE_objc_complete_type = 0x3fec,
  235. DW_AT_APPLE_property = 0x3fed
  236. };
  237. enum Constants
  238. {
  239. // Children flag
  240. DW_CHILDREN_no = 0x00,
  241. DW_CHILDREN_yes = 0x01,
  242. DW_EH_PE_absptr = 0x00,
  243. DW_EH_PE_omit = 0xff,
  244. DW_EH_PE_uleb128 = 0x01,
  245. DW_EH_PE_udata2 = 0x02,
  246. DW_EH_PE_udata4 = 0x03,
  247. DW_EH_PE_udata8 = 0x04,
  248. DW_EH_PE_sleb128 = 0x09,
  249. DW_EH_PE_sdata2 = 0x0A,
  250. DW_EH_PE_sdata4 = 0x0B,
  251. DW_EH_PE_sdata8 = 0x0C,
  252. DW_EH_PE_signed = 0x08,
  253. DW_EH_PE_pcrel = 0x10,
  254. DW_EH_PE_textrel = 0x20,
  255. DW_EH_PE_datarel = 0x30,
  256. DW_EH_PE_funcrel = 0x40,
  257. DW_EH_PE_aligned = 0x50,
  258. DW_EH_PE_indirect = 0x80
  259. };
  260. enum Forms
  261. {
  262. // Attribute form encodings
  263. DW_FORM_addr = 0x01,
  264. DW_FORM_block2 = 0x03,
  265. DW_FORM_block4 = 0x04,
  266. DW_FORM_data2 = 0x05,
  267. DW_FORM_data4 = 0x06,
  268. DW_FORM_data8 = 0x07,
  269. DW_FORM_string = 0x08,
  270. DW_FORM_block = 0x09,
  271. DW_FORM_block1 = 0x0a,
  272. DW_FORM_data1 = 0x0b,
  273. DW_FORM_flag = 0x0c,
  274. DW_FORM_sdata = 0x0d,
  275. DW_FORM_strp = 0x0e,
  276. DW_FORM_udata = 0x0f,
  277. DW_FORM_ref_addr = 0x10,
  278. DW_FORM_ref1 = 0x11,
  279. DW_FORM_ref2 = 0x12,
  280. DW_FORM_ref4 = 0x13,
  281. DW_FORM_ref8 = 0x14,
  282. DW_FORM_ref_udata = 0x15,
  283. DW_FORM_indirect = 0x16,
  284. DW_FORM_sec_offset = 0x17,
  285. DW_FORM_exprloc = 0x18,
  286. DW_FORM_flag_present = 0x19,
  287. DW_FORM_ref_sig8 = 0x20,
  288. // Extensions for Fission proposal
  289. DW_FORM_GNU_addr_index = 0x1f01,
  290. DW_FORM_GNU_str_index = 0x1f02
  291. };
  292. enum LineNumberOps
  293. {
  294. // Line Number Standard Opcode Encodings
  295. DW_LNS_extended_op = 0x00,
  296. DW_LNS_copy = 0x01,
  297. DW_LNS_advance_pc = 0x02,
  298. DW_LNS_advance_line = 0x03,
  299. DW_LNS_set_file = 0x04,
  300. DW_LNS_set_column = 0x05,
  301. DW_LNS_negate_stmt = 0x06,
  302. DW_LNS_set_basic_block = 0x07,
  303. DW_LNS_const_add_pc = 0x08,
  304. DW_LNS_fixed_advance_pc = 0x09,
  305. DW_LNS_set_prologue_end = 0x0a,
  306. DW_LNS_set_epilogue_begin = 0x0b,
  307. DW_LNS_set_isa = 0x0c
  308. };
  309. enum LineNumberExtendedOps
  310. {
  311. // Line Number Extended Opcode Encodings
  312. DW_LNE_end_sequence = 0x01,
  313. DW_LNE_set_address = 0x02,
  314. DW_LNE_define_file = 0x03,
  315. DW_LNE_set_discriminator = 0x04,
  316. DW_LNE_lo_user = 0x80,
  317. DW_LNE_hi_user = 0xff
  318. };
  319. enum
  320. {
  321. // Encoding attribute values
  322. DW_ATE_address = 0x01,
  323. DW_ATE_boolean = 0x02,
  324. DW_ATE_complex_float = 0x03,
  325. DW_ATE_float = 0x04,
  326. DW_ATE_signed = 0x05,
  327. DW_ATE_signed_char = 0x06,
  328. DW_ATE_unsigned = 0x07,
  329. DW_ATE_unsigned_char = 0x08,
  330. DW_ATE_imaginary_float = 0x09,
  331. DW_ATE_packed_decimal = 0x0a,
  332. DW_ATE_numeric_string = 0x0b,
  333. DW_ATE_edited = 0x0c,
  334. DW_ATE_signed_fixed = 0x0d,
  335. DW_ATE_unsigned_fixed = 0x0e,
  336. DW_ATE_decimal_float = 0x0f,
  337. DW_ATE_UTF = 0x10,
  338. DW_ATE_lo_user = 0x80,
  339. DW_ATE_hi_user = 0xff,
  340. };
  341. // Operation encodings
  342. enum
  343. {
  344. DW_OP_addr = 0x03,
  345. DW_OP_deref = 0x06,
  346. DW_OP_const1u = 0x08,
  347. DW_OP_const1s = 0x09,
  348. DW_OP_const2u = 0x0a,
  349. DW_OP_const2s = 0x0b,
  350. DW_OP_const4u = 0x0c,
  351. DW_OP_const4s = 0x0d,
  352. DW_OP_const8u = 0x0e,
  353. DW_OP_const8s = 0x0f,
  354. DW_OP_constu = 0x10,
  355. DW_OP_consts = 0x11,
  356. DW_OP_dup = 0x12,
  357. DW_OP_drop = 0x13,
  358. DW_OP_over = 0x14,
  359. DW_OP_pick = 0x15,
  360. DW_OP_swap = 0x16,
  361. DW_OP_rot = 0x17,
  362. DW_OP_xderef = 0x18,
  363. DW_OP_abs = 0x19,
  364. DW_OP_and = 0x1a,
  365. DW_OP_div = 0x1b,
  366. DW_OP_minus = 0x1c,
  367. DW_OP_mod = 0x1d,
  368. DW_OP_mul = 0x1e,
  369. DW_OP_neg = 0x1f,
  370. DW_OP_not = 0x20,
  371. DW_OP_or = 0x21,
  372. DW_OP_plus = 0x22,
  373. DW_OP_plus_uconst = 0x23,
  374. DW_OP_shl = 0x24,
  375. DW_OP_shr = 0x25,
  376. DW_OP_shra = 0x26,
  377. DW_OP_xor = 0x27,
  378. DW_OP_skip = 0x2f,
  379. DW_OP_bra = 0x28,
  380. DW_OP_eq = 0x29,
  381. DW_OP_ge = 0x2a,
  382. DW_OP_gt = 0x2b,
  383. DW_OP_le = 0x2c,
  384. DW_OP_lt = 0x2d,
  385. DW_OP_ne = 0x2e,
  386. DW_OP_lit0 = 0x30,
  387. DW_OP_lit1 = 0x31,
  388. DW_OP_lit31 = 0x4f,
  389. DW_OP_reg0 = 0x50,
  390. DW_OP_reg1 = 0x51,
  391. DW_OP_reg2 = 0x52,
  392. DW_OP_reg3 = 0x53,
  393. DW_OP_reg4 = 0x54,
  394. DW_OP_reg5 = 0x55,
  395. DW_OP_reg6 = 0x56,
  396. DW_OP_reg7 = 0x57,
  397. DW_OP_reg8 = 0x58,
  398. DW_OP_reg9 = 0x59,
  399. DW_OP_reg10 = 0x5a,
  400. DW_OP_reg11 = 0x5b,
  401. DW_OP_reg12 = 0x5c,
  402. DW_OP_reg13 = 0x5d,
  403. DW_OP_reg14 = 0x5e,
  404. DW_OP_reg15 = 0x5f,
  405. DW_OP_reg16 = 0x60,
  406. DW_OP_reg17 = 0x61,
  407. DW_OP_reg18 = 0x62,
  408. DW_OP_reg19 = 0x63,
  409. DW_OP_reg20 = 0x64,
  410. DW_OP_reg21 = 0x65,
  411. DW_OP_reg22 = 0x66,
  412. DW_OP_reg23 = 0x66,
  413. DW_OP_reg24 = 0x68,
  414. DW_OP_reg25 = 0x69,
  415. DW_OP_reg26 = 0x6a,
  416. DW_OP_reg27 = 0x6b,
  417. DW_OP_reg28 = 0x6c,
  418. DW_OP_reg29 = 0x6d,
  419. DW_OP_reg30 = 0x6e,
  420. DW_OP_reg31 = 0x6f,
  421. DW_OP_breg0 = 0x70,
  422. DW_OP_breg1 = 0x71,
  423. DW_OP_breg2 = 0x72,
  424. DW_OP_breg3 = 0x73,
  425. DW_OP_breg4 = 0x74,
  426. DW_OP_breg5 = 0x75,
  427. DW_OP_breg6 = 0x76,
  428. DW_OP_breg7 = 0x77,
  429. DW_OP_breg8 = 0x78,
  430. DW_OP_breg9 = 0x79,
  431. DW_OP_breg10 = 0x7A,
  432. DW_OP_breg11 = 0x7B,
  433. DW_OP_breg12 = 0x7C,
  434. DW_OP_breg13 = 0x7D,
  435. DW_OP_breg14 = 0x7E,
  436. DW_OP_breg15 = 0x7F,
  437. DW_OP_breg31 = 0x8f,
  438. DW_OP_regx = 0x90,
  439. DW_OP_fbreg = 0x91,
  440. DW_OP_bregx = 0x92,
  441. DW_OP_piece = 0x93,
  442. DW_OP_deref_size = 0x94,
  443. DW_OP_xderef_size = 0x95,
  444. DW_OP_nop = 0x96,
  445. DW_OP_push_object_address = 0x97,
  446. DW_OP_call2 = 0x98,
  447. DW_OP_call4 = 0x99,
  448. DW_OP_call_ref = 0x9a,
  449. DW_OP_form_tls_address = 0x9b,
  450. DW_OP_call_frame_cfa = 0x9c,
  451. DW_OP_implicit_value = 0x9e,
  452. DW_OP_stack_value = 0x9f,
  453. DW_OP_lo_user = 0xe0,
  454. DW_OP_GNU_push_tls_address = 0xe0,
  455. DW_OP_hi_user = 0xff,
  456. DW_OP_addr_noRemap = 0xf0
  457. };
  458. // Call frame instruction encodings
  459. enum
  460. {
  461. DW_CFA_extended = 0x00,
  462. DW_CFA_nop = 0x00,
  463. DW_CFA_advance_loc = 0x40,
  464. DW_CFA_offset0 = 0x80,
  465. DW_CFA_offset1 = 0x81,
  466. DW_CFA_offset2 = 0x82,
  467. DW_CFA_offset3 = 0x83,
  468. DW_CFA_offset4 = 0x84,
  469. DW_CFA_offset5 = 0x85,
  470. DW_CFA_offset6 = 0x86,
  471. DW_CFA_offset7 = 0x87,
  472. DW_CFA_offset8 = 0x88,
  473. DW_CFA_offset = 0x80,
  474. DW_CFA_restore = 0xc0,
  475. DW_CFA_set_loc = 0x01,
  476. DW_CFA_advance_loc1 = 0x02,
  477. DW_CFA_advance_loc2 = 0x03,
  478. DW_CFA_advance_loc4 = 0x04,
  479. DW_CFA_offset_extended = 0x05,
  480. DW_CFA_restore_extended = 0x06,
  481. DW_CFA_undefined = 0x07,
  482. DW_CFA_same_value = 0x08,
  483. DW_CFA_register = 0x09,
  484. DW_CFA_remember_state = 0x0a,
  485. DW_CFA_restore_state = 0x0b,
  486. DW_CFA_def_cfa = 0x0c,
  487. DW_CFA_def_cfa_register = 0x0d,
  488. DW_CFA_def_cfa_offset = 0x0e,
  489. DW_CFA_def_cfa_expression = 0x0f,
  490. DW_CFA_expression = 0x10,
  491. DW_CFA_offset_extended_sf = 0x11,
  492. DW_CFA_def_cfa_sf = 0x12,
  493. DW_CFA_def_cfa_offset_sf = 0x13,
  494. DW_CFA_val_offset = 0x14,
  495. DW_CFA_val_offset_sf = 0x15,
  496. DW_CFA_val_expression = 0x16,
  497. DW_CFA_lo_user = 0x1c,
  498. DW_CFA_hi_user = 0x3f,
  499. };
  500. enum SymbolFlags
  501. {
  502. SF_TypeMask = 0x0000FFFF,
  503. SF_TypeShift = 0,
  504. SF_ClassMask = 0x00FF0000,
  505. SF_ClassShift = 16,
  506. SF_WeakExternal = 0x01000000
  507. };
  508. enum SymbolSectionNumber
  509. {
  510. COFF_SYM_DEBUG = -2,
  511. COFF_SYM_ABSOLUTE = -1,
  512. COFF_SYM_UNDEFINED = 0
  513. };
  514. /// Storage class tells where and what the symbol represents
  515. enum SymbolStorageClass
  516. {
  517. SSC_Invalid = 0xff,
  518. COFF_SYM_CLASS_END_OF_FUNCTION = -1, ///< Physical end of function
  519. COFF_SYM_CLASS_NULL = 0, ///< No symbol
  520. COFF_SYM_CLASS_AUTOMATIC = 1, ///< Stack variable
  521. COFF_SYM_CLASS_EXTERNAL = 2, ///< External symbol
  522. COFF_SYM_CLASS_STATIC = 3, ///< Static
  523. COFF_SYM_CLASS_REGISTER = 4, ///< Register variable
  524. COFF_SYM_CLASS_EXTERNAL_DEF = 5, ///< External definition
  525. COFF_SYM_CLASS_LABEL = 6, ///< Label
  526. COFF_SYM_CLASS_UNDEFINED_LABEL = 7, ///< Undefined label
  527. COFF_SYM_CLASS_MEMBER_OF_STRUCT = 8, ///< Member of structure
  528. COFF_SYM_CLASS_ARGUMENT = 9, ///< Function argument
  529. COFF_SYM_CLASS_STRUCT_TAG = 10, ///< Structure tag
  530. COFF_SYM_CLASS_MEMBER_OF_UNION = 11, ///< Member of union
  531. COFF_SYM_CLASS_UNION_TAG = 12, ///< Union tag
  532. COFF_SYM_CLASS_TYPE_DEFINITION = 13, ///< Type definition
  533. COFF_SYM_CLASS_UNDEFINED_STATIC = 14, ///< Undefined static
  534. COFF_SYM_CLASS_ENUM_TAG = 15, ///< Enumeration tag
  535. COFF_SYM_CLASS_MEMBER_OF_ENUM = 16, ///< Member of enumeration
  536. COFF_SYM_CLASS_REGISTER_PARAM = 17, ///< Register parameter
  537. COFF_SYM_CLASS_BIT_FIELD = 18, ///< Bit field
  538. /// ".bb" or ".eb" - beginning or end of block
  539. COFF_SYM_CLASS_BLOCK = 100,
  540. /// ".bf" or ".ef" - beginning or end of function
  541. COFF_SYM_CLASS_FUNCTION = 101,
  542. COFF_SYM_CLASS_END_OF_STRUCT = 102, ///< End of structure
  543. COFF_SYM_CLASS_FILE = 103, ///< File name
  544. /// Line number, reformatted as symbol
  545. COFF_SYM_CLASS_SECTION = 104,
  546. COFF_SYM_CLASS_WEAK_EXTERNAL = 105, ///< Duplicate tag
  547. /// External symbol in dmert public lib
  548. COFF_SYM_CLASS_CLR_TOKEN = 107
  549. };
  550. enum SymbolBaseType
  551. {
  552. COFF_SYM_TYPE_NULL = 0, ///< No type information or unknown base type.
  553. COFF_SYM_TYPE_VOID = 1, ///< Used with void pointers and functions.
  554. COFF_SYM_TYPE_CHAR = 2, ///< A character (signed byte).
  555. COFF_SYM_TYPE_SHORT = 3, ///< A 2-byte signed integer.
  556. COFF_SYM_TYPE_INT = 4, ///< A natural integer type on the target.
  557. COFF_SYM_TYPE_LONG = 5, ///< A 4-byte signed integer.
  558. COFF_SYM_TYPE_FLOAT = 6, ///< A 4-byte floating-point number.
  559. COFF_SYM_TYPE_DOUBLE = 7, ///< An 8-byte floating-point number.
  560. COFF_SYM_TYPE_STRUCT = 8, ///< A structure.
  561. COFF_SYM_TYPE_UNION = 9, ///< An union.
  562. COFF_SYM_TYPE_ENUM = 10, ///< An enumerated type.
  563. COFF_SYM_TYPE_MOE = 11, ///< A member of enumeration (a specific value).
  564. COFF_SYM_TYPE_BYTE = 12, ///< A byte; unsigned 1-byte integer.
  565. COFF_SYM_TYPE_WORD = 13, ///< A word; unsigned 2-byte integer.
  566. COFF_SYM_TYPE_UINT = 14, ///< An unsigned integer of natural size.
  567. COFF_SYM_TYPE_DWORD = 15 ///< An unsigned 4-byte integer.
  568. };
  569. enum SymbolComplexType
  570. {
  571. COFF_SYM_DTYPE_NULL = 0, ///< No complex type; simple scalar variable.
  572. COFF_SYM_DTYPE_POINTER = 1, ///< A pointer to base type.
  573. COFF_SYM_DTYPE_FUNCTION = 2, ///< A function that returns a base type.
  574. COFF_SYM_DTYPE_ARRAY = 3, ///< An array of base type.
  575. /// Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
  576. SCT_COMPLEX_TYPE_SHIFT = 4
  577. };
  578. enum RelocationTypeI386
  579. {
  580. COFF_REL_I386_ABSOLUTE = 0x0000,
  581. COFF_REL_I386_DIR16 = 0x0001,
  582. COFF_REL_I386_REL16 = 0x0002,
  583. COFF_REL_I386_DIR32 = 0x0006,
  584. COFF_REL_I386_DIR32NB = 0x0007,
  585. COFF_REL_I386_SEG12 = 0x0009,
  586. COFF_REL_I386_SECTION = 0x000A,
  587. COFF_REL_I386_SECREL = 0x000B,
  588. COFF_REL_I386_TOKEN = 0x000C,
  589. COFF_REL_I386_SECREL7 = 0x000D,
  590. COFF_REL_I386_REL32 = 0x0014
  591. };
  592. enum RelocationTypeAMD64
  593. {
  594. COFF_REL_AMD64_ABSOLUTE = 0x0000,
  595. COFF_REL_AMD64_ADDR64 = 0x0001,
  596. COFF_REL_AMD64_ADDR32 = 0x0002,
  597. COFF_REL_AMD64_ADDR32NB = 0x0003,
  598. COFF_REL_AMD64_REL32 = 0x0004,
  599. COFF_REL_AMD64_REL32_1 = 0x0005,
  600. COFF_REL_AMD64_REL32_2 = 0x0006,
  601. COFF_REL_AMD64_REL32_3 = 0x0007,
  602. COFF_REL_AMD64_REL32_4 = 0x0008,
  603. COFF_REL_AMD64_REL32_5 = 0x0009,
  604. COFF_REL_AMD64_SECTION = 0x000A,
  605. COFF_REL_AMD64_SECREL = 0x000B,
  606. COFF_REL_AMD64_SECREL7 = 0x000C,
  607. COFF_REL_AMD64_TOKEN = 0x000D,
  608. COFF_REL_AMD64_SREL32 = 0x000E,
  609. COFF_REL_AMD64_PAIR = 0x000F,
  610. COFF_REL_AMD64_SSPAN32 = 0x0010
  611. };