Changeset 1170cfc7 in mainline


Ignore:
Timestamp:
2023-10-28T17:42:47Z (6 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
3e05a69
Parents:
63ed840
Message:

Remove include sorcery from DWARF constant definitions

Also add a bunch of missing constants.

Location:
kernel/generic
Files:
1 added
18 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/debug/constants.h

    r63ed840 r1170cfc7  
    3131
    3232enum {
    33         DW_SECT_INFO        = 1,  // .debug_info.dwo
    34         DW_SECT_ABBREV      = 3,  // .debug_abbrev.dwo
    35         DW_SECT_LINE        = 4,  // .debug_line.dwo
    36         DW_SECT_LOCLISTS    = 5,  // .debug_loclists.dwo
    37         DW_SECT_STR_OFFSETS = 6,  // .debug_str_offsets.dwo
    38         DW_SECT_MACRO       = 7,  // .debug_macro.dwo
    39         DW_SECT_RNGLISTS    = 8,  // .debug_rnglists.dwo
    40 };
    41 
    42 // ^(DW_[^ ]*) [‡† ]*([^ ]*).*
    43 
    44 #define CVAL(name, value) name = value,
    45 
    46 enum {
    47 #include "constants/dw_ut.inc"
     33        DW_SECT_INFO = 1,        // .debug_info.dwo
     34        DW_SECT_ABBREV = 3,      // .debug_abbrev.dwo
     35        DW_SECT_LINE = 4,        // .debug_line.dwo
     36        DW_SECT_LOCLISTS = 5,    // .debug_loclists.dwo
     37        DW_SECT_STR_OFFSETS = 6, // .debug_str_offsets.dwo
     38        DW_SECT_MACRO = 7,       // .debug_macro.dwo
     39        DW_SECT_RNGLISTS = 8,    // .debug_rnglists.dwo
     40
     41        DW_SECT_MAX,
     42};
     43
     44enum {
     45        DW_ACCESS_public = 0x01,
     46        DW_ACCESS_protected = 0x02,
     47        DW_ACCESS_private = 0x03,
     48
     49        DW_ACCESS_MAX,
     50};
     51
     52enum {
     53        DW_AT_sibling = 0x01,
     54        DW_AT_location = 0x02,
     55        DW_AT_name = 0x03,
     56        DW_AT_reserved_0x04 = 0x04,
     57        DW_AT_fund_type = 0x05,
     58        DW_AT_mod_fund_type = 0x06,
     59        DW_AT_user_def_type = 0x07,
     60        DW_AT_mod_u_d_type = 0x08,
     61        DW_AT_ordering = 0x09,
     62        DW_AT_subscr_data = 0x0a,
     63        DW_AT_byte_size = 0x0b,
     64        DW_AT_bit_offset = 0x0c,
     65        DW_AT_bit_size = 0x0d,
     66        DW_AT_reserved_0x0e = 0x0e,
     67        DW_AT_unused8 = 0x0f,
     68        DW_AT_stmt_list = 0x10,
     69        DW_AT_low_pc = 0x11,
     70        DW_AT_high_pc = 0x12,
     71        DW_AT_language = 0x13,
     72        DW_AT_member = 0x14,
     73        DW_AT_discr = 0x15,
     74        DW_AT_discr_value = 0x16,
     75        DW_AT_visibility = 0x17,
     76        DW_AT_import = 0x18,
     77        DW_AT_string_length = 0x19,
     78        DW_AT_common_reference = 0x1a,
     79        DW_AT_comp_dir = 0x1b,
     80        DW_AT_const_value = 0x1c,
     81        DW_AT_containing_type = 0x1d,
     82        DW_AT_default_value = 0x1e,
     83        DW_AT_reserved_0x1f = 0x1f,
     84        DW_AT_inline = 0x20,
     85        DW_AT_is_optional = 0x21,
     86        DW_AT_lower_bound = 0x22,
     87        DW_AT_reserved_0x23 = 0x23,
     88        DW_AT_reserved_0x24 = 0x24,
     89        DW_AT_producer = 0x25,
     90        DW_AT_reserved_0x26 = 0x26,
     91        DW_AT_prototyped = 0x27,
     92        DW_AT_reserved_0x28 = 0x28,
     93        DW_AT_reserved_0x29 = 0x29,
     94        DW_AT_return_addr = 0x2a,
     95        DW_AT_reserved_0x2b = 0x2b,
     96        DW_AT_start_scope = 0x2c,
     97        DW_AT_reserved_0x2d = 0x2d,
     98        DW_AT_bit_stride = 0x2e,
     99        DW_AT_upper_bound = 0x2f,
     100        DW_AT_virtual = 0x30,
     101        DW_AT_abstract_origin = 0x31,
     102        DW_AT_accessibility = 0x32,
     103        DW_AT_address_class = 0x33,
     104        DW_AT_artificial = 0x34,
     105        DW_AT_base_types = 0x35,
     106        DW_AT_calling_convention = 0x36,
     107        DW_AT_count = 0x37,
     108        DW_AT_data_member_location = 0x38,
     109        DW_AT_decl_column = 0x39,
     110        DW_AT_decl_file = 0x3a,
     111        DW_AT_decl_line = 0x3b,
     112        DW_AT_declaration = 0x3c,
     113        DW_AT_discr_list = 0x3d,
     114        DW_AT_encoding = 0x3e,
     115        DW_AT_external = 0x3f,
     116        DW_AT_frame_base = 0x40,
     117        DW_AT_friend = 0x41,
     118        DW_AT_identifier_case = 0x42,
     119        DW_AT_macro_info = 0x43,
     120        DW_AT_namelist_item = 0x44,
     121        DW_AT_priority = 0x45,
     122        DW_AT_segment = 0x46,
     123        DW_AT_specification = 0x47,
     124        DW_AT_static_link = 0x48,
     125        DW_AT_type = 0x49,
     126        DW_AT_use_location = 0x4a,
     127        DW_AT_variable_parameter = 0x4b,
     128        DW_AT_virtuality = 0x4c,
     129        DW_AT_vtable_elem_location = 0x4d,
     130        DW_AT_allocated = 0x4e,
     131        DW_AT_associated = 0x4f,
     132        DW_AT_data_location = 0x50,
     133        DW_AT_byte_stride = 0x51,
     134        DW_AT_entry_pc = 0x52,
     135        DW_AT_use_UTF8 = 0x53,
     136        DW_AT_extension = 0x54,
     137        DW_AT_ranges = 0x55,
     138        DW_AT_trampoline = 0x56,
     139        DW_AT_call_column = 0x57,
     140        DW_AT_call_file = 0x58,
     141        DW_AT_call_line = 0x59,
     142        DW_AT_description = 0x5a,
     143        DW_AT_binary_scale = 0x5b,
     144        DW_AT_decimal_scale = 0x5c,
     145        DW_AT_small = 0x5d,
     146        DW_AT_decimal_sign = 0x5e,
     147        DW_AT_digit_count = 0x5f,
     148        DW_AT_picture_string = 0x60,
     149        DW_AT_mutable = 0x61,
     150        DW_AT_threads_scaled = 0x62,
     151        DW_AT_explicit = 0x63,
     152        DW_AT_object_pointer = 0x64,
     153        DW_AT_endianity = 0x65,
     154        DW_AT_elemental = 0x66,
     155        DW_AT_pure = 0x67,
     156        DW_AT_recursive = 0x68,
     157        DW_AT_signature = 0x69,
     158        DW_AT_main_subprogram = 0x6a,
     159        DW_AT_data_bit_offset = 0x6b,
     160        DW_AT_const_expr = 0x6c,
     161        DW_AT_enum_class = 0x6d,
     162        DW_AT_linkage_name = 0x6e,
     163        DW_AT_string_length_bit_size = 0x6f,
     164        DW_AT_string_length_byte_size = 0x70,
     165        DW_AT_rank = 0x71,
     166        DW_AT_str_offsets_base = 0x72,
     167        DW_AT_addr_base = 0x73,
     168        DW_AT_rnglists_base = 0x74,
     169        DW_AT_dwo_id = 0x75,
     170        DW_AT_dwo_name = 0x76,
     171        DW_AT_reference = 0x77,
     172        DW_AT_rvalue_reference = 0x78,
     173        DW_AT_macros = 0x79,
     174        DW_AT_call_all_calls = 0x7a,
     175        DW_AT_call_all_source_calls = 0x7b,
     176        DW_AT_call_all_tail_calls = 0x7c,
     177        DW_AT_call_return_pc = 0x7d,
     178        DW_AT_call_value = 0x7e,
     179        DW_AT_call_origin = 0x7f,
     180        DW_AT_call_parameter = 0x80,
     181        DW_AT_call_pc = 0x81,
     182        DW_AT_call_tail_call = 0x82,
     183        DW_AT_call_target = 0x83,
     184        DW_AT_call_target_clobbered = 0x84,
     185        DW_AT_call_data_location = 0x85,
     186        DW_AT_call_data_value = 0x86,
     187        DW_AT_noreturn = 0x87,
     188        DW_AT_alignment = 0x88,
     189        DW_AT_export_symbols = 0x89,
     190        DW_AT_deleted = 0x8a,
     191        DW_AT_defaulted = 0x8b,
     192        DW_AT_loclists_base = 0x8c,
     193
     194        DW_AT_MAX,
     195
     196        DW_AT_lo_user = 0x2000,
     197        DW_AT_hi_user = 0x3fff,
     198};
     199
     200enum {
     201        DW_ATE_address = 0x01,
     202        DW_ATE_boolean = 0x02,
     203        DW_ATE_complex_float = 0x03,
     204        DW_ATE_float = 0x04,
     205        DW_ATE_signed = 0x05,
     206        DW_ATE_signed_char = 0x06,
     207        DW_ATE_unsigned = 0x07,
     208        DW_ATE_unsigned_char = 0x08,
     209        DW_ATE_imaginary_float = 0x09,
     210        DW_ATE_packed_decimal = 0x0a,
     211        DW_ATE_numeric_string = 0x0b,
     212        DW_ATE_edited = 0x0c,
     213        DW_ATE_signed_fixed = 0x0d,
     214        DW_ATE_unsigned_fixed = 0x0e,
     215        DW_ATE_decimal_float = 0x0f,
     216        DW_ATE_UTF = 0x10,
     217        DW_ATE_UCS = 0x11,
     218        DW_ATE_ASCII = 0x12,
     219
     220        DW_ATE_MAX,
     221
     222        DW_ATE_lo_user = 0x80,
     223        DW_ATE_hi_user = 0xff,
     224};
     225
     226enum {
     227        DW_CC_normal = 0x01,
     228        DW_CC_program = 0x02,
     229        DW_CC_nocall = 0x03,
     230        DW_CC_pass_by_reference = 0x04,
     231        DW_CC_pass_by_value = 0x05,
     232
     233        DW_CC_MAX,
     234
     235        DW_CC_lo_user = 0x40,
     236        DW_CC_hi_user = 0xff,
     237};
     238
     239enum {
     240        DW_UT_compile = 1,
     241        DW_UT_type = 2,
     242        DW_UT_partial = 3,
     243        DW_UT_skeleton = 4,
     244        DW_UT_split_compile = 5,
     245        DW_UT_split_type = 6,
     246
     247        DW_UT_MAX,
    48248
    49249        DW_UT_lo_user = 0x80,
     
    52252
    53253enum {
    54 #include "constants/dw_tag.inc"
     254        DW_TAG_array_type = 0x01,
     255        DW_TAG_class_type = 0x02,
     256        DW_TAG_entry_point = 0x03,
     257        DW_TAG_enumeration_type = 0x04,
     258        DW_TAG_formal_parameter = 0x05,
     259        DW_TAG_global_subroutine = 0x06,
     260        DW_TAG_global_variable = 0x07,
     261        DW_TAG_imported_declaration = 0x08,
     262        DW_TAG_reserved_0x09 = 0x09,
     263        DW_TAG_label = 0x0a,
     264        DW_TAG_lexical_block = 0x0b,
     265        DW_TAG_local_variable = 0x0c,
     266        DW_TAG_member = 0x0d,
     267        DW_TAG_reserved_0x0e = 0x0e,
     268        DW_TAG_pointer_type = 0x0f,
     269        DW_TAG_reference_type = 0x10,
     270        DW_TAG_compile_unit = 0x11,
     271        DW_TAG_string_type = 0x12,
     272        DW_TAG_structure_type = 0x13,
     273        DW_TAG_subroutine = 0x14,
     274        DW_TAG_subroutine_type = 0x15,
     275        DW_TAG_typedef = 0x16,
     276        DW_TAG_union_type = 0x17,
     277        DW_TAG_unspecified_parameters = 0x18,
     278        DW_TAG_variant = 0x19,
     279        DW_TAG_common_block = 0x1a,
     280        DW_TAG_common_inclusion = 0x1b,
     281        DW_TAG_inheritance = 0x1c,
     282        DW_TAG_inlined_subroutine = 0x1d,
     283        DW_TAG_module = 0x1e,
     284        DW_TAG_ptr_to_member_type = 0x1f,
     285        DW_TAG_set_type = 0x20,
     286        DW_TAG_subrange_type = 0x21,
     287        DW_TAG_with_stmt = 0x22,
     288        DW_TAG_access_declaration = 0x23,
     289        DW_TAG_base_type = 0x24,
     290        DW_TAG_catch_block = 0x25,
     291        DW_TAG_const_type = 0x26,
     292        DW_TAG_constant = 0x27,
     293        DW_TAG_enumerator = 0x28,
     294        DW_TAG_file_type = 0x29,
     295        DW_TAG_friend = 0x2a,
     296        DW_TAG_namelist = 0x2b,
     297        DW_TAG_namelist_item = 0x2c,
     298        DW_TAG_packed_type = 0x2d,
     299        DW_TAG_subprogram = 0x2e,
     300        DW_TAG_template_type_parameter = 0x2f,
     301        DW_TAG_template_value_parameter = 0x30,
     302        DW_TAG_thrown_type = 0x31,
     303        DW_TAG_try_block = 0x32,
     304        DW_TAG_variant_part = 0x33,
     305        DW_TAG_variable = 0x34,
     306        DW_TAG_volatile_type = 0x35,
     307        DW_TAG_dwarf_procedure = 0x36,
     308        DW_TAG_restrict_type = 0x37,
     309        DW_TAG_interface_type = 0x38,
     310        DW_TAG_namespace = 0x39,
     311        DW_TAG_imported_module = 0x3a,
     312        DW_TAG_unspecified_type = 0x3b,
     313        DW_TAG_partial_unit = 0x3c,
     314        DW_TAG_imported_unit = 0x3d,
     315        DW_TAG_mutable_type = 0x3e,
     316        DW_TAG_condition = 0x3f,
     317        DW_TAG_shared_type = 0x40,
     318        DW_TAG_type_unit = 0x41,
     319        DW_TAG_rvalue_reference_type = 0x42,
     320        DW_TAG_template_alias = 0x43,
     321        DW_TAG_coarray_type = 0x44,
     322        DW_TAG_generic_subrange = 0x45,
     323        DW_TAG_dynamic_type = 0x46,
     324        DW_TAG_atomic_type = 0x47,
     325        DW_TAG_call_site = 0x48,
     326        DW_TAG_call_site_parameter = 0x49,
     327        DW_TAG_skeleton_unit = 0x4a,
     328        DW_TAG_immutable_type = 0x4b,
     329
     330        DW_TAG_MAX,
    55331
    56332        DW_TAG_lo_user = 0x4080,
     
    59335
    60336enum {
    61 #include "constants/dw_at.inc"
    62 
    63         DW_AT_lo_user = 0x2000,
    64         DW_AT_hi_user = 0x3fff,
    65 };
    66 
    67 enum {
    68 #include "constants/dw_form.inc"
    69 };
    70 
    71 enum {
    72 #include "constants/dw_op.inc"
     337        DW_FORM_addr = 0x01,
     338        DW_FORM_reserved_0x02 = 0x02,
     339        DW_FORM_block2 = 0x03,
     340        DW_FORM_block4 = 0x04,
     341        DW_FORM_data2 = 0x05,
     342        DW_FORM_data4 = 0x06,
     343        DW_FORM_data8 = 0x07,
     344        DW_FORM_string = 0x08,
     345        DW_FORM_block = 0x09,
     346        DW_FORM_block1 = 0x0a,
     347        DW_FORM_data1 = 0x0b,
     348        DW_FORM_flag = 0x0c,
     349        DW_FORM_sdata = 0x0d,
     350        DW_FORM_strp = 0x0e,
     351        DW_FORM_udata = 0x0f,
     352        DW_FORM_ref_addr = 0x10,
     353        DW_FORM_ref1 = 0x11,
     354        DW_FORM_ref2 = 0x12,
     355        DW_FORM_ref4 = 0x13,
     356        DW_FORM_ref8 = 0x14,
     357        DW_FORM_ref_udata = 0x15,
     358        DW_FORM_indirect = 0x16,
     359        DW_FORM_sec_offset = 0x17,
     360        DW_FORM_exprloc = 0x18,
     361        DW_FORM_flag_present = 0x19,
     362        DW_FORM_strx = 0x1a,
     363        DW_FORM_addrx = 0x1b,
     364        DW_FORM_ref_sup4 = 0x1c,
     365        DW_FORM_strp_sup = 0x1d,
     366        DW_FORM_data16 = 0x1e,
     367        DW_FORM_line_strp = 0x1f,
     368        DW_FORM_ref_sig8 = 0x20,
     369        DW_FORM_implicit_const = 0x21,
     370        DW_FORM_loclistx = 0x22,
     371        DW_FORM_rnglistx = 0x23,
     372        DW_FORM_ref_sup8 = 0x24,
     373        DW_FORM_strx1 = 0x25,
     374        DW_FORM_strx2 = 0x26,
     375        DW_FORM_strx3 = 0x27,
     376        DW_FORM_strx4 = 0x28,
     377        DW_FORM_addrx1 = 0x29,
     378        DW_FORM_addrx2 = 0x2a,
     379        DW_FORM_addrx3 = 0x2b,
     380        DW_FORM_addrx4 = 0x2c,
     381
     382        DW_FORM_MAX,
     383};
     384
     385enum {
     386        DW_OP_reg = 0x01,
     387        DW_OP_basereg = 0x02,
     388        DW_OP_addr = 0x03,
     389        DW_OP_const = 0x04,
     390        DW_OP_deref2 = 0x05,
     391        DW_OP_deref = 0x06,
     392        DW_OP_add = 0x07,
     393        DW_OP_const1u = 0x08,
     394        DW_OP_const1s = 0x09,
     395        DW_OP_const2u = 0x0a,
     396        DW_OP_const2s = 0x0b,
     397        DW_OP_const4u = 0x0c,
     398        DW_OP_const4s = 0x0d,
     399        DW_OP_const8u = 0x0e,
     400        DW_OP_const8s = 0x0f,
     401        DW_OP_constu = 0x10,
     402        DW_OP_consts = 0x11,
     403        DW_OP_dup = 0x12,
     404        DW_OP_drop = 0x13,
     405        DW_OP_over = 0x14,
     406        DW_OP_pick = 0x15,
     407        DW_OP_swap = 0x16,
     408        DW_OP_rot = 0x17,
     409        DW_OP_xderef = 0x18,
     410        DW_OP_abs = 0x19,
     411        DW_OP_and = 0x1a,
     412        DW_OP_div = 0x1b,
     413        DW_OP_minus = 0x1c,
     414        DW_OP_mod = 0x1d,
     415        DW_OP_mul = 0x1e,
     416        DW_OP_neg = 0x1f,
     417        DW_OP_not = 0x20,
     418        DW_OP_or = 0x21,
     419        DW_OP_plus = 0x22,
     420        DW_OP_plus_uconst = 0x23,
     421        DW_OP_shl = 0x24,
     422        DW_OP_shr = 0x25,
     423        DW_OP_shra = 0x26,
     424        DW_OP_xor = 0x27,
     425        DW_OP_bra = 0x28,
     426        DW_OP_eq = 0x29,
     427        DW_OP_ge = 0x2a,
     428        DW_OP_gt = 0x2b,
     429        DW_OP_le = 0x2c,
     430        DW_OP_lt = 0x2d,
     431        DW_OP_ne = 0x2e,
     432        DW_OP_skip = 0x2f,
     433        DW_OP_lit0 = 0x30,
     434        DW_OP_lit1 = 0x31,
     435        DW_OP_lit2 = 0x32,
     436        DW_OP_lit3 = 0x33,
     437        DW_OP_lit4 = 0x34,
     438        DW_OP_lit5 = 0x35,
     439        DW_OP_lit6 = 0x36,
     440        DW_OP_lit7 = 0x37,
     441        DW_OP_lit8 = 0x38,
     442        DW_OP_lit9 = 0x39,
     443        DW_OP_lit10 = 0x3a,
     444        DW_OP_lit11 = 0x3b,
     445        DW_OP_lit12 = 0x3c,
     446        DW_OP_lit13 = 0x3d,
     447        DW_OP_lit14 = 0x3e,
     448        DW_OP_lit15 = 0x3f,
     449        DW_OP_lit16 = 0x40,
     450        DW_OP_lit17 = 0x41,
     451        DW_OP_lit18 = 0x42,
     452        DW_OP_lit19 = 0x43,
     453        DW_OP_lit20 = 0x44,
     454        DW_OP_lit21 = 0x45,
     455        DW_OP_lit22 = 0x46,
     456        DW_OP_lit23 = 0x47,
     457        DW_OP_lit24 = 0x48,
     458        DW_OP_lit25 = 0x49,
     459        DW_OP_lit26 = 0x4a,
     460        DW_OP_lit27 = 0x4b,
     461        DW_OP_lit28 = 0x4c,
     462        DW_OP_lit29 = 0x4d,
     463        DW_OP_lit30 = 0x4e,
     464        DW_OP_lit31 = 0x4f,
     465        DW_OP_reg0 = 0x50,
     466        DW_OP_reg1 = 0x51,
     467        DW_OP_reg2 = 0x52,
     468        DW_OP_reg3 = 0x53,
     469        DW_OP_reg4 = 0x54,
     470        DW_OP_reg5 = 0x55,
     471        DW_OP_reg6 = 0x56,
     472        DW_OP_reg7 = 0x57,
     473        DW_OP_reg8 = 0x58,
     474        DW_OP_reg9 = 0x59,
     475        DW_OP_reg10 = 0x5a,
     476        DW_OP_reg11 = 0x5b,
     477        DW_OP_reg12 = 0x5c,
     478        DW_OP_reg13 = 0x5d,
     479        DW_OP_reg14 = 0x5e,
     480        DW_OP_reg15 = 0x5f,
     481        DW_OP_reg16 = 0x60,
     482        DW_OP_reg17 = 0x61,
     483        DW_OP_reg18 = 0x62,
     484        DW_OP_reg19 = 0x63,
     485        DW_OP_reg20 = 0x64,
     486        DW_OP_reg21 = 0x65,
     487        DW_OP_reg22 = 0x66,
     488        DW_OP_reg23 = 0x67,
     489        DW_OP_reg24 = 0x68,
     490        DW_OP_reg25 = 0x69,
     491        DW_OP_reg26 = 0x6a,
     492        DW_OP_reg27 = 0x6b,
     493        DW_OP_reg28 = 0x6c,
     494        DW_OP_reg29 = 0x6d,
     495        DW_OP_reg30 = 0x6e,
     496        DW_OP_reg31 = 0x6f,
     497        DW_OP_breg0 = 0x70,
     498        DW_OP_breg1 = 0x71,
     499        DW_OP_breg2 = 0x72,
     500        DW_OP_breg3 = 0x73,
     501        DW_OP_breg4 = 0x74,
     502        DW_OP_breg5 = 0x75,
     503        DW_OP_breg6 = 0x76,
     504        DW_OP_breg7 = 0x77,
     505        DW_OP_breg8 = 0x78,
     506        DW_OP_breg9 = 0x79,
     507        DW_OP_breg10 = 0x7a,
     508        DW_OP_breg11 = 0x7b,
     509        DW_OP_breg12 = 0x7c,
     510        DW_OP_breg13 = 0x7d,
     511        DW_OP_breg14 = 0x7e,
     512        DW_OP_breg15 = 0x7f,
     513        DW_OP_breg16 = 0x80,
     514        DW_OP_breg17 = 0x81,
     515        DW_OP_breg18 = 0x82,
     516        DW_OP_breg19 = 0x83,
     517        DW_OP_breg20 = 0x84,
     518        DW_OP_breg21 = 0x85,
     519        DW_OP_breg22 = 0x86,
     520        DW_OP_breg23 = 0x87,
     521        DW_OP_breg24 = 0x88,
     522        DW_OP_breg25 = 0x89,
     523        DW_OP_breg26 = 0x8a,
     524        DW_OP_breg27 = 0x8b,
     525        DW_OP_breg28 = 0x8c,
     526        DW_OP_breg29 = 0x8d,
     527        DW_OP_breg30 = 0x8e,
     528        DW_OP_breg31 = 0x8f,
     529        DW_OP_regx = 0x90,
     530        DW_OP_fbreg = 0x91,
     531        DW_OP_bregx = 0x92,
     532        DW_OP_piece = 0x93,
     533        DW_OP_deref_size = 0x94,
     534        DW_OP_xderef_size = 0x95,
     535        DW_OP_nop = 0x96,
     536        DW_OP_push_object_address = 0x97,
     537        DW_OP_call2 = 0x98,
     538        DW_OP_call4 = 0x99,
     539        DW_OP_call_ref = 0x9a,
     540        DW_OP_form_tls_address = 0x9b,
     541        DW_OP_call_frame_cfa = 0x9c,
     542        DW_OP_bit_piece = 0x9d,
     543        DW_OP_implicit_value = 0x9e,
     544        DW_OP_stack_value = 0x9f,
     545        DW_OP_implicit_pointer = 0xa0,
     546        DW_OP_addrx = 0xa1,
     547        DW_OP_constx = 0xa2,
     548        DW_OP_entry_value = 0xa3,
     549        DW_OP_const_type = 0xa4,
     550        DW_OP_regval_type = 0xa5,
     551        DW_OP_deref_type = 0xa6,
     552        DW_OP_xderef_type = 0xa7,
     553        DW_OP_convert = 0xa8,
     554        DW_OP_reinterpret = 0xa9,
     555
     556        DW_OP_MAX,
    73557
    74558        DW_OP_lo_user = 0xe0,
     
    77561
    78562enum {
    79 #include "constants/dw_lle.inc"
    80 };
    81 
    82 enum {
    83 #include "constants/dw_ate.inc"
    84 
    85         DW_ATE_lo_user = 0x80,
    86         DW_ATE_hi_user = 0xff,
    87 };
    88 
    89 enum {
    90 #include "constants/dw_ds.inc"
    91 };
    92 
    93 enum {
    94 #include "constants/dw_end.inc"
     563        DW_LLE_end_of_list = 0x00,
     564        DW_LLE_base_addressx = 0x01,
     565        DW_LLE_startx_endx = 0x02,
     566        DW_LLE_startx_length = 0x03,
     567        DW_LLE_offset_pair = 0x04,
     568        DW_LLE_default_location = 0x05,
     569        DW_LLE_base_address = 0x06,
     570        DW_LLE_start_end = 0x07,
     571        DW_LLE_start_length = 0x08,
     572
     573        DW_LLE_MAX,
     574};
     575
     576enum {
     577        DW_DS_unsigned = 0x01,
     578        DW_DS_leading_overpunch = 0x02,
     579        DW_DS_trailing_overpunch = 0x03,
     580        DW_DS_leading_separate = 0x04,
     581        DW_DS_trailing_separate = 0x05,
     582
     583        DW_DS_MAX,
     584};
     585
     586enum {
     587        DW_END_default = 0x00,
     588        DW_END_big = 0x01,
     589        DW_END_little = 0x02,
     590
     591        DW_END_MAX,
    95592
    96593        DW_END_lo_user = 0x40,
     
    99596
    100597enum {
    101 #include "constants/dw_access.inc"
    102 };
    103 
    104 enum {
    105 #include "constants/dw_vis.inc"
    106 };
    107 
    108 enum {
    109 #include "constants/dw_virtuality.inc"
    110 };
    111 
    112 enum {
    113 #include "constants/dw_lang.inc"
     598        DW_VIS_local = 0x01,
     599        DW_VIS_exported = 0x02,
     600        DW_VIS_qualified = 0x03,
     601
     602        DW_VIS_MAX,
     603};
     604
     605enum {
     606        DW_VIRTUALITY_none = 0x00,
     607        DW_VIRTUALITY_virtual = 0x01,
     608        DW_VIRTUALITY_pure_virtual = 0x02,
     609
     610        DW_VIRTUALITY_MAX,
     611};
     612
     613enum {
     614        DW_LANG_C89 = 0x01,
     615        DW_LANG_C = 0x02,
     616        DW_LANG_Ada83 = 0x03,
     617        DW_LANG_C_plus_plus = 0x04,
     618        DW_LANG_Cobol74 = 0x05,
     619        DW_LANG_Cobol85 = 0x06,
     620        DW_LANG_Fortran77 = 0x07,
     621        DW_LANG_Fortran90 = 0x08,
     622        DW_LANG_Pascal83 = 0x09,
     623        DW_LANG_Modula2 = 0x0a,
     624        DW_LANG_Java = 0x0b,
     625        DW_LANG_C99 = 0x0c,
     626        DW_LANG_Ada95 = 0x0d,
     627        DW_LANG_Fortran95 = 0x0e,
     628        DW_LANG_PLI = 0x0f,
     629        DW_LANG_ObjC = 0x10,
     630        DW_LANG_ObjC_plus_plus = 0x11,
     631        DW_LANG_UPC = 0x12,
     632        DW_LANG_D = 0x13,
     633        DW_LANG_Python = 0x14,
     634        DW_LANG_OpenCL = 0x15,
     635        DW_LANG_Go = 0x16,
     636        DW_LANG_Modula3 = 0x17,
     637        DW_LANG_Haskell = 0x18,
     638        DW_LANG_C_plus_plus_03 = 0x19,
     639        DW_LANG_C_plus_plus_11 = 0x1a,
     640        DW_LANG_OCaml = 0x1b,
     641        DW_LANG_Rust = 0x1c,
     642        DW_LANG_C11 = 0x1d,
     643        DW_LANG_Swift = 0x1e,
     644        DW_LANG_Julia = 0x1f,
     645        DW_LANG_Dylan = 0x20,
     646        DW_LANG_C_plus_plus_14 = 0x21,
     647        DW_LANG_Fortran03 = 0x22,
     648        DW_LANG_Fortran08 = 0x23,
     649        DW_LANG_RenderScript = 0x24,
     650        DW_LANG_BLISS = 0x25,
     651
     652        DW_LANG_MAX,
    114653
    115654        DW_LANG_lo_user = 0x8000,
     
    122661
    123662enum {
    124 #include "constants/dw_id.inc"
    125 };
    126 
    127 enum {
    128 #include "constants/dw_cc.inc"
    129 
    130         DW_CC_lo_user = 0x40,
    131         DW_CC_hi_user = 0xff,
    132 };
    133 
    134 enum {
    135 #include "constants/dw_lns.inc"
    136 };
    137 
    138 enum {
    139 #include "constants/dw_lne.inc"
     663        DW_ID_case_sensitive = 0x00,
     664        DW_ID_up_case = 0x01,
     665        DW_ID_down_case = 0x02,
     666        DW_ID_case_insensitive = 0x03,
     667
     668        DW_ID_MAX,
     669};
     670
     671enum {
     672        DW_LNS_copy = 0x01,
     673        DW_LNS_advance_pc = 0x02,
     674        DW_LNS_advance_line = 0x03,
     675        DW_LNS_set_file = 0x04,
     676        DW_LNS_set_column = 0x05,
     677        DW_LNS_negate_stmt = 0x06,
     678        DW_LNS_set_basic_block = 0x07,
     679        DW_LNS_const_add_pc = 0x08,
     680        DW_LNS_fixed_advance_pc = 0x09,
     681        DW_LNS_set_prologue_end = 0x0a,
     682        DW_LNS_set_epilogue_begin = 0x0b,
     683        DW_LNS_set_isa = 0x0c,
     684
     685        DW_LNS_MAX,
     686};
     687
     688enum {
     689        DW_LNE_end_sequence = 0x01,
     690        DW_LNE_set_address = 0x02,
     691        DW_LNE_define_file = 0x03,
     692        DW_LNE_set_discriminator = 0x04,
     693
     694        DW_LNE_MAX,
    140695
    141696        DW_LNE_lo_user = 0x80,
     
    144699
    145700enum {
    146 #include "constants/dw_lnct.inc"
     701        DW_LNCT_path = 0x1,
     702        DW_LNCT_directory_index = 0x2,
     703        DW_LNCT_timestamp = 0x3,
     704        DW_LNCT_size = 0x4,
     705        DW_LNCT_MD5 = 0x5,
     706
     707        DW_LNCT_MAX,
    147708
    148709        DW_LNCT_lo_user = 0x2000,
     
    150711};
    151712
    152 #undef CVAL
    153 
    154 typedef unsigned dw_ut_t;
    155 typedef unsigned dw_tag_t;
    156 typedef unsigned dw_at_t;
    157 typedef unsigned dw_form_t;
    158 typedef unsigned dw_op_t;
    159 typedef unsigned dw_lle_t;
    160 typedef unsigned dw_ate_t;
    161 typedef unsigned dw_ds_t;
    162 typedef unsigned dw_end_t;
    163 typedef unsigned dw_access_t;
    164 typedef unsigned dw_vis_t;
    165 typedef unsigned dw_virtuality_t;
    166 typedef unsigned dw_lang_t;
    167 typedef unsigned dw_id_t;
    168 typedef unsigned dw_cc_t;
    169 typedef unsigned dw_lns_t;
    170 typedef unsigned dw_lne_t;
    171 typedef unsigned dw_lnct_t;
     713enum {
     714        DW_INL_not_inlined = 0x00,
     715        DW_INL_inlined = 0x01,
     716        DW_INL_declared_not_inlined = 0x02,
     717        DW_INL_declared_inlined = 0x03,
     718
     719        DW_INL_MAX,
     720};
     721
     722enum {
     723        DW_ORD_row_major = 0x00,
     724        DW_ORD_col_major = 0x01,
     725
     726        DW_ORD_MAX,
     727};
     728
     729enum {
     730        DW_DSC_label = 0x00,
     731        DW_DSC_range = 0x01,
     732
     733        DW_DSC_MAX,
     734};
     735
     736enum {
     737        DW_IDX_compile_unit = 1,
     738        DW_IDX_type_unit = 2,
     739        DW_IDX_die_offset = 3,
     740        DW_IDX_parent = 4,
     741        DW_IDX_type_hash = 5,
     742
     743        DW_IDX_MAX,
     744
     745        DW_IDX_lo_user = 0x2000,
     746        DW_IDX_hi_user = 0x3fff,
     747};
     748
     749enum {
     750        DW_DEFAULTED_no = 0x00,
     751        DW_DEFAULTED_in_class = 0x01,
     752        DW_DEFAULTED_out_of_class = 0x02,
     753
     754        DW_DEFAULTED_MAX,
     755};
     756
     757enum {
     758        DW_MACRO_define = 0x01,
     759        DW_MACRO_undef = 0x02,
     760        DW_MACRO_start_file = 0x03,
     761        DW_MACRO_end_file = 0x04,
     762        DW_MACRO_define_strp = 0x05,
     763        DW_MACRO_undef_strp = 0x06,
     764        DW_MACRO_import = 0x07,
     765        DW_MACRO_define_sup = 0x08,
     766        DW_MACRO_undef_sup = 0x09,
     767        DW_MACRO_import_sup = 0x0a,
     768        DW_MACRO_define_strx = 0x0b,
     769        DW_MACRO_undef_strx = 0x0c,
     770
     771        DW_MACRO_MAX,
     772
     773        DW_MACRO_lo_user = 0xe0,
     774        DW_MACRO_hi_user = 0xff,
     775};
     776
     777enum {
     778        DW_CFA_nop = 0,
     779        DW_CFA_set_loc = 0x01,
     780        DW_CFA_advance_loc1 = 0x02,
     781        DW_CFA_advance_loc2 = 0x03,
     782        DW_CFA_advance_loc4 = 0x04,
     783        DW_CFA_offset_extended = 0x05,
     784        DW_CFA_restore_extended = 0x06,
     785        DW_CFA_undefined = 0x07,
     786        DW_CFA_same_value = 0x08,
     787        DW_CFA_register = 0x09,
     788        DW_CFA_remember_state = 0x0a,
     789        DW_CFA_restore_state = 0x0b,
     790        DW_CFA_def_cfa = 0x0c,
     791        DW_CFA_def_cfa_register = 0x0d,
     792        DW_CFA_def_cfa_offset = 0x0e,
     793        DW_CFA_def_cfa_expression = 0x0f,
     794        DW_CFA_expression = 0x10,
     795        DW_CFA_offset_extended_sf = 0x11,
     796        DW_CFA_def_cfa_sf = 0x12,
     797        DW_CFA_def_cfa_offset_sf = 0x13,
     798        DW_CFA_val_offset = 0x14,
     799        DW_CFA_val_offset_sf = 0x15,
     800        DW_CFA_val_expression = 0x16,
     801
     802        DW_CFA_MAX,
     803
     804        DW_CFA_lo_user = 0x1c,
     805        DW_CFA_hi_user = 0x3f,
     806
     807        /* These hold extra data in the 6 low-order bits. */
     808        DW_CFA_advance_loc = 0x40,
     809        DW_CFA_offset = 0x80,
     810        DW_CFA_restore = 0xc0,
     811};
     812
     813enum {
     814        DW_RLE_end_of_list = 0x00,
     815        DW_RLE_base_addressx = 0x01,
     816        DW_RLE_startx_endx = 0x02,
     817        DW_RLE_startx_length = 0x03,
     818        DW_RLE_offset_pair = 0x04,
     819        DW_RLE_base_address = 0x05,
     820        DW_RLE_start_end = 0x06,
     821        DW_RLE_start_length = 0x07,
     822
     823        DW_RLE_MAX,
     824};
    172825
    173826#endif /* DWARFS_CONSTANTS_H_ */
  • kernel/generic/include/debug/names.h

    r63ed840 r1170cfc7  
    2727 */
    2828
    29 #ifndef DWARFS_NAMES_H_
    30 #define DWARFS_NAMES_H_
     29#ifndef DEBUG_DWARF_NAMES_H_
     30#define DEBUG_DWARF_NAMES_H_
    3131
    32 #define D_(infix) \
    33         typedef unsigned dw_##infix##_t; \
    34         extern const char *dw_##infix##_name(dw_##infix##_t)
     32#include <debug/types.h>
    3533
    36 D_(ut);
    37 D_(tag);
    38 D_(at);
    39 D_(form);
    40 D_(op);
    41 D_(lle);
    42 D_(ate);
    43 D_(ds);
    44 D_(end);
    45 D_(access);
    46 D_(vis);
    47 D_(virtuality);
    48 D_(lang);
    49 D_(id);
    50 D_(cc);
    51 D_(lns);
    52 D_(lne);
    53 D_(lnct);
     34extern const char *dw_access_name(dw_access_t);
     35extern const char *dw_at_name(dw_at_t);
     36extern const char *dw_ate_name(dw_ate_t);
     37extern const char *dw_cc_name(dw_cc_t);
     38extern const char *dw_cfa_name(dw_cfa_t);
     39extern const char *dw_defaulted_name(dw_defaulted_t);
     40extern const char *dw_ds_name(dw_ds_t);
     41extern const char *dw_dsc_name(dw_dsc_t);
     42extern const char *dw_end_name(dw_end_t);
     43extern const char *dw_form_name(dw_form_t);
     44extern const char *dw_id_name(dw_id_t);
     45extern const char *dw_idx_name(dw_idx_t);
     46extern const char *dw_inl_name(dw_inl_t);
     47extern const char *dw_lang_name(dw_lang_t);
     48extern const char *dw_lle_name(dw_lle_t);
     49extern const char *dw_lnct_name(dw_lnct_t);
     50extern const char *dw_lne_name(dw_lne_t);
     51extern const char *dw_lns_name(dw_lns_t);
     52extern const char *dw_macro_name(dw_macro_t);
     53extern const char *dw_op_name(dw_op_t);
     54extern const char *dw_ord_name(dw_ord_t);
     55extern const char *dw_rle_name(dw_rle_t);
     56extern const char *dw_tag_name(dw_tag_t);
     57extern const char *dw_ut_name(dw_ut_t);
     58extern const char *dw_virtuality_name(dw_virtuality_t);
     59extern const char *dw_vis_name(dw_vis_t);
    5460
    55 #undef D_
    56 
    57 #endif /* DWARFS_NAMES_H_ */
     61#endif /* DEBUG_DWARF_NAMES_H_ */
  • kernel/generic/src/debug/names.c

    r63ed840 r1170cfc7  
    2727 */
    2828
     29#include <debug/names.h>
     30#include <debug/constants.h>
    2931#include <stddef.h>
    30 #include <stdint.h>
    31 #include <debug/constants.h>
    32 #include <debug/names.h>
    33 
    34 #define CVAL(name, value) [value] = #name,
     32
     33#define ENTRY(name) [name] = #name
     34
     35static const char *const dw_access_names[] = {
     36        ENTRY(DW_ACCESS_public),
     37        ENTRY(DW_ACCESS_protected),
     38        ENTRY(DW_ACCESS_private),
     39};
     40
     41_Static_assert(DW_ACCESS_MAX == DW_ACCESS_private + 1);
     42
     43static const char *const dw_at_names[] = {
     44        ENTRY(DW_AT_sibling),
     45        ENTRY(DW_AT_location),
     46        ENTRY(DW_AT_name),
     47        ENTRY(DW_AT_reserved_0x04),
     48        ENTRY(DW_AT_fund_type),
     49        ENTRY(DW_AT_mod_fund_type),
     50        ENTRY(DW_AT_user_def_type),
     51        ENTRY(DW_AT_mod_u_d_type),
     52        ENTRY(DW_AT_ordering),
     53        ENTRY(DW_AT_subscr_data),
     54        ENTRY(DW_AT_byte_size),
     55        ENTRY(DW_AT_bit_offset),
     56        ENTRY(DW_AT_bit_size),
     57        ENTRY(DW_AT_reserved_0x0e),
     58        ENTRY(DW_AT_unused8),
     59        ENTRY(DW_AT_stmt_list),
     60        ENTRY(DW_AT_low_pc),
     61        ENTRY(DW_AT_high_pc),
     62        ENTRY(DW_AT_language),
     63        ENTRY(DW_AT_member),
     64        ENTRY(DW_AT_discr),
     65        ENTRY(DW_AT_discr_value),
     66        ENTRY(DW_AT_visibility),
     67        ENTRY(DW_AT_import),
     68        ENTRY(DW_AT_string_length),
     69        ENTRY(DW_AT_common_reference),
     70        ENTRY(DW_AT_comp_dir),
     71        ENTRY(DW_AT_const_value),
     72        ENTRY(DW_AT_containing_type),
     73        ENTRY(DW_AT_default_value),
     74        ENTRY(DW_AT_reserved_0x1f),
     75        ENTRY(DW_AT_inline),
     76        ENTRY(DW_AT_is_optional),
     77        ENTRY(DW_AT_lower_bound),
     78        ENTRY(DW_AT_reserved_0x23),
     79        ENTRY(DW_AT_reserved_0x24),
     80        ENTRY(DW_AT_producer),
     81        ENTRY(DW_AT_reserved_0x26),
     82        ENTRY(DW_AT_prototyped),
     83        ENTRY(DW_AT_reserved_0x28),
     84        ENTRY(DW_AT_reserved_0x29),
     85        ENTRY(DW_AT_return_addr),
     86        ENTRY(DW_AT_reserved_0x2b),
     87        ENTRY(DW_AT_start_scope),
     88        ENTRY(DW_AT_reserved_0x2d),
     89        ENTRY(DW_AT_bit_stride),
     90        ENTRY(DW_AT_upper_bound),
     91        ENTRY(DW_AT_virtual),
     92        ENTRY(DW_AT_abstract_origin),
     93        ENTRY(DW_AT_accessibility),
     94        ENTRY(DW_AT_address_class),
     95        ENTRY(DW_AT_artificial),
     96        ENTRY(DW_AT_base_types),
     97        ENTRY(DW_AT_calling_convention),
     98        ENTRY(DW_AT_count),
     99        ENTRY(DW_AT_data_member_location),
     100        ENTRY(DW_AT_decl_column),
     101        ENTRY(DW_AT_decl_file),
     102        ENTRY(DW_AT_decl_line),
     103        ENTRY(DW_AT_declaration),
     104        ENTRY(DW_AT_discr_list),
     105        ENTRY(DW_AT_encoding),
     106        ENTRY(DW_AT_external),
     107        ENTRY(DW_AT_frame_base),
     108        ENTRY(DW_AT_friend),
     109        ENTRY(DW_AT_identifier_case),
     110        ENTRY(DW_AT_macro_info),
     111        ENTRY(DW_AT_namelist_item),
     112        ENTRY(DW_AT_priority),
     113        ENTRY(DW_AT_segment),
     114        ENTRY(DW_AT_specification),
     115        ENTRY(DW_AT_static_link),
     116        ENTRY(DW_AT_type),
     117        ENTRY(DW_AT_use_location),
     118        ENTRY(DW_AT_variable_parameter),
     119        ENTRY(DW_AT_virtuality),
     120        ENTRY(DW_AT_vtable_elem_location),
     121        ENTRY(DW_AT_allocated),
     122        ENTRY(DW_AT_associated),
     123        ENTRY(DW_AT_data_location),
     124        ENTRY(DW_AT_byte_stride),
     125        ENTRY(DW_AT_entry_pc),
     126        ENTRY(DW_AT_use_UTF8),
     127        ENTRY(DW_AT_extension),
     128        ENTRY(DW_AT_ranges),
     129        ENTRY(DW_AT_trampoline),
     130        ENTRY(DW_AT_call_column),
     131        ENTRY(DW_AT_call_file),
     132        ENTRY(DW_AT_call_line),
     133        ENTRY(DW_AT_description),
     134        ENTRY(DW_AT_binary_scale),
     135        ENTRY(DW_AT_decimal_scale),
     136        ENTRY(DW_AT_small),
     137        ENTRY(DW_AT_decimal_sign),
     138        ENTRY(DW_AT_digit_count),
     139        ENTRY(DW_AT_picture_string),
     140        ENTRY(DW_AT_mutable),
     141        ENTRY(DW_AT_threads_scaled),
     142        ENTRY(DW_AT_explicit),
     143        ENTRY(DW_AT_object_pointer),
     144        ENTRY(DW_AT_endianity),
     145        ENTRY(DW_AT_elemental),
     146        ENTRY(DW_AT_pure),
     147        ENTRY(DW_AT_recursive),
     148        ENTRY(DW_AT_signature),
     149        ENTRY(DW_AT_main_subprogram),
     150        ENTRY(DW_AT_data_bit_offset),
     151        ENTRY(DW_AT_const_expr),
     152        ENTRY(DW_AT_enum_class),
     153        ENTRY(DW_AT_linkage_name),
     154        ENTRY(DW_AT_string_length_bit_size),
     155        ENTRY(DW_AT_string_length_byte_size),
     156        ENTRY(DW_AT_rank),
     157        ENTRY(DW_AT_str_offsets_base),
     158        ENTRY(DW_AT_addr_base),
     159        ENTRY(DW_AT_rnglists_base),
     160        ENTRY(DW_AT_dwo_id),
     161        ENTRY(DW_AT_dwo_name),
     162        ENTRY(DW_AT_reference),
     163        ENTRY(DW_AT_rvalue_reference),
     164        ENTRY(DW_AT_macros),
     165        ENTRY(DW_AT_call_all_calls),
     166        ENTRY(DW_AT_call_all_source_calls),
     167        ENTRY(DW_AT_call_all_tail_calls),
     168        ENTRY(DW_AT_call_return_pc),
     169        ENTRY(DW_AT_call_value),
     170        ENTRY(DW_AT_call_origin),
     171        ENTRY(DW_AT_call_parameter),
     172        ENTRY(DW_AT_call_pc),
     173        ENTRY(DW_AT_call_tail_call),
     174        ENTRY(DW_AT_call_target),
     175        ENTRY(DW_AT_call_target_clobbered),
     176        ENTRY(DW_AT_call_data_location),
     177        ENTRY(DW_AT_call_data_value),
     178        ENTRY(DW_AT_noreturn),
     179        ENTRY(DW_AT_alignment),
     180        ENTRY(DW_AT_export_symbols),
     181        ENTRY(DW_AT_deleted),
     182        ENTRY(DW_AT_defaulted),
     183        ENTRY(DW_AT_loclists_base),
     184};
     185
     186_Static_assert(DW_AT_MAX == DW_AT_loclists_base + 1);
     187
     188static const char *const dw_ate_names[] = {
     189        ENTRY(DW_ATE_address),
     190        ENTRY(DW_ATE_boolean),
     191        ENTRY(DW_ATE_complex_float),
     192        ENTRY(DW_ATE_float),
     193        ENTRY(DW_ATE_signed),
     194        ENTRY(DW_ATE_signed_char),
     195        ENTRY(DW_ATE_unsigned),
     196        ENTRY(DW_ATE_unsigned_char),
     197        ENTRY(DW_ATE_imaginary_float),
     198        ENTRY(DW_ATE_packed_decimal),
     199        ENTRY(DW_ATE_numeric_string),
     200        ENTRY(DW_ATE_edited),
     201        ENTRY(DW_ATE_signed_fixed),
     202        ENTRY(DW_ATE_unsigned_fixed),
     203        ENTRY(DW_ATE_decimal_float),
     204        ENTRY(DW_ATE_UTF),
     205        ENTRY(DW_ATE_UCS),
     206        ENTRY(DW_ATE_ASCII),
     207};
     208
     209_Static_assert(DW_ATE_MAX == DW_ATE_ASCII + 1);
     210
     211static const char *const dw_cc_names[] = {
     212        ENTRY(DW_CC_normal),
     213        ENTRY(DW_CC_program),
     214        ENTRY(DW_CC_nocall),
     215        ENTRY(DW_CC_pass_by_reference),
     216        ENTRY(DW_CC_pass_by_value),
     217};
     218
     219_Static_assert(DW_CC_MAX == DW_CC_pass_by_value + 1);
    35220
    36221static const char *const dw_ut_names[] = {
    37 #include <debug/constants/dw_ut.inc>
    38 };
     222        ENTRY(DW_UT_compile),
     223        ENTRY(DW_UT_type),
     224        ENTRY(DW_UT_partial),
     225        ENTRY(DW_UT_skeleton),
     226        ENTRY(DW_UT_split_compile),
     227        ENTRY(DW_UT_split_type),
     228};
     229
     230_Static_assert(DW_UT_MAX == DW_UT_split_type + 1);
    39231
    40232static const char *const dw_tag_names[] = {
    41 #include <debug/constants/dw_tag.inc>
    42 };
    43 
    44 static const char *const dw_at_names[] = {
    45 #include <debug/constants/dw_at.inc>
    46 };
     233        ENTRY(DW_TAG_array_type),
     234        ENTRY(DW_TAG_class_type),
     235        ENTRY(DW_TAG_entry_point),
     236        ENTRY(DW_TAG_enumeration_type),
     237        ENTRY(DW_TAG_formal_parameter),
     238        ENTRY(DW_TAG_global_subroutine),
     239        ENTRY(DW_TAG_global_variable),
     240        ENTRY(DW_TAG_imported_declaration),
     241        ENTRY(DW_TAG_reserved_0x09),
     242        ENTRY(DW_TAG_label),
     243        ENTRY(DW_TAG_lexical_block),
     244        ENTRY(DW_TAG_local_variable),
     245        ENTRY(DW_TAG_member),
     246        ENTRY(DW_TAG_reserved_0x0e),
     247        ENTRY(DW_TAG_pointer_type),
     248        ENTRY(DW_TAG_reference_type),
     249        ENTRY(DW_TAG_compile_unit),
     250        ENTRY(DW_TAG_string_type),
     251        ENTRY(DW_TAG_structure_type),
     252        ENTRY(DW_TAG_subroutine),
     253        ENTRY(DW_TAG_subroutine_type),
     254        ENTRY(DW_TAG_typedef),
     255        ENTRY(DW_TAG_union_type),
     256        ENTRY(DW_TAG_unspecified_parameters),
     257        ENTRY(DW_TAG_variant),
     258        ENTRY(DW_TAG_common_block),
     259        ENTRY(DW_TAG_common_inclusion),
     260        ENTRY(DW_TAG_inheritance),
     261        ENTRY(DW_TAG_inlined_subroutine),
     262        ENTRY(DW_TAG_module),
     263        ENTRY(DW_TAG_ptr_to_member_type),
     264        ENTRY(DW_TAG_set_type),
     265        ENTRY(DW_TAG_subrange_type),
     266        ENTRY(DW_TAG_with_stmt),
     267        ENTRY(DW_TAG_access_declaration),
     268        ENTRY(DW_TAG_base_type),
     269        ENTRY(DW_TAG_catch_block),
     270        ENTRY(DW_TAG_const_type),
     271        ENTRY(DW_TAG_constant),
     272        ENTRY(DW_TAG_enumerator),
     273        ENTRY(DW_TAG_file_type),
     274        ENTRY(DW_TAG_friend),
     275        ENTRY(DW_TAG_namelist),
     276        ENTRY(DW_TAG_namelist_item),
     277        ENTRY(DW_TAG_packed_type),
     278        ENTRY(DW_TAG_subprogram),
     279        ENTRY(DW_TAG_template_type_parameter),
     280        ENTRY(DW_TAG_template_value_parameter),
     281        ENTRY(DW_TAG_thrown_type),
     282        ENTRY(DW_TAG_try_block),
     283        ENTRY(DW_TAG_variant_part),
     284        ENTRY(DW_TAG_variable),
     285        ENTRY(DW_TAG_volatile_type),
     286        ENTRY(DW_TAG_dwarf_procedure),
     287        ENTRY(DW_TAG_restrict_type),
     288        ENTRY(DW_TAG_interface_type),
     289        ENTRY(DW_TAG_namespace),
     290        ENTRY(DW_TAG_imported_module),
     291        ENTRY(DW_TAG_unspecified_type),
     292        ENTRY(DW_TAG_partial_unit),
     293        ENTRY(DW_TAG_imported_unit),
     294        ENTRY(DW_TAG_mutable_type),
     295        ENTRY(DW_TAG_condition),
     296        ENTRY(DW_TAG_shared_type),
     297        ENTRY(DW_TAG_type_unit),
     298        ENTRY(DW_TAG_rvalue_reference_type),
     299        ENTRY(DW_TAG_template_alias),
     300        ENTRY(DW_TAG_coarray_type),
     301        ENTRY(DW_TAG_generic_subrange),
     302        ENTRY(DW_TAG_dynamic_type),
     303        ENTRY(DW_TAG_atomic_type),
     304        ENTRY(DW_TAG_call_site),
     305        ENTRY(DW_TAG_call_site_parameter),
     306        ENTRY(DW_TAG_skeleton_unit),
     307        ENTRY(DW_TAG_immutable_type),
     308};
     309
     310_Static_assert(DW_TAG_MAX == DW_TAG_immutable_type + 1);
    47311
    48312static const char *const dw_form_names[] = {
    49 #include <debug/constants/dw_form.inc>
    50 };
     313        ENTRY(DW_FORM_addr),
     314        ENTRY(DW_FORM_reserved_0x02),
     315        ENTRY(DW_FORM_block2),
     316        ENTRY(DW_FORM_block4),
     317        ENTRY(DW_FORM_data2),
     318        ENTRY(DW_FORM_data4),
     319        ENTRY(DW_FORM_data8),
     320        ENTRY(DW_FORM_string),
     321        ENTRY(DW_FORM_block),
     322        ENTRY(DW_FORM_block1),
     323        ENTRY(DW_FORM_data1),
     324        ENTRY(DW_FORM_flag),
     325        ENTRY(DW_FORM_sdata),
     326        ENTRY(DW_FORM_strp),
     327        ENTRY(DW_FORM_udata),
     328        ENTRY(DW_FORM_ref_addr),
     329        ENTRY(DW_FORM_ref1),
     330        ENTRY(DW_FORM_ref2),
     331        ENTRY(DW_FORM_ref4),
     332        ENTRY(DW_FORM_ref8),
     333        ENTRY(DW_FORM_ref_udata),
     334        ENTRY(DW_FORM_indirect),
     335        ENTRY(DW_FORM_sec_offset),
     336        ENTRY(DW_FORM_exprloc),
     337        ENTRY(DW_FORM_flag_present),
     338        ENTRY(DW_FORM_strx),
     339        ENTRY(DW_FORM_addrx),
     340        ENTRY(DW_FORM_ref_sup4),
     341        ENTRY(DW_FORM_strp_sup),
     342        ENTRY(DW_FORM_data16),
     343        ENTRY(DW_FORM_line_strp),
     344        ENTRY(DW_FORM_ref_sig8),
     345        ENTRY(DW_FORM_implicit_const),
     346        ENTRY(DW_FORM_loclistx),
     347        ENTRY(DW_FORM_rnglistx),
     348        ENTRY(DW_FORM_ref_sup8),
     349        ENTRY(DW_FORM_strx1),
     350        ENTRY(DW_FORM_strx2),
     351        ENTRY(DW_FORM_strx3),
     352        ENTRY(DW_FORM_strx4),
     353        ENTRY(DW_FORM_addrx1),
     354        ENTRY(DW_FORM_addrx2),
     355        ENTRY(DW_FORM_addrx3),
     356        ENTRY(DW_FORM_addrx4),
     357};
     358
     359_Static_assert(DW_FORM_MAX == DW_FORM_addrx4 + 1);
    51360
    52361static const char *const dw_op_names[] = {
    53 #include <debug/constants/dw_op.inc>
    54 };
     362        ENTRY(DW_OP_reg),
     363        ENTRY(DW_OP_basereg),
     364        ENTRY(DW_OP_addr),
     365        ENTRY(DW_OP_const),
     366        ENTRY(DW_OP_deref2),
     367        ENTRY(DW_OP_deref),
     368        ENTRY(DW_OP_add),
     369        ENTRY(DW_OP_const1u),
     370        ENTRY(DW_OP_const1s),
     371        ENTRY(DW_OP_const2u),
     372        ENTRY(DW_OP_const2s),
     373        ENTRY(DW_OP_const4u),
     374        ENTRY(DW_OP_const4s),
     375        ENTRY(DW_OP_const8u),
     376        ENTRY(DW_OP_const8s),
     377        ENTRY(DW_OP_constu),
     378        ENTRY(DW_OP_consts),
     379        ENTRY(DW_OP_dup),
     380        ENTRY(DW_OP_drop),
     381        ENTRY(DW_OP_over),
     382        ENTRY(DW_OP_pick),
     383        ENTRY(DW_OP_swap),
     384        ENTRY(DW_OP_rot),
     385        ENTRY(DW_OP_xderef),
     386        ENTRY(DW_OP_abs),
     387        ENTRY(DW_OP_and),
     388        ENTRY(DW_OP_div),
     389        ENTRY(DW_OP_minus),
     390        ENTRY(DW_OP_mod),
     391        ENTRY(DW_OP_mul),
     392        ENTRY(DW_OP_neg),
     393        ENTRY(DW_OP_not),
     394        ENTRY(DW_OP_or),
     395        ENTRY(DW_OP_plus),
     396        ENTRY(DW_OP_plus_uconst),
     397        ENTRY(DW_OP_shl),
     398        ENTRY(DW_OP_shr),
     399        ENTRY(DW_OP_shra),
     400        ENTRY(DW_OP_xor),
     401        ENTRY(DW_OP_bra),
     402        ENTRY(DW_OP_eq),
     403        ENTRY(DW_OP_ge),
     404        ENTRY(DW_OP_gt),
     405        ENTRY(DW_OP_le),
     406        ENTRY(DW_OP_lt),
     407        ENTRY(DW_OP_ne),
     408        ENTRY(DW_OP_skip),
     409        ENTRY(DW_OP_lit0),
     410        ENTRY(DW_OP_lit1),
     411        ENTRY(DW_OP_lit2),
     412        ENTRY(DW_OP_lit3),
     413        ENTRY(DW_OP_lit4),
     414        ENTRY(DW_OP_lit5),
     415        ENTRY(DW_OP_lit6),
     416        ENTRY(DW_OP_lit7),
     417        ENTRY(DW_OP_lit8),
     418        ENTRY(DW_OP_lit9),
     419        ENTRY(DW_OP_lit10),
     420        ENTRY(DW_OP_lit11),
     421        ENTRY(DW_OP_lit12),
     422        ENTRY(DW_OP_lit13),
     423        ENTRY(DW_OP_lit14),
     424        ENTRY(DW_OP_lit15),
     425        ENTRY(DW_OP_lit16),
     426        ENTRY(DW_OP_lit17),
     427        ENTRY(DW_OP_lit18),
     428        ENTRY(DW_OP_lit19),
     429        ENTRY(DW_OP_lit20),
     430        ENTRY(DW_OP_lit21),
     431        ENTRY(DW_OP_lit22),
     432        ENTRY(DW_OP_lit23),
     433        ENTRY(DW_OP_lit24),
     434        ENTRY(DW_OP_lit25),
     435        ENTRY(DW_OP_lit26),
     436        ENTRY(DW_OP_lit27),
     437        ENTRY(DW_OP_lit28),
     438        ENTRY(DW_OP_lit29),
     439        ENTRY(DW_OP_lit30),
     440        ENTRY(DW_OP_lit31),
     441        ENTRY(DW_OP_reg0),
     442        ENTRY(DW_OP_reg1),
     443        ENTRY(DW_OP_reg2),
     444        ENTRY(DW_OP_reg3),
     445        ENTRY(DW_OP_reg4),
     446        ENTRY(DW_OP_reg5),
     447        ENTRY(DW_OP_reg6),
     448        ENTRY(DW_OP_reg7),
     449        ENTRY(DW_OP_reg8),
     450        ENTRY(DW_OP_reg9),
     451        ENTRY(DW_OP_reg10),
     452        ENTRY(DW_OP_reg11),
     453        ENTRY(DW_OP_reg12),
     454        ENTRY(DW_OP_reg13),
     455        ENTRY(DW_OP_reg14),
     456        ENTRY(DW_OP_reg15),
     457        ENTRY(DW_OP_reg16),
     458        ENTRY(DW_OP_reg17),
     459        ENTRY(DW_OP_reg18),
     460        ENTRY(DW_OP_reg19),
     461        ENTRY(DW_OP_reg20),
     462        ENTRY(DW_OP_reg21),
     463        ENTRY(DW_OP_reg22),
     464        ENTRY(DW_OP_reg23),
     465        ENTRY(DW_OP_reg24),
     466        ENTRY(DW_OP_reg25),
     467        ENTRY(DW_OP_reg26),
     468        ENTRY(DW_OP_reg27),
     469        ENTRY(DW_OP_reg28),
     470        ENTRY(DW_OP_reg29),
     471        ENTRY(DW_OP_reg30),
     472        ENTRY(DW_OP_reg31),
     473        ENTRY(DW_OP_breg0),
     474        ENTRY(DW_OP_breg1),
     475        ENTRY(DW_OP_breg2),
     476        ENTRY(DW_OP_breg3),
     477        ENTRY(DW_OP_breg4),
     478        ENTRY(DW_OP_breg5),
     479        ENTRY(DW_OP_breg6),
     480        ENTRY(DW_OP_breg7),
     481        ENTRY(DW_OP_breg8),
     482        ENTRY(DW_OP_breg9),
     483        ENTRY(DW_OP_breg10),
     484        ENTRY(DW_OP_breg11),
     485        ENTRY(DW_OP_breg12),
     486        ENTRY(DW_OP_breg13),
     487        ENTRY(DW_OP_breg14),
     488        ENTRY(DW_OP_breg15),
     489        ENTRY(DW_OP_breg16),
     490        ENTRY(DW_OP_breg17),
     491        ENTRY(DW_OP_breg18),
     492        ENTRY(DW_OP_breg19),
     493        ENTRY(DW_OP_breg20),
     494        ENTRY(DW_OP_breg21),
     495        ENTRY(DW_OP_breg22),
     496        ENTRY(DW_OP_breg23),
     497        ENTRY(DW_OP_breg24),
     498        ENTRY(DW_OP_breg25),
     499        ENTRY(DW_OP_breg26),
     500        ENTRY(DW_OP_breg27),
     501        ENTRY(DW_OP_breg28),
     502        ENTRY(DW_OP_breg29),
     503        ENTRY(DW_OP_breg30),
     504        ENTRY(DW_OP_breg31),
     505        ENTRY(DW_OP_regx),
     506        ENTRY(DW_OP_fbreg),
     507        ENTRY(DW_OP_bregx),
     508        ENTRY(DW_OP_piece),
     509        ENTRY(DW_OP_deref_size),
     510        ENTRY(DW_OP_xderef_size),
     511        ENTRY(DW_OP_nop),
     512        ENTRY(DW_OP_push_object_address),
     513        ENTRY(DW_OP_call2),
     514        ENTRY(DW_OP_call4),
     515        ENTRY(DW_OP_call_ref),
     516        ENTRY(DW_OP_form_tls_address),
     517        ENTRY(DW_OP_call_frame_cfa),
     518        ENTRY(DW_OP_bit_piece),
     519        ENTRY(DW_OP_implicit_value),
     520        ENTRY(DW_OP_stack_value),
     521        ENTRY(DW_OP_implicit_pointer),
     522        ENTRY(DW_OP_addrx),
     523        ENTRY(DW_OP_constx),
     524        ENTRY(DW_OP_entry_value),
     525        ENTRY(DW_OP_const_type),
     526        ENTRY(DW_OP_regval_type),
     527        ENTRY(DW_OP_deref_type),
     528        ENTRY(DW_OP_xderef_type),
     529        ENTRY(DW_OP_convert),
     530        ENTRY(DW_OP_reinterpret),
     531};
     532
     533_Static_assert(DW_OP_MAX == DW_OP_reinterpret + 1);
    55534
    56535static const char *const dw_lle_names[] = {
    57 #include <debug/constants/dw_lle.inc>
    58 };
    59 
    60 static const char *const dw_ate_names[] = {
    61 #include <debug/constants/dw_ate.inc>
    62 };
     536        ENTRY(DW_LLE_end_of_list),
     537        ENTRY(DW_LLE_base_addressx),
     538        ENTRY(DW_LLE_startx_endx),
     539        ENTRY(DW_LLE_startx_length),
     540        ENTRY(DW_LLE_offset_pair),
     541        ENTRY(DW_LLE_default_location),
     542        ENTRY(DW_LLE_base_address),
     543        ENTRY(DW_LLE_start_end),
     544        ENTRY(DW_LLE_start_length),
     545};
     546
     547_Static_assert(DW_LLE_MAX == DW_LLE_start_length + 1);
    63548
    64549static const char *const dw_ds_names[] = {
    65 #include <debug/constants/dw_ds.inc>
    66 };
     550        ENTRY(DW_DS_unsigned),
     551        ENTRY(DW_DS_leading_overpunch),
     552        ENTRY(DW_DS_trailing_overpunch),
     553        ENTRY(DW_DS_leading_separate),
     554        ENTRY(DW_DS_trailing_separate),
     555};
     556
     557_Static_assert(DW_DS_MAX == DW_DS_trailing_separate + 1);
    67558
    68559static const char *const dw_end_names[] = {
    69 #include <debug/constants/dw_end.inc>
    70 };
    71 
    72 static const char *const dw_access_names[] = {
    73 #include <debug/constants/dw_access.inc>
    74 };
     560        ENTRY(DW_END_default),
     561        ENTRY(DW_END_big),
     562        ENTRY(DW_END_little),
     563};
     564
     565_Static_assert(DW_END_MAX == DW_END_little + 1);
    75566
    76567static const char *const dw_vis_names[] = {
    77 #include <debug/constants/dw_vis.inc>
    78 };
     568        ENTRY(DW_VIS_local),
     569        ENTRY(DW_VIS_exported),
     570        ENTRY(DW_VIS_qualified),
     571};
     572
     573_Static_assert(DW_VIS_MAX == DW_VIS_qualified + 1);
    79574
    80575static const char *const dw_virtuality_names[] = {
    81 #include <debug/constants/dw_virtuality.inc>
    82 };
     576        ENTRY(DW_VIRTUALITY_none),
     577        ENTRY(DW_VIRTUALITY_virtual),
     578        ENTRY(DW_VIRTUALITY_pure_virtual),
     579};
     580
     581_Static_assert(DW_VIRTUALITY_MAX == DW_VIRTUALITY_pure_virtual + 1);
    83582
    84583static const char *const dw_lang_names[] = {
    85 #include <debug/constants/dw_lang.inc>
    86 };
     584        ENTRY(DW_LANG_C89),
     585        ENTRY(DW_LANG_C),
     586        ENTRY(DW_LANG_Ada83),
     587        ENTRY(DW_LANG_C_plus_plus),
     588        ENTRY(DW_LANG_Cobol74),
     589        ENTRY(DW_LANG_Cobol85),
     590        ENTRY(DW_LANG_Fortran77),
     591        ENTRY(DW_LANG_Fortran90),
     592        ENTRY(DW_LANG_Pascal83),
     593        ENTRY(DW_LANG_Modula2),
     594        ENTRY(DW_LANG_Java),
     595        ENTRY(DW_LANG_C99),
     596        ENTRY(DW_LANG_Ada95),
     597        ENTRY(DW_LANG_Fortran95),
     598        ENTRY(DW_LANG_PLI),
     599        ENTRY(DW_LANG_ObjC),
     600        ENTRY(DW_LANG_ObjC_plus_plus),
     601        ENTRY(DW_LANG_UPC),
     602        ENTRY(DW_LANG_D),
     603        ENTRY(DW_LANG_Python),
     604        ENTRY(DW_LANG_OpenCL),
     605        ENTRY(DW_LANG_Go),
     606        ENTRY(DW_LANG_Modula3),
     607        ENTRY(DW_LANG_Haskell),
     608        ENTRY(DW_LANG_C_plus_plus_03),
     609        ENTRY(DW_LANG_C_plus_plus_11),
     610        ENTRY(DW_LANG_OCaml),
     611        ENTRY(DW_LANG_Rust),
     612        ENTRY(DW_LANG_C11),
     613        ENTRY(DW_LANG_Swift),
     614        ENTRY(DW_LANG_Julia),
     615        ENTRY(DW_LANG_Dylan),
     616        ENTRY(DW_LANG_C_plus_plus_14),
     617        ENTRY(DW_LANG_Fortran03),
     618        ENTRY(DW_LANG_Fortran08),
     619        ENTRY(DW_LANG_RenderScript),
     620        ENTRY(DW_LANG_BLISS),
     621};
     622
     623_Static_assert(DW_LANG_MAX == DW_LANG_BLISS + 1);
    87624
    88625static const char *const dw_id_names[] = {
    89 #include <debug/constants/dw_id.inc>
    90 };
    91 
    92 static const char *const dw_cc_names[] = {
    93 #include <debug/constants/dw_cc.inc>
    94 };
     626        ENTRY(DW_ID_case_sensitive),
     627        ENTRY(DW_ID_up_case),
     628        ENTRY(DW_ID_down_case),
     629        ENTRY(DW_ID_case_insensitive),
     630};
     631
     632_Static_assert(DW_ID_MAX == DW_ID_case_insensitive + 1);
    95633
    96634static const char *const dw_lns_names[] = {
    97 #include <debug/constants/dw_lns.inc>
    98 };
     635        ENTRY(DW_LNS_copy),
     636        ENTRY(DW_LNS_advance_pc),
     637        ENTRY(DW_LNS_advance_line),
     638        ENTRY(DW_LNS_set_file),
     639        ENTRY(DW_LNS_set_column),
     640        ENTRY(DW_LNS_negate_stmt),
     641        ENTRY(DW_LNS_set_basic_block),
     642        ENTRY(DW_LNS_const_add_pc),
     643        ENTRY(DW_LNS_fixed_advance_pc),
     644        ENTRY(DW_LNS_set_prologue_end),
     645        ENTRY(DW_LNS_set_epilogue_begin),
     646        ENTRY(DW_LNS_set_isa),
     647};
     648
     649_Static_assert(DW_LNS_MAX == DW_LNS_set_isa + 1);
    99650
    100651static const char *const dw_lne_names[] = {
    101 #include <debug/constants/dw_lne.inc>
    102 };
     652        ENTRY(DW_LNE_end_sequence),
     653        ENTRY(DW_LNE_set_address),
     654        ENTRY(DW_LNE_define_file),
     655        ENTRY(DW_LNE_set_discriminator),
     656};
     657
     658_Static_assert(DW_LNE_MAX == DW_LNE_set_discriminator + 1);
    103659
    104660static const char *const dw_lnct_names[] = {
    105 #include <debug/constants/dw_lnct.inc>
    106 };
    107 
    108 #undef CVAL
    109 
    110 #define D_(infix) \
    111                 const char *dw_##infix##_name(dw_##infix##_t val) { \
    112                         if (val >= sizeof(dw_##infix##_names) / sizeof(const char *)) \
    113                                 return NULL; \
    114                         return dw_##infix##_names[val]; \
    115                 }
    116 
    117 D_(ut);
    118 D_(tag);
    119 D_(at);
    120 D_(form);
    121 D_(op);
    122 D_(lle);
    123 D_(ate);
    124 D_(ds);
    125 D_(end);
    126 D_(access);
    127 D_(vis);
    128 D_(virtuality);
    129 D_(lang);
    130 D_(id);
    131 D_(cc);
    132 D_(lns);
    133 D_(lne);
    134 D_(lnct);
    135 
    136 #undef D_
     661        ENTRY(DW_LNCT_path),
     662        ENTRY(DW_LNCT_directory_index),
     663        ENTRY(DW_LNCT_timestamp),
     664        ENTRY(DW_LNCT_size),
     665        ENTRY(DW_LNCT_MD5),
     666};
     667
     668_Static_assert(DW_LNCT_MAX == DW_LNCT_MD5 + 1);
     669
     670static const char *const dw_inl_names[] = {
     671        ENTRY(DW_INL_not_inlined),
     672        ENTRY(DW_INL_inlined),
     673        ENTRY(DW_INL_declared_not_inlined),
     674        ENTRY(DW_INL_declared_inlined),
     675};
     676
     677_Static_assert(DW_INL_MAX == DW_INL_declared_inlined + 1);
     678
     679static const char *const dw_ord_names[] = {
     680        ENTRY(DW_ORD_row_major),
     681        ENTRY(DW_ORD_col_major),
     682};
     683
     684_Static_assert(DW_ORD_MAX == DW_ORD_col_major + 1);
     685
     686static const char *const dw_dsc_names[] = {
     687        ENTRY(DW_DSC_label),
     688        ENTRY(DW_DSC_range),
     689};
     690
     691_Static_assert(DW_DSC_MAX == DW_DSC_range + 1);
     692
     693static const char *const dw_idx_names[] = {
     694        ENTRY(DW_IDX_compile_unit),
     695        ENTRY(DW_IDX_type_unit),
     696        ENTRY(DW_IDX_die_offset),
     697        ENTRY(DW_IDX_parent),
     698        ENTRY(DW_IDX_type_hash),
     699};
     700
     701_Static_assert(DW_IDX_MAX == DW_IDX_type_hash + 1);
     702
     703static const char *const dw_defaulted_names[] = {
     704        ENTRY(DW_DEFAULTED_no),
     705        ENTRY(DW_DEFAULTED_in_class),
     706        ENTRY(DW_DEFAULTED_out_of_class),
     707};
     708
     709_Static_assert(DW_DEFAULTED_MAX == DW_DEFAULTED_out_of_class + 1);
     710
     711static const char *const dw_macro_names[] = {
     712        ENTRY(DW_MACRO_define),
     713        ENTRY(DW_MACRO_undef),
     714        ENTRY(DW_MACRO_start_file),
     715        ENTRY(DW_MACRO_end_file),
     716        ENTRY(DW_MACRO_define_strp),
     717        ENTRY(DW_MACRO_undef_strp),
     718        ENTRY(DW_MACRO_import),
     719        ENTRY(DW_MACRO_define_sup),
     720        ENTRY(DW_MACRO_undef_sup),
     721        ENTRY(DW_MACRO_import_sup),
     722        ENTRY(DW_MACRO_define_strx),
     723        ENTRY(DW_MACRO_undef_strx),
     724};
     725
     726_Static_assert(DW_MACRO_MAX == DW_MACRO_undef_strx + 1);
     727
     728static const char *const dw_cfa_names[] = {
     729        ENTRY(DW_CFA_nop),
     730        ENTRY(DW_CFA_set_loc),
     731        ENTRY(DW_CFA_advance_loc1),
     732        ENTRY(DW_CFA_advance_loc2),
     733        ENTRY(DW_CFA_advance_loc4),
     734        ENTRY(DW_CFA_offset_extended),
     735        ENTRY(DW_CFA_restore_extended),
     736        ENTRY(DW_CFA_undefined),
     737        ENTRY(DW_CFA_same_value),
     738        ENTRY(DW_CFA_register),
     739        ENTRY(DW_CFA_remember_state),
     740        ENTRY(DW_CFA_restore_state),
     741        ENTRY(DW_CFA_def_cfa),
     742        ENTRY(DW_CFA_def_cfa_register),
     743        ENTRY(DW_CFA_def_cfa_offset),
     744        ENTRY(DW_CFA_def_cfa_expression),
     745        ENTRY(DW_CFA_expression),
     746        ENTRY(DW_CFA_offset_extended_sf),
     747        ENTRY(DW_CFA_def_cfa_sf),
     748        ENTRY(DW_CFA_def_cfa_offset_sf),
     749        ENTRY(DW_CFA_val_offset),
     750        ENTRY(DW_CFA_val_offset_sf),
     751        ENTRY(DW_CFA_val_expression),
     752};
     753
     754_Static_assert(DW_CFA_MAX == DW_CFA_val_expression + 1);
     755
     756static const char *const dw_rle_names[] = {
     757        ENTRY(DW_RLE_end_of_list),
     758        ENTRY(DW_RLE_base_addressx),
     759        ENTRY(DW_RLE_startx_endx),
     760        ENTRY(DW_RLE_startx_length),
     761        ENTRY(DW_RLE_offset_pair),
     762        ENTRY(DW_RLE_base_address),
     763        ENTRY(DW_RLE_start_end),
     764        ENTRY(DW_RLE_start_length),
     765};
     766
     767_Static_assert(DW_RLE_MAX == DW_RLE_start_length + 1);
     768
     769#define NAME_FUNC(prefix) \
     770        const char *prefix##_name(prefix##_t val) \
     771        { \
     772                if (val >= sizeof(prefix##_names) / sizeof(const char *)) return NULL; \
     773                return prefix##_names[val]; \
     774        }
     775
     776NAME_FUNC(dw_access);
     777NAME_FUNC(dw_at);
     778NAME_FUNC(dw_ate);
     779NAME_FUNC(dw_cc);
     780NAME_FUNC(dw_cfa);
     781NAME_FUNC(dw_defaulted);
     782NAME_FUNC(dw_ds);
     783NAME_FUNC(dw_dsc);
     784NAME_FUNC(dw_end);
     785NAME_FUNC(dw_form);
     786NAME_FUNC(dw_id);
     787NAME_FUNC(dw_idx);
     788NAME_FUNC(dw_inl);
     789NAME_FUNC(dw_lang);
     790NAME_FUNC(dw_lle);
     791NAME_FUNC(dw_lnct);
     792NAME_FUNC(dw_lne);
     793NAME_FUNC(dw_lns);
     794NAME_FUNC(dw_macro);
     795NAME_FUNC(dw_op);
     796NAME_FUNC(dw_ord);
     797NAME_FUNC(dw_rle);
     798NAME_FUNC(dw_tag);
     799NAME_FUNC(dw_ut);
     800NAME_FUNC(dw_virtuality);
     801NAME_FUNC(dw_vis);
Note: See TracChangeset for help on using the changeset viewer.