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