[Lldb-commits] [lldb] r107716 - in /lldb/trunk: include/lldb/Core/dwarf.h lldb.xcodeproj/project.pbxproj source/Core/DataExtractor.cpp source/Core/ValueObjectChild.cpp source/Expression/ClangExpression.cpp source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp source/Plugins/SymbolFile/DWARF/DWARFDefines.c source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp source/Plugins/SymbolFile/DWARF/DWARFDefines.h source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h source/Symbol/ClangASTContext.cpp source/Symbol/DWARFCallFrameInfo.cpp

Jason Molenda jmolenda at apple.com
Tue Jul 6 15:38:03 PDT 2010


Author: jmolenda
Date: Tue Jul  6 17:38:03 2010
New Revision: 107716

URL: http://llvm.org/viewvc/llvm-project?rev=107716&view=rev
Log:
Switch over to using llvm's dwarf constants file.

Added:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
      - copied, changed from r106035, lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c
Removed:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c
Modified:
    lldb/trunk/include/lldb/Core/dwarf.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Core/DataExtractor.cpp
    lldb/trunk/source/Core/ValueObjectChild.cpp
    lldb/trunk/source/Expression/ClangExpression.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp

Modified: lldb/trunk/include/lldb/Core/dwarf.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/dwarf.h?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/dwarf.h (original)
+++ lldb/trunk/include/lldb/Core/dwarf.h Tue Jul  6 17:38:03 2010
@@ -13,6 +13,11 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+// Get the DWARF constant defintions from llvm
+#include "llvm/Support/Dwarf.h"
+// and stuff them in our default namespace
+using namespace llvm::dwarf;
+
 typedef uint32_t    dw_uleb128_t;
 typedef int32_t     dw_sleb128_t;
 typedef uint16_t    dw_attr_t;
@@ -33,372 +38,15 @@
 #define DW_INVALID_OFFSET                   (~(dw_offset_t)0)
 #define DW_INVALID_INDEX                    0xFFFFFFFFul
 
+// #define DW_ADDR_none 0x0
 
-/* [7.5.4] Figure 16 "Tag Encodings" (pp. 125-127) in DWARFv3 draft 8 */
-
-#define DW_TAG_array_type                  0x1
-#define DW_TAG_class_type                  0x2
-#define DW_TAG_entry_point                 0x3
-#define DW_TAG_enumeration_type            0x4
-#define DW_TAG_formal_parameter            0x5
-#define DW_TAG_imported_declaration        0x8
-#define DW_TAG_label                       0xA
-#define DW_TAG_lexical_block               0xB
-#define DW_TAG_member                      0xD
-#define DW_TAG_pointer_type                0xF
-#define DW_TAG_reference_type             0x10
-#define DW_TAG_compile_unit               0x11
-#define DW_TAG_string_type                0x12
-#define DW_TAG_structure_type             0x13
-#define DW_TAG_subroutine_type            0x15
-#define DW_TAG_typedef                    0x16
-#define DW_TAG_union_type                 0x17
-#define DW_TAG_unspecified_parameters     0x18
-#define DW_TAG_variant                    0x19
-#define DW_TAG_common_block               0x1A
-#define DW_TAG_common_inclusion           0x1B
-#define DW_TAG_inheritance                0x1C
-#define DW_TAG_inlined_subroutine         0x1D
-#define DW_TAG_module                     0x1E
-#define DW_TAG_ptr_to_member_type         0x1F
-#define DW_TAG_set_type                   0x20
-#define DW_TAG_subrange_type              0x21
-#define DW_TAG_with_stmt                  0x22
-#define DW_TAG_access_declaration         0x23
-#define DW_TAG_base_type                  0x24
-#define DW_TAG_catch_block                0x25
-#define DW_TAG_const_type                 0x26
-#define DW_TAG_constant                   0x27
-#define DW_TAG_enumerator                 0x28
-#define DW_TAG_file_type                  0x29
-#define DW_TAG_friend                     0x2A
-#define DW_TAG_namelist                   0x2B
-#define DW_TAG_namelist_item              0x2C
-#define DW_TAG_packed_type                0x2D
-#define DW_TAG_subprogram                 0x2E
-#define DW_TAG_template_type_parameter    0x2F
-#define DW_TAG_template_value_parameter   0x30
-#define DW_TAG_thrown_type                0x31
-#define DW_TAG_try_block                  0x32
-#define DW_TAG_variant_part               0x33
-#define DW_TAG_variable                   0x34
-#define DW_TAG_volatile_type              0x35
-#define DW_TAG_dwarf_procedure            0x36
-#define DW_TAG_restrict_type              0x37
-#define DW_TAG_interface_type             0x38
-#define DW_TAG_namespace                  0x39
-#define DW_TAG_imported_module            0x3A
-#define DW_TAG_unspecified_type           0x3B
-#define DW_TAG_partial_unit               0x3C
-#define DW_TAG_imported_unit              0x3D
-#define DW_TAG_condition                  0x3F
-#define DW_TAG_shared_type                0x40
-#define DW_TAG_lo_user                  0x4080
-#define DW_TAG_hi_user                  0xFFFF
-
-/* [7.5.4] Figure 17 "Child determination encodings" (p. 128) in DWARFv3 draft 8 */
-
-#define DW_CHILDREN_no  0x0
-#define DW_CHILDREN_yes 0x1
-
-/* [7.5.4] Figure 18 "Attribute encodings" (pp. 129-132) in DWARFv3 draft 8 */
-
-#define DW_AT_sibling                         0x1
-#define DW_AT_location                        0x2
-#define DW_AT_name                            0x3
-#define DW_AT_ordering                        0x9
-#define DW_AT_byte_size                       0xB
-#define DW_AT_bit_offset                      0xC
-#define DW_AT_bit_size                        0xD
-#define DW_AT_stmt_list                      0x10
-#define DW_AT_low_pc                         0x11
-#define DW_AT_high_pc                        0x12
-#define DW_AT_language                       0x13
-#define DW_AT_discr                          0x15
-#define DW_AT_discr_value                    0x16
-#define DW_AT_visibility                     0x17
-#define DW_AT_import                         0x18
-#define DW_AT_string_length                  0x19
-#define DW_AT_common_reference               0x1A
-#define DW_AT_comp_dir                       0x1B
-#define DW_AT_const_value                    0x1C
-#define DW_AT_containing_type                0x1D
-#define DW_AT_default_value                  0x1E
-#define DW_AT_inline                         0x20
-#define DW_AT_is_optional                    0x21
-#define DW_AT_lower_bound                    0x22
-#define DW_AT_producer                       0x25
-#define DW_AT_prototyped                     0x27
-#define DW_AT_return_addr                    0x2A
-#define DW_AT_start_scope                    0x2C
-#define DW_AT_bit_stride                     0x2E
-#define DW_AT_upper_bound                    0x2F
-#define DW_AT_abstract_origin                0x31
-#define DW_AT_accessibility                  0x32
-#define DW_AT_address_class                  0x33
-#define DW_AT_artificial                     0x34
-#define DW_AT_base_types                     0x35
-#define DW_AT_calling_convention             0x36
-#define DW_AT_count                          0x37
-#define DW_AT_data_member_location           0x38
-#define DW_AT_decl_column                    0x39
-#define DW_AT_decl_file                      0x3A
-#define DW_AT_decl_line                      0x3B
-#define DW_AT_declaration                    0x3C
-#define DW_AT_discr_list                     0x3D
-#define DW_AT_encoding                       0x3E
-#define DW_AT_external                       0x3F
-#define DW_AT_frame_base                     0x40
-#define DW_AT_friend                         0x41
-#define DW_AT_identifier_case                0x42
-#define DW_AT_macro_info                     0x43
-#define DW_AT_namelist_item                  0x44
-#define DW_AT_priority                       0x45
-#define DW_AT_segment                        0x46
-#define DW_AT_specification                  0x47
-#define DW_AT_static_link                    0x48
-#define DW_AT_type                           0x49
-#define DW_AT_use_location                   0x4A
-#define DW_AT_variable_parameter             0x4B
-#define DW_AT_virtuality                     0x4C
-#define DW_AT_vtable_elem_location           0x4D
-#define DW_AT_allocated                      0x4E
-#define DW_AT_associated                     0x4F
-#define DW_AT_data_location                  0x50
-#define DW_AT_byte_stride                    0x51
-#define DW_AT_entry_pc                       0x52
-#define DW_AT_use_UTF8                       0x53
-#define DW_AT_extension                      0x54
-#define DW_AT_ranges                         0x55
-#define DW_AT_trampoline                     0x56
-#define DW_AT_call_column                    0x57
-#define DW_AT_call_file                      0x58
-#define DW_AT_call_line                      0x59
-#define DW_AT_description                    0x5A
-#define DW_AT_binary_scale                   0x5B
-#define DW_AT_decimal_scale                  0x5C
-#define DW_AT_small                          0x5D
-#define DW_AT_decimal_sign                   0x5E
-#define DW_AT_digit_count                    0x5F
-#define DW_AT_picture_string                 0x60
-#define DW_AT_mutable                        0x61
-#define DW_AT_threads_scaled                 0x62
-#define DW_AT_explicit                       0x63
-#define DW_AT_object_pointer                 0x64
-#define DW_AT_endianity                      0x65
-#define DW_AT_elemental                      0x66
-#define DW_AT_pure                           0x67
-#define DW_AT_recursive                      0x68
-#define DW_AT_lo_user                      0x2000
-#define DW_AT_hi_user                      0x3FFF
-#define DW_AT_MIPS_fde                     0x2001
-#define DW_AT_MIPS_loop_begin              0x2002
-#define DW_AT_MIPS_tail_loop_begin         0x2003
-#define DW_AT_MIPS_epilog_begin            0x2004
-#define DW_AT_MIPS_loop_unroll_factor      0x2005
-#define DW_AT_MIPS_software_pipeline_depth 0x2006
-#define DW_AT_MIPS_linkage_name            0x2007
-#define DW_AT_MIPS_stride                  0x2008
-#define DW_AT_MIPS_abstract_name           0x2009
-#define DW_AT_MIPS_clone_origin            0x200A
-#define DW_AT_MIPS_has_inlines             0x200B
-/* GNU extensions.  */
-#define DW_AT_sf_names                     0x2101
-#define DW_AT_src_info                     0x2102
-#define DW_AT_mac_info                     0x2103
-#define DW_AT_src_coords                   0x2104
-#define DW_AT_body_begin                   0x2105
-#define DW_AT_body_end                     0x2106
-#define DW_AT_GNU_vector                   0x2107
+#define DW_EH_PE_MASK_ENCODING 0x0F
 
-#define DW_AT_APPLE_repository_file             0x2501
-#define DW_AT_APPLE_repository_type             0x2502
-#define DW_AT_APPLE_repository_name             0x2503
-#define DW_AT_APPLE_repository_specification    0x2504
-#define DW_AT_APPLE_repository_import           0x2505
-#define DW_AT_APPLE_repository_abstract_origin  0x2506
-#define DW_AT_APPLE_optimized                   0x3FE1
-#define DW_AT_APPLE_flags                       0x3FE2
-#define DW_AT_APPLE_isa                         0x3FE3
-#define DW_AT_APPLE_block                       0x3FE4
+// The following are used only internally within lldb - don't
+// document them in the llvm Dwarf.h header file, we won't see
+// them in executable files anywhere.
+// These constants fit between DW_OP_lo_user (0xe0) and DW_OP_hi_user (0xff).
 
-/* [7.5.4] Figure 19 "Attribute form encodings" (pp. 133-134) in DWARFv3 draft 8 */
-
-#define DW_FORM_addr       0x1
-#define DW_FORM_block2     0x3
-#define DW_FORM_block4     0x4
-#define DW_FORM_data2      0x5
-#define DW_FORM_data4      0x6
-#define DW_FORM_data8      0x7
-#define DW_FORM_string     0x8
-#define DW_FORM_block      0x9
-#define DW_FORM_block1     0xA
-#define DW_FORM_data1      0xB
-#define DW_FORM_flag       0xC
-#define DW_FORM_sdata      0xD
-#define DW_FORM_strp       0xE
-#define DW_FORM_udata      0xF
-#define DW_FORM_ref_addr  0x10
-#define DW_FORM_ref1      0x11
-#define DW_FORM_ref2      0x12
-#define DW_FORM_ref4      0x13
-#define DW_FORM_ref8      0x14
-#define DW_FORM_ref_udata 0x15
-#define DW_FORM_indirect  0x16 // cf section 7.5.3, "Abbreviations Tables", p. 119 DWARFv3 draft 8
-#define DW_FORM_APPLE_db_str    0x50 // read same as udata, but refers to string in repository
-
-/* [7.7.1] Figure 22 "DWARF operation encodings" (pp. 136-139) in DWARFv3 draft 8 */
-
-#define DW_OP_addr                 0x3 // constant address (size target specific)
-#define DW_OP_deref                0x6
-#define DW_OP_const1u              0x8 // 1-byte constant
-#define DW_OP_const1s              0x9 // 1-byte constant
-#define DW_OP_const2u              0xA // 2-byte constant
-#define DW_OP_const2s              0xB // 2-byte constant
-#define DW_OP_const4u              0xC // 4-byte constant
-#define DW_OP_const4s              0xD // 4-byte constant
-#define DW_OP_const8u              0xE // 8-byte constant
-#define DW_OP_const8s              0xF // 8-byte constant
-#define DW_OP_constu              0x10 // ULEB128 constant
-#define DW_OP_consts              0x11 // SLEB128 constant
-#define DW_OP_dup                 0x12
-#define DW_OP_drop                0x13
-#define DW_OP_over                0x14
-#define DW_OP_pick                0x15 // 1-byte stack index
-#define DW_OP_swap                0x16
-#define DW_OP_rot                 0x17
-#define DW_OP_xderef              0x18
-#define DW_OP_abs                 0x19
-#define DW_OP_and                 0x1A
-#define DW_OP_div                 0x1B
-#define DW_OP_minus               0x1C
-#define DW_OP_mod                 0x1D
-#define DW_OP_mul                 0x1E
-#define DW_OP_neg                 0x1F
-#define DW_OP_not                 0x20
-#define DW_OP_or                  0x21
-#define DW_OP_plus                0x22
-#define DW_OP_plus_uconst         0x23 // ULEB128 addend
-#define DW_OP_shl                 0x24
-#define DW_OP_shr                 0x25
-#define DW_OP_shra                0x26
-#define DW_OP_xor                 0x27
-#define DW_OP_skip                0x2F // signed 2-byte constant
-#define DW_OP_bra                 0x28 // signed 2-byte constant
-#define DW_OP_eq                  0x29
-#define DW_OP_ge                  0x2A
-#define DW_OP_gt                  0x2B
-#define DW_OP_le                  0x2C
-#define DW_OP_lt                  0x2D
-#define DW_OP_ne                  0x2E
-#define DW_OP_lit0                0x30 // Literal 0
-#define DW_OP_lit1                0x31 // Literal 1
-#define DW_OP_lit2                0x32 // Literal 2
-#define DW_OP_lit3                0x33 // Literal 3
-#define DW_OP_lit4                0x34 // Literal 4
-#define DW_OP_lit5                0x35 // Literal 5
-#define DW_OP_lit6                0x36 // Literal 6
-#define DW_OP_lit7                0x37 // Literal 7
-#define DW_OP_lit8                0x38 // Literal 8
-#define DW_OP_lit9                0x39 // Literal 9
-#define DW_OP_lit10               0x3A // Literal 10
-#define DW_OP_lit11               0x3B // Literal 11
-#define DW_OP_lit12               0x3C // Literal 12
-#define DW_OP_lit13               0x3D // Literal 13
-#define DW_OP_lit14               0x3E // Literal 14
-#define DW_OP_lit15               0x3F // Literal 15
-#define DW_OP_lit16               0x40 // Literal 16
-#define DW_OP_lit17               0x41 // Literal 17
-#define DW_OP_lit18               0x42 // Literal 18
-#define DW_OP_lit19               0x43 // Literal 19
-#define DW_OP_lit20               0x44 // Literal 20
-#define DW_OP_lit21               0x45 // Literal 21
-#define DW_OP_lit22               0x46 // Literal 22
-#define DW_OP_lit23               0x47 // Literal 23
-#define DW_OP_lit24               0x48 // Literal 24
-#define DW_OP_lit25               0x49 // Literal 25
-#define DW_OP_lit26               0x4A // Literal 26
-#define DW_OP_lit27               0x4B // Literal 27
-#define DW_OP_lit28               0x4C // Literal 28
-#define DW_OP_lit29               0x4D // Literal 29
-#define DW_OP_lit30               0x4E // Literal 30
-#define DW_OP_lit31               0x4F // Literal 31
-#define DW_OP_reg0                0x50 // Contents of reg0
-#define DW_OP_reg1                0x51 // Contents of reg1
-#define DW_OP_reg2                0x52 // Contents of reg2
-#define DW_OP_reg3                0x53 // Contents of reg3
-#define DW_OP_reg4                0x54 // Contents of reg4
-#define DW_OP_reg5                0x55 // Contents of reg5
-#define DW_OP_reg6                0x56 // Contents of reg6
-#define DW_OP_reg7                0x57 // Contents of reg7
-#define DW_OP_reg8                0x58 // Contents of reg8
-#define DW_OP_reg9                0x59 // Contents of reg9
-#define DW_OP_reg10               0x5A // Contents of reg10
-#define DW_OP_reg11               0x5B // Contents of reg11
-#define DW_OP_reg12               0x5C // Contents of reg12
-#define DW_OP_reg13               0x5D // Contents of reg13
-#define DW_OP_reg14               0x5E // Contents of reg14
-#define DW_OP_reg15               0x5F // Contents of reg15
-#define DW_OP_reg16               0x60 // Contents of reg16
-#define DW_OP_reg17               0x61 // Contents of reg17
-#define DW_OP_reg18               0x62 // Contents of reg18
-#define DW_OP_reg19               0x63 // Contents of reg19
-#define DW_OP_reg20               0x64 // Contents of reg20
-#define DW_OP_reg21               0x65 // Contents of reg21
-#define DW_OP_reg22               0x66 // Contents of reg22
-#define DW_OP_reg23               0x67 // Contents of reg23
-#define DW_OP_reg24               0x68 // Contents of reg24
-#define DW_OP_reg25               0x69 // Contents of reg25
-#define DW_OP_reg26               0x6A // Contents of reg26
-#define DW_OP_reg27               0x6B // Contents of reg27
-#define DW_OP_reg28               0x6C // Contents of reg28
-#define DW_OP_reg29               0x6D // Contents of reg29
-#define DW_OP_reg30               0x6E // Contents of reg30
-#define DW_OP_reg31               0x6F // Contents of reg31
-#define DW_OP_breg0               0x70 // base register 0 + SLEB128 offset
-#define DW_OP_breg1               0x71 // base register 1 + SLEB128 offset
-#define DW_OP_breg2               0x72 // base register 2 + SLEB128 offset
-#define DW_OP_breg3               0x73 // base register 3 + SLEB128 offset
-#define DW_OP_breg4               0x74 // base register 4 + SLEB128 offset
-#define DW_OP_breg5               0x75 // base register 5 + SLEB128 offset
-#define DW_OP_breg6               0x76 // base register 6 + SLEB128 offset
-#define DW_OP_breg7               0x77 // base register 7 + SLEB128 offset
-#define DW_OP_breg8               0x78 // base register 8 + SLEB128 offset
-#define DW_OP_breg9               0x79 // base register 9 + SLEB128 offset
-#define DW_OP_breg10              0x7A // base register 10 + SLEB128 offset
-#define DW_OP_breg11              0x7B // base register 11 + SLEB128 offset
-#define DW_OP_breg12              0x7C // base register 12 + SLEB128 offset
-#define DW_OP_breg13              0x7D // base register 13 + SLEB128 offset
-#define DW_OP_breg14              0x7E // base register 14 + SLEB128 offset
-#define DW_OP_breg15              0x7F // base register 15 + SLEB128 offset
-#define DW_OP_breg16              0x80 // base register 16 + SLEB128 offset
-#define DW_OP_breg17              0x81 // base register 17 + SLEB128 offset
-#define DW_OP_breg18              0x82 // base register 18 + SLEB128 offset
-#define DW_OP_breg19              0x83 // base register 19 + SLEB128 offset
-#define DW_OP_breg20              0x84 // base register 20 + SLEB128 offset
-#define DW_OP_breg21              0x85 // base register 21 + SLEB128 offset
-#define DW_OP_breg22              0x86 // base register 22 + SLEB128 offset
-#define DW_OP_breg23              0x87 // base register 23 + SLEB128 offset
-#define DW_OP_breg24              0x88 // base register 24 + SLEB128 offset
-#define DW_OP_breg25              0x89 // base register 25 + SLEB128 offset
-#define DW_OP_breg26              0x8A // base register 26 + SLEB128 offset
-#define DW_OP_breg27              0x8B // base register 27 + SLEB128 offset
-#define DW_OP_breg28              0x8C // base register 28 + SLEB128 offset
-#define DW_OP_breg29              0x8D // base register 29 + SLEB128 offset
-#define DW_OP_breg30              0x8E // base register 30 + SLEB128 offset
-#define DW_OP_breg31              0x8F // base register 31 + SLEB128 offset
-#define DW_OP_regx                0x90 // ULEB128 register
-#define DW_OP_fbreg               0x91 // SLEB128 offset
-#define DW_OP_bregx               0x92 // ULEB128 register followed by SLEB128 offset
-#define DW_OP_piece               0x93 // ULEB128 size of piece addressed
-#define DW_OP_deref_size          0x94 // 1-byte size of data retrieved
-#define DW_OP_xderef_size         0x95 // 1-byte size of data retrieved
-#define DW_OP_nop                 0x96
-#define DW_OP_push_object_address 0x97
-#define DW_OP_call2               0x98 // 2-byte offset of DIE
-#define DW_OP_call4               0x99 // 4-byte offset of DIE
-#define DW_OP_call_ref            0x9A // 4- or 8-byte offset of DIE
-#define DW_OP_lo_user             0xE0
 #define DW_OP_APPLE_array_ref     0xEE // first pops index, then pops array; pushes array[index]
 #define DW_OP_APPLE_extern        0xEF // ULEB128 index of external object (i.e., an entity from the program that was used in the expression)
 #define DW_OP_APPLE_uninit        0xF0
@@ -412,179 +60,6 @@
 #define DW_OP_APPLE_clang_cast    0xF8 // pointer size clang::Type * off the stack and cast top stack item to this type
 #define DW_OP_APPLE_clear         0xFE // clears the entire expression stack, ok if the stack is empty
 #define DW_OP_APPLE_error         0xFF // Stops expression evaluation and returns an error (no args)
-#define DW_OP_hi_user             0xFF
-
-/* [7.8] Figure 23 "Base type encoding values" (pp. 140-141) in DWARFv3 draft 8 */
-
-#define DW_ATE_address          0x1
-#define DW_ATE_boolean          0x2
-#define DW_ATE_complex_float    0x3
-#define DW_ATE_float            0x4
-#define DW_ATE_signed           0x5
-#define DW_ATE_signed_char      0x6
-#define DW_ATE_unsigned         0x7
-#define DW_ATE_unsigned_char    0x8
-#define DW_ATE_imaginary_float  0x9
-#define DW_ATE_lo_user         0x80
-#define DW_ATE_hi_user         0xFF
-
-/* [7.9] Figure 24 "Accessibility encodings" (p. 141) in DWARFv3 draft 8 */
-
-#define DW_ACCESS_public    0x1
-#define DW_ACCESS_protected 0x2
-#define DW_ACCESS_private   0x3
-
-/* [7.10] Figure 25 "Visibility encodings" (p. 142) in DWARFv3 draft 8 */
-
-#define DW_VIS_local     0x1
-#define DW_VIS_exported  0x2
-#define DW_VIS_qualified 0x3
-
-/* [7.11] Figure 26 "Virtuality encodings" (p. 142) in DWARFv3 draft 8 */
-
-#define DW_VIRTUALITY_none         0x0
-#define DW_VIRTUALITY_virtual      0x1
-#define DW_VIRTUALITY_pure_virtual 0x2
-
-
-/* [7.12] Figure 27 "Language encodings" (p. 143) in DWARFv3 draft 8 */
-
-#define DW_LANG_C89               0x1
-#define DW_LANG_C                 0x2
-#define DW_LANG_Ada83             0x3
-#define DW_LANG_C_plus_plus       0x4
-#define DW_LANG_Cobol74           0x5
-#define DW_LANG_Cobol85           0x6
-#define DW_LANG_Fortran77         0x7
-#define DW_LANG_Fortran90         0x8
-#define DW_LANG_Pascal83          0x9
-#define DW_LANG_Modula2           0xA
-#define DW_LANG_Java              0xB
-#define DW_LANG_C99               0xC
-#define DW_LANG_Ada95             0xD
-#define DW_LANG_Fortran95         0xE
-#define DW_LANG_PLI               0xF
-#define DW_LANG_lo_user        0x8000
-#define DW_LANG_hi_user        0xFFFF
-#define DW_LANG_MIPS_Assembler 0x8001
-
-/* [7.13], "Address Class Encodings" (p. 144) in DWARFv3 draft 8 */
-
-#define DW_ADDR_none 0x0
-
-/* [7.14] Figure 28 "Identifier case encodings" (p. 144) in DWARFv3 draft 8 */
-
-#define DW_ID_case_sensitive   0x0
-#define DW_ID_up_case          0x1
-#define DW_ID_down_case        0x2
-#define DW_ID_case_insensitive 0x3
-
-/* [7.15] Figure 29 "Calling convention encodings" (p. 144) in DWARFv3 draft 8 */
-
-#define DW_CC_normal   0x1
-#define DW_CC_program  0x2
-#define DW_CC_nocall   0x3
-#define DW_CC_lo_user 0x40
-#define DW_CC_hi_user 0xFF
-
-/* [7.16] Figure 30 "Inline encodings" (p. 145) in DWARFv3 draft 8 */
-
-#define DW_INL_not_inlined          0x0
-#define DW_INL_inlined              0x1
-#define DW_INL_declared_not_inlined 0x2
-#define DW_INL_declared_inlined     0x3
-
-/* [7.17] Figure 31 "Ordering encodings" (p. 145) in DWARFv3 draft 8 */
-
-#define DW_ORD_row_major 0x0
-#define DW_ORD_col_major 0x1
-
-/* [7.18] Figure 32 "Discriminant descriptor encodings" (p. 146) in DWARFv3 draft 8 */
-
-#define DW_DSC_label 0x0
-#define DW_DSC_range 0x1
-
-/* [7.21] Figure 33 "Line Number Standard Opcode Encodings" (pp. 148-149) in DWARFv3 draft 8 */
-
-#define DW_LNS_copy               0x1
-#define DW_LNS_advance_pc         0x2
-#define DW_LNS_advance_line       0x3
-#define DW_LNS_set_file           0x4
-#define DW_LNS_set_column         0x5
-#define DW_LNS_negate_stmt        0x6
-#define DW_LNS_set_basic_block    0x7
-#define DW_LNS_const_add_pc       0x8
-#define DW_LNS_fixed_advance_pc   0x9
-#define DW_LNS_set_prologue_end   0xA
-#define DW_LNS_set_epilogue_begin 0xB
-#define DW_LNS_set_isa            0xC
-
-/* [7.21] Figure 34 "Line Number Extended Opcode Encodings" (p. 149) in DWARFv3 draft 8 */
-
-#define DW_LNE_end_sequence  0x1
-#define DW_LNE_set_address   0x2
-#define DW_LNE_define_file   0x3
-#define DW_LNE_lo_user      0x80
-#define DW_LNE_hi_user      0xFF
-
-/* [7.22] Figure 35 "Macinfo Type Encodings" (p. 150) in DWARFv3 draft 8 */
-
-#define DW_MACINFO_define      0x1
-#define DW_MACINFO_undef       0x2
-#define DW_MACINFO_start_file  0x3
-#define DW_MACINFO_end_file    0x4
-#define DW_MACINFO_vendor_ext 0xFF
-
-/* [7.23] Figure 36 "Call frame instruction encodings" (pp. 151-152) in DWARFv3 draft 8 */
-
-#define DW_CFA_advance_loc        0x40 // high 2 bits are 0x1, lower 6 bits are delta
-#define DW_CFA_offset             0x80 // high 2 bits are 0x2, lower 6 bits are register
-#define DW_CFA_restore            0xC0 // high 2 bits are 0x3, lower 6 bits are register
-#define DW_CFA_nop                 0x0
-#define DW_CFA_set_loc             0x1
-#define DW_CFA_advance_loc1        0x2
-#define DW_CFA_advance_loc2        0x3
-#define DW_CFA_advance_loc4        0x4
-#define DW_CFA_offset_extended     0x5
-#define DW_CFA_restore_extended    0x6
-#define DW_CFA_undefined           0x7
-#define DW_CFA_same_value          0x8
-#define DW_CFA_register            0x9
-#define DW_CFA_remember_state      0xA
-#define DW_CFA_restore_state       0xB
-#define DW_CFA_def_cfa             0xC
-#define DW_CFA_def_cfa_register    0xD
-#define DW_CFA_def_cfa_offset      0xE
-#define DW_CFA_def_cfa_expression  0xF
-#define DW_CFA_expression         0x10
-#define DW_CFA_offset_extended_sf 0x11
-#define DW_CFA_def_cfa_sf         0x12
-#define DW_CFA_def_cfa_offset_sf  0x13
-#define DW_CFA_val_offset         0x14
-#define DW_CFA_val_offset_sf      0x15
-#define DW_CFA_val_expression     0x16
-#define DW_CFA_lo_user            0x1C
-#define DW_CFA_hi_user            0x3F
-
-/* FSF exception handling Pointer-Encoding constants (CFI augmentation) -- "DW_EH_PE_..." in the FSF sources */
 
-#define DW_GNU_EH_PE_absptr    0x0
-#define DW_GNU_EH_PE_uleb128   0x1
-#define DW_GNU_EH_PE_udata2    0x2
-#define DW_GNU_EH_PE_udata4    0x3
-#define DW_GNU_EH_PE_udata8    0x4
-#define DW_GNU_EH_PE_sleb128   0x9
-#define DW_GNU_EH_PE_sdata2    0xA
-#define DW_GNU_EH_PE_sdata4    0xB
-#define DW_GNU_EH_PE_sdata8    0xC
-#define DW_GNU_EH_PE_signed    0x8
-#define DW_GNU_EH_PE_MASK_ENCODING 0x0F
-#define DW_GNU_EH_PE_pcrel    0x10
-#define DW_GNU_EH_PE_textrel  0x20
-#define DW_GNU_EH_PE_datarel  0x30
-#define DW_GNU_EH_PE_funcrel  0x40
-#define DW_GNU_EH_PE_aligned  0x50
-#define DW_GNU_EH_PE_indirect 0x80
-#define DW_GNU_EH_PE_omit     0xFF
 
 #endif  // DebugBase_dwarf_h_

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jul  6 17:38:03 2010
@@ -231,7 +231,7 @@
 		26D5B11111B07550009A862E /* DWARFDebugPubnames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C910F57C5600BB2B04 /* DWARFDebugPubnames.cpp */; };
 		26D5B11211B07550009A862E /* DWARFDebugPubnamesSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CB10F57C5600BB2B04 /* DWARFDebugPubnamesSet.cpp */; };
 		26D5B11311B07550009A862E /* DWARFDebugRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */; };
-		26D5B11411B07550009A862E /* DWARFDefines.c in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CF10F57C5600BB2B04 /* DWARFDefines.c */; };
+		26D5B11411B07550009A862E /* DWARFDefines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */; };
 		26D5B11511B07550009A862E /* DWARFDIECollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */; };
 		26D5B11611B07550009A862E /* DWARFFormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */; };
 		26D5B11711B07550009A862E /* DWARFLocationDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D510F57C5600BB2B04 /* DWARFLocationDescription.cpp */; };
@@ -479,7 +479,7 @@
 		260C89CC10F57C5600BB2B04 /* DWARFDebugPubnamesSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugPubnamesSet.h; sourceTree = "<group>"; };
 		260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugRanges.cpp; sourceTree = "<group>"; };
 		260C89CE10F57C5600BB2B04 /* DWARFDebugRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugRanges.h; sourceTree = "<group>"; };
-		260C89CF10F57C5600BB2B04 /* DWARFDefines.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DWARFDefines.c; sourceTree = "<group>"; };
+		260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DWARFDefines.cpp; sourceTree = "<group>"; };
 		260C89D010F57C5600BB2B04 /* DWARFDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDefines.h; sourceTree = "<group>"; };
 		260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDIECollection.cpp; sourceTree = "<group>"; };
 		260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDIECollection.h; sourceTree = "<group>"; };
@@ -1328,7 +1328,7 @@
 				260C89CC10F57C5600BB2B04 /* DWARFDebugPubnamesSet.h */,
 				260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */,
 				260C89CE10F57C5600BB2B04 /* DWARFDebugRanges.h */,
-				260C89CF10F57C5600BB2B04 /* DWARFDefines.c */,
+				260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */,
 				260C89D010F57C5600BB2B04 /* DWARFDefines.h */,
 				260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */,
 				260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */,
@@ -2535,7 +2535,7 @@
 				26D5B11111B07550009A862E /* DWARFDebugPubnames.cpp in Sources */,
 				26D5B11211B07550009A862E /* DWARFDebugPubnamesSet.cpp in Sources */,
 				26D5B11311B07550009A862E /* DWARFDebugRanges.cpp in Sources */,
-				26D5B11411B07550009A862E /* DWARFDefines.c in Sources */,
+				26D5B11411B07550009A862E /* DWARFDefines.cpp in Sources */,
 				26D5B11511B07550009A862E /* DWARFDIECollection.cpp in Sources */,
 				26D5B11611B07550009A862E /* DWARFFormValue.cpp in Sources */,
 				26D5B11711B07550009A862E /* DWARFLocationDescription.cpp in Sources */,

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Tue Jul  6 17:38:03 2010
@@ -836,7 +836,7 @@
 uint64_t
 DataExtractor::GetGNUEHPointer (uint32_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr)//, BSDRelocs *data_relocs) const
 {
-    if (eh_ptr_enc == DW_GNU_EH_PE_omit)
+    if (eh_ptr_enc == DW_EH_PE_omit)
         return ULONG_LONG_MAX;  // Value isn't in the buffer...
 
     uint64_t baseAddress = 0;
@@ -847,7 +847,7 @@
     // Decode the base part or adjust our offset
     switch (eh_ptr_enc & 0x70)
     {
-    case DW_GNU_EH_PE_pcrel:
+    case DW_EH_PE_pcrel:
         signExtendValue = true;
         baseAddress = *offset_ptr;
         if (pc_rel_addr != LLDB_INVALID_ADDRESS)
@@ -856,7 +856,7 @@
 //          Log::GlobalWarning ("PC relative pointer encoding found with invalid pc relative address.");
         break;
 
-    case DW_GNU_EH_PE_textrel:
+    case DW_EH_PE_textrel:
         signExtendValue = true;
         if (text_addr != LLDB_INVALID_ADDRESS)
             baseAddress = text_addr;
@@ -864,7 +864,7 @@
 //          Log::GlobalWarning ("text relative pointer encoding being decoded with invalid text section address, setting base address to zero.");
         break;
 
-    case DW_GNU_EH_PE_datarel:
+    case DW_EH_PE_datarel:
         signExtendValue = true;
         if (data_addr != LLDB_INVALID_ADDRESS)
             baseAddress = data_addr;
@@ -872,11 +872,11 @@
 //          Log::GlobalWarning ("data relative pointer encoding being decoded with invalid data section address, setting base address to zero.");
         break;
 
-    case DW_GNU_EH_PE_funcrel:
+    case DW_EH_PE_funcrel:
         signExtendValue = true;
         break;
 
-    case DW_GNU_EH_PE_aligned:
+    case DW_EH_PE_aligned:
         {
             // SetPointerSize should be called prior to extracting these so the
             // pointer size is cached
@@ -896,23 +896,23 @@
     }
 
     // Decode the value part
-    switch (eh_ptr_enc & DW_GNU_EH_PE_MASK_ENCODING)
+    switch (eh_ptr_enc & DW_EH_PE_MASK_ENCODING)
     {
-    case DW_GNU_EH_PE_absptr    :
+    case DW_EH_PE_absptr    :
         {
             addressValue = GetAddress (offset_ptr);
 //          if (data_relocs)
 //              addressValue = data_relocs->Relocate(*offset_ptr - addr_size, *this, addressValue);
         }
         break;
-    case DW_GNU_EH_PE_uleb128   : addressValue = GetULEB128(offset_ptr);        break;
-    case DW_GNU_EH_PE_udata2    : addressValue = GetU16(offset_ptr);            break;
-    case DW_GNU_EH_PE_udata4    : addressValue = GetU32(offset_ptr);            break;
-    case DW_GNU_EH_PE_udata8    : addressValue = GetU64(offset_ptr);            break;
-    case DW_GNU_EH_PE_sleb128   : addressValue = GetSLEB128(offset_ptr);        break;
-    case DW_GNU_EH_PE_sdata2    : addressValue = (int16_t)GetU16(offset_ptr);   break;
-    case DW_GNU_EH_PE_sdata4    : addressValue = (int32_t)GetU32(offset_ptr);   break;
-    case DW_GNU_EH_PE_sdata8    : addressValue = (int64_t)GetU64(offset_ptr);   break;
+    case DW_EH_PE_uleb128   : addressValue = GetULEB128(offset_ptr);        break;
+    case DW_EH_PE_udata2    : addressValue = GetU16(offset_ptr);            break;
+    case DW_EH_PE_udata4    : addressValue = GetU32(offset_ptr);            break;
+    case DW_EH_PE_udata8    : addressValue = GetU64(offset_ptr);            break;
+    case DW_EH_PE_sleb128   : addressValue = GetSLEB128(offset_ptr);        break;
+    case DW_EH_PE_sdata2    : addressValue = (int16_t)GetU16(offset_ptr);   break;
+    case DW_EH_PE_sdata4    : addressValue = (int32_t)GetU32(offset_ptr);   break;
+    case DW_EH_PE_sdata8    : addressValue = (int64_t)GetU64(offset_ptr);   break;
     default:
     // Unhandled encoding type
     assert(eh_ptr_enc);

Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Tue Jul  6 17:38:03 2010
@@ -9,7 +9,6 @@
 
 #include "lldb/Core/ValueObjectChild.h"
 
-#include "lldb/Core/dwarf.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/ValueObjectList.h"
 

Modified: lldb/trunk/source/Expression/ClangExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpression.cpp?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpression.cpp Tue Jul  6 17:38:03 2010
@@ -67,7 +67,6 @@
 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/Mutex.h"
-#include "lldb/Core/dwarf.h"
 
 
 using namespace lldb_private;

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Jul  6 17:38:03 2010
@@ -572,7 +572,7 @@
         if (symtab_load_command.cmd == LC_SYMTAB)
         {
             // Read in the rest of the symtab load command
-            if (m_data.GetU32(&offset, &symtab_load_command.symoff, 4))
+            if (m_data.GetU32(&offset, &symtab_load_command.symoff, 4)) // fill in symoff, nsyms, stroff, strsize fields
             {
                 Symtab *symtab = m_symtab_ap.get();
                 SectionList *section_list = GetSectionList();
@@ -673,7 +673,7 @@
                             type = eSymbolTypeFunction;
                             break;
 
-                        case N_FUN:                                         // procedure: name,,n_sect,linenumber,address
+                        case N_FUN:                                       // procedure: name,,n_sect,linenumber,address
                             if (symbol_name)
                             {
                                 type = eSymbolTypeFunction;
@@ -692,7 +692,7 @@
                                     // to hunt for it later
                                     symtab->SymbolAtIndex(N_FUN_indexes.back())->SetByteSize(nlist.n_value);
                                     N_FUN_indexes.pop_back();
-                                    // We dont' really need the end function STAB as it contains the size which
+                                    // We don't really need the end function STAB as it contains the size which
                                     // we already placed with the original symbol, so don't add it if we want a
                                     // minimal symbol table
                                     if (minimize)

Removed: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c?rev=107715&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c (removed)
@@ -1,2224 +0,0 @@
-//===-- DWARFDefines.c ------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DWARFDefines.h"
-#include <stdio.h>
-
-#define DW_TAG_PREFIX   "TAG_"
-#define DW_AT_PREFIX    " AT_"
-#define DW_FORM_PREFIX  "FORM_"
-
-/* [7.5.4] Figure 16 "Tag Encodings" (pp. 125-127) in DWARFv3 draft 8 */
-
-const char *
-DW_TAG_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0000: return DW_TAG_PREFIX "NULL";
-    case 0x0001: return DW_TAG_PREFIX "array_type";
-    case 0x0002: return DW_TAG_PREFIX "class_type";
-    case 0x0003: return DW_TAG_PREFIX "entry_point";
-    case 0x0004: return DW_TAG_PREFIX "enumeration_type";
-    case 0x0005: return DW_TAG_PREFIX "formal_parameter";
-    case 0x0008: return DW_TAG_PREFIX "imported_declaration";
-    case 0x000a: return DW_TAG_PREFIX "label";
-    case 0x000b: return DW_TAG_PREFIX "lexical_block";
-    case 0x000d: return DW_TAG_PREFIX "member";
-    case 0x000f: return DW_TAG_PREFIX "pointer_type";
-    case 0x0010: return DW_TAG_PREFIX "reference_type";
-    case 0x0011: return DW_TAG_PREFIX "compile_unit";
-    case 0x0012: return DW_TAG_PREFIX "string_type";
-    case 0x0013: return DW_TAG_PREFIX "structure_type";
-    case 0x0015: return DW_TAG_PREFIX "subroutine_type";
-    case 0x0016: return DW_TAG_PREFIX "typedef";
-    case 0x0017: return DW_TAG_PREFIX "union_type";
-    case 0x0018: return DW_TAG_PREFIX "unspecified_parameters";
-    case 0x0019: return DW_TAG_PREFIX "variant";
-    case 0x001a: return DW_TAG_PREFIX "common_block";
-    case 0x001b: return DW_TAG_PREFIX "common_inclusion";
-    case 0x001c: return DW_TAG_PREFIX "inheritance";
-    case 0x001d: return DW_TAG_PREFIX "inlined_subroutine";
-    case 0x001e: return DW_TAG_PREFIX "module";
-    case 0x001f: return DW_TAG_PREFIX "ptr_to_member_type";
-    case 0x0020: return DW_TAG_PREFIX "set_type";
-    case 0x0021: return DW_TAG_PREFIX "subrange_type";
-    case 0x0022: return DW_TAG_PREFIX "with_stmt";
-    case 0x0023: return DW_TAG_PREFIX "access_declaration";
-    case 0x0024: return DW_TAG_PREFIX "base_type";
-    case 0x0025: return DW_TAG_PREFIX "catch_block";
-    case 0x0026: return DW_TAG_PREFIX "const_type";
-    case 0x0027: return DW_TAG_PREFIX "constant";
-    case 0x0028: return DW_TAG_PREFIX "enumerator";
-    case 0x0029: return DW_TAG_PREFIX "file_type";
-    case 0x002a: return DW_TAG_PREFIX "friend";
-    case 0x002b: return DW_TAG_PREFIX "namelist";
-    case 0x002c: return DW_TAG_PREFIX "namelist_item";
-    case 0x002d: return DW_TAG_PREFIX "packed_type";
-    case 0x002e: return DW_TAG_PREFIX "subprogram";
-    case 0x002f: return DW_TAG_PREFIX "template_type_parameter";
-    case 0x0030: return DW_TAG_PREFIX "template_value_parameter";
-    case 0x0031: return DW_TAG_PREFIX "thrown_type";
-    case 0x0032: return DW_TAG_PREFIX "try_block";
-    case 0x0033: return DW_TAG_PREFIX "variant_part";
-    case 0x0034: return DW_TAG_PREFIX "variable";
-    case 0x0035: return DW_TAG_PREFIX "volatile_type";
-    case 0x0036: return DW_TAG_PREFIX "dwarf_procedure";
-    case 0x0037: return DW_TAG_PREFIX "restrict_type";
-    case 0x0038: return DW_TAG_PREFIX "interface_type";
-    case 0x0039: return DW_TAG_PREFIX "namespace";
-    case 0x003a: return DW_TAG_PREFIX "imported_module";
-    case 0x003b: return DW_TAG_PREFIX "unspecified_type";
-    case 0x003c: return DW_TAG_PREFIX "partial_unit";
-    case 0x003d: return DW_TAG_PREFIX "imported_unit";
-//  case 0x003d: return DW_TAG_PREFIX "condition";
-    case 0x0040: return DW_TAG_PREFIX "shared_type";
-    case 0x4080: return DW_TAG_PREFIX "lo_user";
-    case 0xffff: return DW_TAG_PREFIX "hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_TAG constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_TAG_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0001: return "array type";
-    case 0x0002: return "class type";
-    case 0x0003: return "entry point";
-    case 0x0004: return "enumeration type";
-    case 0x0005: return "formal parameter";
-    case 0x0008: return "imported declaration";
-    case 0x000a: return "label";
-    case 0x000b: return "lexical block";
-    case 0x000d: return "member";
-    case 0x000f: return "pointer type";
-    case 0x0010: return "reference type";
-    case 0x0011: return "file";
-    case 0x0012: return "string type";
-    case 0x0013: return "structure type";
-    case 0x0015: return "subroutine type";
-    case 0x0016: return "typedef";
-    case 0x0017: return "union type";
-    case 0x0018: return "unspecified parameters";
-    case 0x0019: return "variant";
-    case 0x001a: return "common block";
-    case 0x001b: return "common inclusion";
-    case 0x001c: return "inheritance";
-    case 0x001d: return "inlined subroutine";
-    case 0x001e: return "module";
-    case 0x001f: return "ptr to member type";
-    case 0x0020: return "set type";
-    case 0x0021: return "subrange type";
-    case 0x0022: return "with stmt";
-    case 0x0023: return "access declaration";
-    case 0x0024: return "base type";
-    case 0x0025: return "catch block";
-    case 0x0026: return "const type";
-    case 0x0027: return "constant";
-    case 0x0028: return "enumerator";
-    case 0x0029: return "file type";
-    case 0x002a: return "friend";
-    case 0x002b: return "namelist";
-    case 0x002c: return "namelist item";
-    case 0x002d: return "packed type";
-    case 0x002e: return "function";
-    case 0x002f: return "template type parameter";
-    case 0x0030: return "template value parameter";
-    case 0x0031: return "thrown type";
-    case 0x0032: return "try block";
-    case 0x0033: return "variant part";
-    case 0x0034: return "variable";
-    case 0x0035: return "volatile type";
-    case 0x0036: return "dwarf procedure";
-    case 0x0037: return "restrict type";
-    case 0x0038: return "interface type";
-    case 0x0039: return "namespace";
-    case 0x003a: return "imported module";
-    case 0x003b: return "unspecified type";
-    case 0x003c: return "partial unit";
-    case 0x003d: return "imported unit";
-//  case 0x003d: return "condition";
-    case 0x0040: return "shared type";
-    case 0x4080: return "lo user";
-    case 0xffff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_TAG constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_TAG_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0001: return 0;
-    case 0x0002: return 0;
-    case 0x0003: return 0;
-    case 0x0004: return 0;
-    case 0x0005: return 0;
-    case 0x0008: return 0;
-    case 0x000a: return 0;
-    case 0x000b: return 0;
-    case 0x000d: return 0;
-    case 0x000f: return 0;
-    case 0x0010: return 0;
-    case 0x0011: return 0;
-    case 0x0012: return 0;
-    case 0x0013: return 0;
-    case 0x0015: return 0;
-    case 0x0016: return 0;
-    case 0x0017: return 0;
-    case 0x0018: return 0;
-    case 0x0019: return 0;
-    case 0x001a: return 0;
-    case 0x001b: return 0;
-    case 0x001c: return 0;
-    case 0x001d: return 0;
-    case 0x001e: return 0;
-    case 0x001f: return 0;
-    case 0x0020: return 0;
-    case 0x0021: return 0;
-    case 0x0022: return 0;
-    case 0x0023: return 0;
-    case 0x0024: return 0;
-    case 0x0025: return 0;
-    case 0x0026: return 0;
-    case 0x0027: return 0;
-    case 0x0028: return 0;
-    case 0x0029: return 0;
-    case 0x002a: return 0;
-    case 0x002b: return 0;
-    case 0x002c: return 0;
-    case 0x002d: return 0;
-    case 0x002e: return 0;
-    case 0x002f: return 0;
-    case 0x0030: return 0;
-    case 0x0031: return 0;
-    case 0x0032: return 0;
-    case 0x0033: return 0;
-    case 0x0034: return 0;
-    case 0x0035: return 0;
-    case 0x0036: return DRC_DWARFv3;
-    case 0x0037: return DRC_DWARFv3;
-    case 0x0038: return DRC_DWARFv3;
-    case 0x0039: return DRC_DWARFv3;
-    case 0x003a: return DRC_DWARFv3;
-    case 0x003b: return DRC_DWARFv3;
-    case 0x003c: return DRC_DWARFv3;
-    case 0x003d: return DRC_DWARFv3;
-//  case 0x003d: return DRC_DWARFv3;
-    case 0x0040: return DRC_DWARFv3;
-    case 0x4080: return 0;
-    case 0xffff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.5.4] Figure 17 "Child determination encodings" (p. 128) in DWARFv3 draft 8 */
-
-const char *
-DW_CHILDREN_value_to_name (uint8_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_CHILDREN_no";
-    case 0x1: return "DW_CHILDREN_yes";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CHILDREN constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_CHILDREN_value_to_englishy_name (uint8_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "no";
-    case 0x1: return "yes";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CHILDREN constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_CHILDREN_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.5.4] Figure 18 "Attribute encodings" (pp. 129-132) in DWARFv3 draft 8 */
-
-const char *
-DW_AT_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0001: return DW_AT_PREFIX "sibling";
-    case 0x0002: return DW_AT_PREFIX "location";
-    case 0x0003: return DW_AT_PREFIX "name";
-    case 0x0009: return DW_AT_PREFIX "ordering";
-    case 0x000b: return DW_AT_PREFIX "byte_size";
-    case 0x000c: return DW_AT_PREFIX "bit_offset";
-    case 0x000d: return DW_AT_PREFIX "bit_size";
-    case 0x0010: return DW_AT_PREFIX "stmt_list";
-    case 0x0011: return DW_AT_PREFIX "low_pc";
-    case 0x0012: return DW_AT_PREFIX "high_pc";
-    case 0x0013: return DW_AT_PREFIX "language";
-    case 0x0015: return DW_AT_PREFIX "discr";
-    case 0x0016: return DW_AT_PREFIX "discr_value";
-    case 0x0017: return DW_AT_PREFIX "visibility";
-    case 0x0018: return DW_AT_PREFIX "import";
-    case 0x0019: return DW_AT_PREFIX "string_length";
-    case 0x001a: return DW_AT_PREFIX "common_reference";
-    case 0x001b: return DW_AT_PREFIX "comp_dir";
-    case 0x001c: return DW_AT_PREFIX "const_value";
-    case 0x001d: return DW_AT_PREFIX "containing_type";
-    case 0x001e: return DW_AT_PREFIX "default_value";
-    case 0x0020: return DW_AT_PREFIX "inline";
-    case 0x0021: return DW_AT_PREFIX "is_optional";
-    case 0x0022: return DW_AT_PREFIX "lower_bound";
-    case 0x0025: return DW_AT_PREFIX "producer";
-    case 0x0027: return DW_AT_PREFIX "prototyped";
-    case 0x002a: return DW_AT_PREFIX "return_addr";
-    case 0x002c: return DW_AT_PREFIX "start_scope";
-    case 0x002e: return DW_AT_PREFIX "bit_stride";
-    case 0x002f: return DW_AT_PREFIX "upper_bound";
-    case 0x0031: return DW_AT_PREFIX "abstract_origin";
-    case 0x0032: return DW_AT_PREFIX "accessibility";
-    case 0x0033: return DW_AT_PREFIX "address_class";
-    case 0x0034: return DW_AT_PREFIX "artificial";
-    case 0x0035: return DW_AT_PREFIX "base_types";
-    case 0x0036: return DW_AT_PREFIX "calling_convention";
-    case 0x0037: return DW_AT_PREFIX "count";
-    case 0x0038: return DW_AT_PREFIX "data_member_location";
-    case 0x0039: return DW_AT_PREFIX "decl_column";
-    case 0x003a: return DW_AT_PREFIX "decl_file";
-    case 0x003b: return DW_AT_PREFIX "decl_line";
-    case 0x003c: return DW_AT_PREFIX "declaration";
-    case 0x003d: return DW_AT_PREFIX "discr_list";
-    case 0x003e: return DW_AT_PREFIX "encoding";
-    case 0x003f: return DW_AT_PREFIX "external";
-    case 0x0040: return DW_AT_PREFIX "frame_base";
-    case 0x0041: return DW_AT_PREFIX "friend";
-    case 0x0042: return DW_AT_PREFIX "identifier_case";
-    case 0x0043: return DW_AT_PREFIX "macro_info";
-    case 0x0044: return DW_AT_PREFIX "namelist_item";
-    case 0x0045: return DW_AT_PREFIX "priority";
-    case 0x0046: return DW_AT_PREFIX "segment";
-    case 0x0047: return DW_AT_PREFIX "specification";
-    case 0x0048: return DW_AT_PREFIX "static_link";
-    case 0x0049: return DW_AT_PREFIX "type";
-    case 0x004a: return DW_AT_PREFIX "use_location";
-    case 0x004b: return DW_AT_PREFIX "variable_parameter";
-    case 0x004c: return DW_AT_PREFIX "virtuality";
-    case 0x004d: return DW_AT_PREFIX "vtable_elem_location";
-    case 0x004e: return DW_AT_PREFIX "allocated";
-    case 0x004f: return DW_AT_PREFIX "associated";
-    case 0x0050: return DW_AT_PREFIX "data_location";
-    case 0x0051: return DW_AT_PREFIX "byte_stride";
-    case 0x0052: return DW_AT_PREFIX "entry_pc";
-    case 0x0053: return DW_AT_PREFIX "use_UTF8";
-    case 0x0054: return DW_AT_PREFIX "extension";
-    case 0x0055: return DW_AT_PREFIX "ranges";
-    case 0x0056: return DW_AT_PREFIX "trampoline";
-    case 0x0057: return DW_AT_PREFIX "call_column";
-    case 0x0058: return DW_AT_PREFIX "call_file";
-    case 0x0059: return DW_AT_PREFIX "call_line";
-    case 0x005a: return DW_AT_PREFIX "description";
-    case 0x005b: return DW_AT_PREFIX "binary_scale";
-    case 0x005c: return DW_AT_PREFIX "decimal_scale";
-    case 0x005d: return DW_AT_PREFIX "small";
-    case 0x005e: return DW_AT_PREFIX "decimal_sign";
-    case 0x005f: return DW_AT_PREFIX "digit_count";
-    case 0x0060: return DW_AT_PREFIX "picture_string";
-    case 0x0061: return DW_AT_PREFIX "mutable";
-    case 0x0062: return DW_AT_PREFIX "threads_scaled";
-    case 0x0063: return DW_AT_PREFIX "explicit";
-    case 0x0064: return DW_AT_PREFIX "object_pointer";
-    case 0x0065: return DW_AT_PREFIX "endianity";
-    case 0x0066: return DW_AT_PREFIX "elemental";
-    case 0x0067: return DW_AT_PREFIX "pure";
-    case 0x0068: return DW_AT_PREFIX "recursive";
-    case 0x2000: return DW_AT_PREFIX "lo_user";
-    case 0x3fff: return DW_AT_PREFIX "hi_user";
-    case 0x2001: return DW_AT_PREFIX "MIPS_fde";
-    case 0x2002: return DW_AT_PREFIX "MIPS_loop_begin";
-    case 0x2003: return DW_AT_PREFIX "MIPS_tail_loop_begin";
-    case 0x2004: return DW_AT_PREFIX "MIPS_epilog_begin";
-    case 0x2005: return DW_AT_PREFIX "MIPS_loop_unroll_factor";
-    case 0x2006: return DW_AT_PREFIX "MIPS_software_pipeline_depth";
-    case 0x2007: return DW_AT_PREFIX "MIPS_linkage_name";
-    case 0x2008: return DW_AT_PREFIX "MIPS_stride";
-    case 0x2009: return DW_AT_PREFIX "MIPS_abstract_name";
-    case 0x200a: return DW_AT_PREFIX "MIPS_clone_origin";
-    case 0x200b: return DW_AT_PREFIX "MIPS_has_inlines";
-    case 0x2101: return DW_AT_PREFIX "sf_names";
-    case 0x2102: return DW_AT_PREFIX "src_info";
-    case 0x2103: return DW_AT_PREFIX "mac_info";
-    case 0x2104: return DW_AT_PREFIX "src_coords";
-    case 0x2105: return DW_AT_PREFIX "body_begin";
-    case 0x2106: return DW_AT_PREFIX "body_end";
-    case 0x2107: return DW_AT_PREFIX "GNU_vector";
-    case 0x2501: return DW_AT_PREFIX "APPLE_repository_file";
-    case 0x2502: return DW_AT_PREFIX "APPLE_repository_type";
-    case 0x2503: return DW_AT_PREFIX "APPLE_repository_name";
-    case 0x2504: return DW_AT_PREFIX "APPLE_repository_specification";
-    case 0x2505: return DW_AT_PREFIX "APPLE_repository_import";
-    case 0x2506: return DW_AT_PREFIX "APPLE_repository_abstract_origin";
-    case DW_AT_APPLE_flags: return DW_AT_PREFIX "APPLE_flags";
-    case DW_AT_APPLE_optimized: return DW_AT_PREFIX "APPLE_optimized";
-    case DW_AT_APPLE_isa: return DW_AT_PREFIX "APPLE_isa";
-    case DW_AT_APPLE_block: return DW_AT_PREFIX "APPLE_block";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_AT constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_AT_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0001: return "sibling";
-    case 0x0002: return "location";
-    case 0x0003: return "name";
-    case 0x0009: return "ordering";
-    case 0x000b: return "byte size";
-    case 0x000c: return "bit offset";
-    case 0x000d: return "bit size";
-    case 0x0010: return "stmt list";
-    case 0x0011: return "low pc";
-    case 0x0012: return "high pc";
-    case 0x0013: return "language";
-    case 0x0015: return "discr";
-    case 0x0016: return "discr value";
-    case 0x0017: return "visibility";
-    case 0x0018: return "import";
-    case 0x0019: return "string length";
-    case 0x001a: return "common reference";
-    case 0x001b: return "comp dir";
-    case 0x001c: return "const value";
-    case 0x001d: return "containing type";
-    case 0x001e: return "default value";
-    case 0x0020: return "inline";
-    case 0x0021: return "is optional";
-    case 0x0022: return "lower bound";
-    case 0x0025: return "producer";
-    case 0x0027: return "prototyped";
-    case 0x002a: return "return addr";
-    case 0x002c: return "start scope";
-    case 0x002e: return "bit stride";
-    case 0x002f: return "upper bound";
-    case 0x0031: return "abstract origin";
-    case 0x0032: return "accessibility";
-    case 0x0033: return "address class";
-    case 0x0034: return "artificial";
-    case 0x0035: return "base types";
-    case 0x0036: return "calling convention";
-    case 0x0037: return "count";
-    case 0x0038: return "data member location";
-    case 0x0039: return "decl column";
-    case 0x003a: return "decl file";
-    case 0x003b: return "decl line";
-    case 0x003c: return "declaration";
-    case 0x003d: return "discr list";
-    case 0x003e: return "encoding";
-    case 0x003f: return "external";
-    case 0x0040: return "frame base";
-    case 0x0041: return "friend";
-    case 0x0042: return "identifier case";
-    case 0x0043: return "macro info";
-    case 0x0044: return "namelist item";
-    case 0x0045: return "priority";
-    case 0x0046: return "segment";
-    case 0x0047: return "specification";
-    case 0x0048: return "static link";
-    case 0x0049: return "type";
-    case 0x004a: return "use location";
-    case 0x004b: return "variable parameter";
-    case 0x004c: return "virtuality";
-    case 0x004d: return "vtable elem location";
-    case 0x004e: return "allocated";
-    case 0x004f: return "associated";
-    case 0x0050: return "data location";
-    case 0x0051: return "byte stride";
-    case 0x0052: return "entry pc";
-    case 0x0053: return "use UTF8";
-    case 0x0054: return "extension";
-    case 0x0055: return "ranges";
-    case 0x0056: return "trampoline";
-    case 0x0057: return "call column";
-    case 0x0058: return "call file";
-    case 0x0059: return "call line";
-    case 0x005a: return "description";
-    case 0x005b: return "binary scale";
-    case 0x005c: return "decimal scale";
-    case 0x005d: return "small";
-    case 0x005e: return "decimal sign";
-    case 0x005f: return "digit count";
-    case 0x0060: return "picture string";
-    case 0x0061: return "mutable";
-    case 0x0062: return "threads scaled";
-    case 0x0063: return "explicit";
-    case 0x0064: return "object pointer";
-    case 0x0065: return "endianity";
-    case 0x0066: return "elemental";
-    case 0x0067: return "pure";
-    case 0x0068: return "recursive";
-    case 0x2000: return "lo user";
-    case 0x3fff: return "hi user";
-    case 0x2001: return "MIPS fde";
-    case 0x2002: return "MIPS loop begin";
-    case 0x2003: return "MIPS tail loop begin";
-    case 0x2004: return "MIPS epilog begin";
-    case 0x2005: return "MIPS loop unroll factor";
-    case 0x2006: return "MIPS software pipeline depth";
-    case 0x2007: return "MIPS linkage name";
-    case 0x2008: return "MIPS stride";
-    case 0x2009: return "MIPS abstract name";
-    case 0x200a: return "MIPS clone origin";
-    case 0x200b: return "MIPS has inlines";
-    case 0x2101: return "source file names";
-    case 0x2102: return "source info";
-    case 0x2103: return "macro info";
-    case 0x2104: return "source coordinates";
-    case 0x2105: return "body begin";
-    case 0x2106: return "body end";
-    case 0x2107: return "GNU vector";
-    case 0x2501: return "repository file";
-    case 0x2502: return "repository type";
-    case 0x2503: return "repository name";
-    case 0x2504: return "repository specification";
-    case 0x2505: return "repository import";
-    case 0x2506: return "repository abstract origin";
-    case DW_AT_APPLE_flags: return "Apple gcc compiler flags";
-    case DW_AT_APPLE_optimized: return "APPLE optimized";
-    case DW_AT_APPLE_isa: return "APPLE instruction set architecture";
-    case DW_AT_APPLE_block: return "APPLE block";
-   default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_AT constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_AT_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0001: return DRC_REFERENCE;
-    case 0x0002: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0003: return DRC_STRING;
-    case 0x0009: return DRC_CONSTANT;
-    case 0x000b: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x000c: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x000d: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0010: return DRC_LINEPTR;
-    case 0x0011: return DRC_ADDRESS;
-    case 0x0012: return DRC_ADDRESS;
-    case 0x0013: return DRC_CONSTANT;
-    case 0x0015: return DRC_REFERENCE;
-    case 0x0016: return DRC_CONSTANT;
-    case 0x0017: return DRC_CONSTANT;
-    case 0x0018: return DRC_REFERENCE;
-    case 0x0019: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x001a: return DRC_REFERENCE;
-    case 0x001b: return DRC_STRING;
-    case 0x001c: return DRC_BLOCK | DRC_CONSTANT | DRC_STRING;
-    case 0x001d: return DRC_REFERENCE;
-    case 0x001e: return DRC_REFERENCE;
-    case 0x0020: return DRC_CONSTANT;
-    case 0x0021: return DRC_FLAG;
-    case 0x0022: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0025: return DRC_STRING;
-    case 0x0027: return DRC_FLAG;
-    case 0x002a: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x002c: return DRC_CONSTANT;
-    case 0x002e: return DRC_CONSTANT;
-    case 0x002f: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0031: return DRC_REFERENCE;
-    case 0x0032: return DRC_CONSTANT;
-    case 0x0033: return DRC_CONSTANT;
-    case 0x0034: return DRC_FLAG;
-    case 0x0035: return DRC_REFERENCE;
-    case 0x0036: return DRC_CONSTANT;
-    case 0x0037: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0038: return DRC_BLOCK | DRC_CONSTANT | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0039: return DRC_CONSTANT;
-    case 0x003a: return DRC_CONSTANT;
-    case 0x003b: return DRC_CONSTANT;
-    case 0x003c: return DRC_FLAG;
-    case 0x003d: return DRC_BLOCK;
-    case 0x003e: return DRC_CONSTANT;
-    case 0x003f: return DRC_FLAG;
-    case 0x0040: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0041: return DRC_REFERENCE;
-    case 0x0042: return DRC_CONSTANT;
-    case 0x0043: return DRC_MACPTR;
-    case 0x0044: return DRC_BLOCK;
-    case 0x0045: return DRC_REFERENCE;
-    case 0x0046: return DRC_BLOCK | DRC_CONSTANT;
-    case 0x0047: return DRC_REFERENCE;
-    case 0x0048: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0049: return DRC_REFERENCE;
-    case 0x004a: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x004b: return DRC_FLAG;
-    case 0x004c: return DRC_CONSTANT;
-    case 0x004d: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x004e: return DRC_BLOCK | DRC_CONSTANT | DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x004f: return DRC_BLOCK | DRC_CONSTANT | DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0050: return DRC_BLOCK | DRC_DWARFv3;
-    case 0x0051: return DRC_BLOCK | DRC_CONSTANT | DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0052: return DRC_ADDRESS | DRC_DWARFv3;
-    case 0x0053: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0054: return DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0055: return DRC_DWARFv3 | DRC_RANGELISTPTR;
-    case 0x0056: return DRC_ADDRESS | DRC_DWARFv3 | DRC_FLAG | DRC_REFERENCE | DRC_STRING;
-    case 0x0057: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0058: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0059: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005a: return DRC_DWARFv3 | DRC_STRING;
-    case 0x005b: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005c: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005d: return DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x005e: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005f: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0060: return DRC_DWARFv3 | DRC_STRING;
-    case 0x0061: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0062: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0063: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0064: return DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0065: return DRC_0x65 | DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0066: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0067: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0068: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x2000: return 0;
-    case 0x3fff: return 0;
-    case 0x2001: return DRC_VENDOR_MIPS;
-    case 0x2002: return DRC_VENDOR_MIPS;
-    case 0x2003: return DRC_VENDOR_MIPS;
-    case 0x2004: return DRC_VENDOR_MIPS;
-    case 0x2005: return DRC_VENDOR_MIPS;
-    case 0x2006: return DRC_VENDOR_MIPS;
-    case 0x2007: return DRC_STRING | DRC_VENDOR_MIPS;
-    case 0x2008: return DRC_VENDOR_MIPS;
-    case 0x2009: return DRC_VENDOR_MIPS;
-    case 0x200a: return DRC_VENDOR_MIPS;
-    case 0x200b: return DRC_VENDOR_MIPS;
-    default: return 0;
-  }
-}
-
-/* [7.5.4] Figure 19 "Attribute form encodings" (pp. 133-134) in DWARFv3 draft 8 */
-
-const char *
-DW_FORM_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return DW_FORM_PREFIX "addr";
-    case 0x03: return DW_FORM_PREFIX "block2";
-    case 0x04: return DW_FORM_PREFIX "block4";
-    case 0x05: return DW_FORM_PREFIX "data2";
-    case 0x06: return DW_FORM_PREFIX "data4";
-    case 0x07: return DW_FORM_PREFIX "data8";
-    case 0x08: return DW_FORM_PREFIX "string";
-    case 0x09: return DW_FORM_PREFIX "block";
-    case 0x0a: return DW_FORM_PREFIX "block1";
-    case 0x0b: return DW_FORM_PREFIX "data1";
-    case 0x0c: return DW_FORM_PREFIX "flag";
-    case 0x0d: return DW_FORM_PREFIX "sdata";
-    case 0x0e: return DW_FORM_PREFIX "strp";
-    case 0x0f: return DW_FORM_PREFIX "udata";
-    case 0x10: return DW_FORM_PREFIX "ref_addr";
-    case 0x11: return DW_FORM_PREFIX "ref1";
-    case 0x12: return DW_FORM_PREFIX "ref2";
-    case 0x13: return DW_FORM_PREFIX "ref4";
-    case 0x14: return DW_FORM_PREFIX "ref8";
-    case 0x15: return DW_FORM_PREFIX "ref_udata";
-    case 0x16: return DW_FORM_PREFIX "indirect";
-//  case DW_FORM_APPLE_db_str: return DW_FORM_PREFIX "APPLE_db_str";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_FORM constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_FORM_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "addr";
-    case 0x03: return "block2";
-    case 0x04: return "block4";
-    case 0x05: return "data2";
-    case 0x06: return "data4";
-    case 0x07: return "data8";
-    case 0x08: return "string";
-    case 0x09: return "block";
-    case 0x0a: return "block1";
-    case 0x0b: return "data1";
-    case 0x0c: return "flag";
-    case 0x0d: return "sdata";
-    case 0x0e: return "strp";
-    case 0x0f: return "udata";
-    case 0x10: return "ref addr";
-    case 0x11: return "ref1";
-    case 0x12: return "ref2";
-    case 0x13: return "ref4";
-    case 0x14: return "ref8";
-    case 0x15: return "ref udata";
-    case 0x16: return "indirect";
-//  case DW_FORM_APPLE_db_str: return "repository str";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_FORM constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_FORM_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return DRC_ADDRESS;
-    case 0x03: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x04: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x05: return DRC_CONSTANT;
-    case 0x06: return DRC_CONSTANT | DRC_LINEPTR | DRC_LOCLISTPTR | DRC_MACPTR | DRC_RANGELISTPTR;
-    case 0x07: return DRC_CONSTANT | DRC_LINEPTR | DRC_LOCLISTPTR | DRC_MACPTR | DRC_RANGELISTPTR;
-    case 0x08: return DRC_STRING;
-    case 0x09: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x0a: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x0b: return DRC_CONSTANT;
-    case 0x0c: return DRC_FLAG;
-    case 0x0d: return DRC_CONSTANT;
-    case 0x0e: return DRC_STRING;
-    case 0x0f: return DRC_CONSTANT;
-    case 0x10: return DRC_REFERENCE;
-    case 0x11: return DRC_REFERENCE;
-    case 0x12: return DRC_REFERENCE;
-    case 0x13: return DRC_REFERENCE;
-    case 0x14: return DRC_REFERENCE;
-    case 0x15: return DRC_REFERENCE;
-    case 0x16: return DRC_INDIRECT_SPECIAL;
-    default: return 0;
-  }
-}
-
-/* [7.7.1] Figure 22 "DWARF operation encodings" (pp. 136-139) in DWARFv3 draft 8 */
-
-const char *
-DW_OP_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x03: return "DW_OP_addr";
-    case 0x06: return "DW_OP_deref";
-    case 0x08: return "DW_OP_const1u";
-    case 0x09: return "DW_OP_const1s";
-    case 0x0a: return "DW_OP_const2u";
-    case 0x0b: return "DW_OP_const2s";
-    case 0x0c: return "DW_OP_const4u";
-    case 0x0d: return "DW_OP_const4s";
-    case 0x0e: return "DW_OP_const8u";
-    case 0x0f: return "DW_OP_const8s";
-    case 0x10: return "DW_OP_constu";
-    case 0x11: return "DW_OP_consts";
-    case 0x12: return "DW_OP_dup";
-    case 0x13: return "DW_OP_drop";
-    case 0x14: return "DW_OP_over";
-    case 0x15: return "DW_OP_pick";
-    case 0x16: return "DW_OP_swap";
-    case 0x17: return "DW_OP_rot";
-    case 0x18: return "DW_OP_xderef";
-    case 0x19: return "DW_OP_abs";
-    case 0x1a: return "DW_OP_and";
-    case 0x1b: return "DW_OP_div";
-    case 0x1c: return "DW_OP_minus";
-    case 0x1d: return "DW_OP_mod";
-    case 0x1e: return "DW_OP_mul";
-    case 0x1f: return "DW_OP_neg";
-    case 0x20: return "DW_OP_not";
-    case 0x21: return "DW_OP_or";
-    case 0x22: return "DW_OP_plus";
-    case 0x23: return "DW_OP_plus_uconst";
-    case 0x24: return "DW_OP_shl";
-    case 0x25: return "DW_OP_shr";
-    case 0x26: return "DW_OP_shra";
-    case 0x27: return "DW_OP_xor";
-    case 0x2f: return "DW_OP_skip";
-    case 0x28: return "DW_OP_bra";
-    case 0x29: return "DW_OP_eq";
-    case 0x2a: return "DW_OP_ge";
-    case 0x2b: return "DW_OP_gt";
-    case 0x2c: return "DW_OP_le";
-    case 0x2d: return "DW_OP_lt";
-    case 0x2e: return "DW_OP_ne";
-    case 0x30: return "DW_OP_lit0";
-    case 0x31: return "DW_OP_lit1";
-    case 0x32: return "DW_OP_lit2";
-    case 0x33: return "DW_OP_lit3";
-    case 0x34: return "DW_OP_lit4";
-    case 0x35: return "DW_OP_lit5";
-    case 0x36: return "DW_OP_lit6";
-    case 0x37: return "DW_OP_lit7";
-    case 0x38: return "DW_OP_lit8";
-    case 0x39: return "DW_OP_lit9";
-    case 0x3a: return "DW_OP_lit10";
-    case 0x3b: return "DW_OP_lit11";
-    case 0x3c: return "DW_OP_lit12";
-    case 0x3d: return "DW_OP_lit13";
-    case 0x3e: return "DW_OP_lit14";
-    case 0x3f: return "DW_OP_lit15";
-    case 0x40: return "DW_OP_lit16";
-    case 0x41: return "DW_OP_lit17";
-    case 0x42: return "DW_OP_lit18";
-    case 0x43: return "DW_OP_lit19";
-    case 0x44: return "DW_OP_lit20";
-    case 0x45: return "DW_OP_lit21";
-    case 0x46: return "DW_OP_lit22";
-    case 0x47: return "DW_OP_lit23";
-    case 0x48: return "DW_OP_lit24";
-    case 0x49: return "DW_OP_lit25";
-    case 0x4a: return "DW_OP_lit26";
-    case 0x4b: return "DW_OP_lit27";
-    case 0x4c: return "DW_OP_lit28";
-    case 0x4d: return "DW_OP_lit29";
-    case 0x4e: return "DW_OP_lit30";
-    case 0x4f: return "DW_OP_lit31";
-    case 0x50: return "DW_OP_reg0";
-    case 0x51: return "DW_OP_reg1";
-    case 0x52: return "DW_OP_reg2";
-    case 0x53: return "DW_OP_reg3";
-    case 0x54: return "DW_OP_reg4";
-    case 0x55: return "DW_OP_reg5";
-    case 0x56: return "DW_OP_reg6";
-    case 0x57: return "DW_OP_reg7";
-    case 0x58: return "DW_OP_reg8";
-    case 0x59: return "DW_OP_reg9";
-    case 0x5a: return "DW_OP_reg10";
-    case 0x5b: return "DW_OP_reg11";
-    case 0x5c: return "DW_OP_reg12";
-    case 0x5d: return "DW_OP_reg13";
-    case 0x5e: return "DW_OP_reg14";
-    case 0x5f: return "DW_OP_reg15";
-    case 0x60: return "DW_OP_reg16";
-    case 0x61: return "DW_OP_reg17";
-    case 0x62: return "DW_OP_reg18";
-    case 0x63: return "DW_OP_reg19";
-    case 0x64: return "DW_OP_reg20";
-    case 0x65: return "DW_OP_reg21";
-    case 0x66: return "DW_OP_reg22";
-    case 0x67: return "DW_OP_reg23";
-    case 0x68: return "DW_OP_reg24";
-    case 0x69: return "DW_OP_reg25";
-    case 0x6a: return "DW_OP_reg26";
-    case 0x6b: return "DW_OP_reg27";
-    case 0x6c: return "DW_OP_reg28";
-    case 0x6d: return "DW_OP_reg29";
-    case 0x6e: return "DW_OP_reg30";
-    case 0x6f: return "DW_OP_reg31";
-    case 0x70: return "DW_OP_breg0";
-    case 0x71: return "DW_OP_breg1";
-    case 0x72: return "DW_OP_breg2";
-    case 0x73: return "DW_OP_breg3";
-    case 0x74: return "DW_OP_breg4";
-    case 0x75: return "DW_OP_breg5";
-    case 0x76: return "DW_OP_breg6";
-    case 0x77: return "DW_OP_breg7";
-    case 0x78: return "DW_OP_breg8";
-    case 0x79: return "DW_OP_breg9";
-    case 0x7a: return "DW_OP_breg10";
-    case 0x7b: return "DW_OP_breg11";
-    case 0x7c: return "DW_OP_breg12";
-    case 0x7d: return "DW_OP_breg13";
-    case 0x7e: return "DW_OP_breg14";
-    case 0x7f: return "DW_OP_breg15";
-    case 0x80: return "DW_OP_breg16";
-    case 0x81: return "DW_OP_breg17";
-    case 0x82: return "DW_OP_breg18";
-    case 0x83: return "DW_OP_breg19";
-    case 0x84: return "DW_OP_breg20";
-    case 0x85: return "DW_OP_breg21";
-    case 0x86: return "DW_OP_breg22";
-    case 0x87: return "DW_OP_breg23";
-    case 0x88: return "DW_OP_breg24";
-    case 0x89: return "DW_OP_breg25";
-    case 0x8a: return "DW_OP_breg26";
-    case 0x8b: return "DW_OP_breg27";
-    case 0x8c: return "DW_OP_breg28";
-    case 0x8d: return "DW_OP_breg29";
-    case 0x8e: return "DW_OP_breg30";
-    case 0x8f: return "DW_OP_breg31";
-    case 0x90: return "DW_OP_regx";
-    case 0x91: return "DW_OP_fbreg";
-    case 0x92: return "DW_OP_bregx";
-    case 0x93: return "DW_OP_piece";
-    case 0x94: return "DW_OP_deref_size";
-    case 0x95: return "DW_OP_xderef_size";
-    case 0x96: return "DW_OP_nop";
-    case 0x97: return "DW_OP_push_object_address";
-    case 0x98: return "DW_OP_call2";
-    case 0x99: return "DW_OP_call4";
-    case 0x9a: return "DW_OP_call_ref";
-    case 0xf0: return "DW_OP_APPLE_uninit";
-    case 0xe0: return "DW_OP_lo_user";
-    case 0xff: return "DW_OP_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_OP constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_OP_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x03: return "addr";
-    case 0x06: return "deref";
-    case 0x08: return "const1u";
-    case 0x09: return "const1s";
-    case 0x0a: return "const2u";
-    case 0x0b: return "const2s";
-    case 0x0c: return "const4u";
-    case 0x0d: return "const4s";
-    case 0x0e: return "const8u";
-    case 0x0f: return "const8s";
-    case 0x10: return "constu";
-    case 0x11: return "consts";
-    case 0x12: return "dup";
-    case 0x13: return "drop";
-    case 0x14: return "over";
-    case 0x15: return "pick";
-    case 0x16: return "swap";
-    case 0x17: return "rot";
-    case 0x18: return "xderef";
-    case 0x19: return "abs";
-    case 0x1a: return "and";
-    case 0x1b: return "div";
-    case 0x1c: return "minus";
-    case 0x1d: return "mod";
-    case 0x1e: return "mul";
-    case 0x1f: return "neg";
-    case 0x20: return "not";
-    case 0x21: return "or";
-    case 0x22: return "plus";
-    case 0x23: return "plus uconst";
-    case 0x24: return "shl";
-    case 0x25: return "shr";
-    case 0x26: return "shra";
-    case 0x27: return "xor";
-    case 0x2f: return "skip";
-    case 0x28: return "bra";
-    case 0x29: return "eq";
-    case 0x2a: return "ge";
-    case 0x2b: return "gt";
-    case 0x2c: return "le";
-    case 0x2d: return "lt";
-    case 0x2e: return "ne";
-    case 0x30: return "lit0";
-    case 0x31: return "lit1";
-    case 0x32: return "lit2";
-    case 0x33: return "lit3";
-    case 0x34: return "lit4";
-    case 0x35: return "lit5";
-    case 0x36: return "lit6";
-    case 0x37: return "lit7";
-    case 0x38: return "lit8";
-    case 0x39: return "lit9";
-    case 0x3a: return "lit10";
-    case 0x3b: return "lit11";
-    case 0x3c: return "lit12";
-    case 0x3d: return "lit13";
-    case 0x3e: return "lit14";
-    case 0x3f: return "lit15";
-    case 0x40: return "lit16";
-    case 0x41: return "lit17";
-    case 0x42: return "lit18";
-    case 0x43: return "lit19";
-    case 0x44: return "lit20";
-    case 0x45: return "lit21";
-    case 0x46: return "lit22";
-    case 0x47: return "lit23";
-    case 0x48: return "lit24";
-    case 0x49: return "lit25";
-    case 0x4a: return "lit26";
-    case 0x4b: return "lit27";
-    case 0x4c: return "lit28";
-    case 0x4d: return "lit29";
-    case 0x4e: return "lit30";
-    case 0x4f: return "lit31";
-    case 0x50: return "reg0";
-    case 0x51: return "reg1";
-    case 0x52: return "reg2";
-    case 0x53: return "reg3";
-    case 0x54: return "reg4";
-    case 0x55: return "reg5";
-    case 0x56: return "reg6";
-    case 0x57: return "reg7";
-    case 0x58: return "reg8";
-    case 0x59: return "reg9";
-    case 0x5a: return "reg10";
-    case 0x5b: return "reg11";
-    case 0x5c: return "reg12";
-    case 0x5d: return "reg13";
-    case 0x5e: return "reg14";
-    case 0x5f: return "reg15";
-    case 0x60: return "reg16";
-    case 0x61: return "reg17";
-    case 0x62: return "reg18";
-    case 0x63: return "reg19";
-    case 0x64: return "reg20";
-    case 0x65: return "reg21";
-    case 0x66: return "reg22";
-    case 0x67: return "reg23";
-    case 0x68: return "reg24";
-    case 0x69: return "reg25";
-    case 0x6a: return "reg26";
-    case 0x6b: return "reg27";
-    case 0x6c: return "reg28";
-    case 0x6d: return "reg29";
-    case 0x6e: return "reg30";
-    case 0x6f: return "reg31";
-    case 0x70: return "breg0";
-    case 0x71: return "breg1";
-    case 0x72: return "breg2";
-    case 0x73: return "breg3";
-    case 0x74: return "breg4";
-    case 0x75: return "breg5";
-    case 0x76: return "breg6";
-    case 0x77: return "breg7";
-    case 0x78: return "breg8";
-    case 0x79: return "breg9";
-    case 0x7a: return "breg10";
-    case 0x7b: return "breg11";
-    case 0x7c: return "breg12";
-    case 0x7d: return "breg13";
-    case 0x7e: return "breg14";
-    case 0x7f: return "breg15";
-    case 0x80: return "breg16";
-    case 0x81: return "breg17";
-    case 0x82: return "breg18";
-    case 0x83: return "breg19";
-    case 0x84: return "breg20";
-    case 0x85: return "breg21";
-    case 0x86: return "breg22";
-    case 0x87: return "breg23";
-    case 0x88: return "breg24";
-    case 0x89: return "breg25";
-    case 0x8a: return "breg26";
-    case 0x8b: return "breg27";
-    case 0x8c: return "breg28";
-    case 0x8d: return "breg29";
-    case 0x8e: return "breg30";
-    case 0x8f: return "breg31";
-    case 0x90: return "regx";
-    case 0x91: return "fbreg";
-    case 0x92: return "bregx";
-    case 0x93: return "piece";
-    case 0x94: return "deref size";
-    case 0x95: return "xderef size";
-    case 0x96: return "nop";
-    case 0x97: return "push object address";
-    case 0x98: return "call2";
-    case 0x99: return "call4";
-    case 0x9a: return "call ref";
-    case 0xf0: return "uninitialized";
-    case 0xe0: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_OP constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_OP_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x03: return DRC_ONEOPERAND;
-    case 0x06: return DRC_ZEROOPERANDS;
-    case 0x08: return DRC_ONEOPERAND;
-    case 0x09: return DRC_ONEOPERAND;
-    case 0x0a: return DRC_ONEOPERAND;
-    case 0x0b: return DRC_ONEOPERAND;
-    case 0x0c: return DRC_ONEOPERAND;
-    case 0x0d: return DRC_ONEOPERAND;
-    case 0x0e: return DRC_ONEOPERAND;
-    case 0x0f: return DRC_ONEOPERAND;
-    case 0x10: return DRC_ONEOPERAND;
-    case 0x11: return DRC_ONEOPERAND;
-    case 0x12: return DRC_ZEROOPERANDS;
-    case 0x13: return DRC_ZEROOPERANDS;
-    case 0x14: return DRC_ZEROOPERANDS;
-    case 0x15: return DRC_ONEOPERAND;
-    case 0x16: return DRC_ZEROOPERANDS;
-    case 0x17: return DRC_ZEROOPERANDS;
-    case 0x18: return DRC_ZEROOPERANDS;
-    case 0x19: return DRC_ZEROOPERANDS;
-    case 0x1a: return DRC_ZEROOPERANDS;
-    case 0x1b: return DRC_ZEROOPERANDS;
-    case 0x1c: return DRC_ZEROOPERANDS;
-    case 0x1d: return DRC_ZEROOPERANDS;
-    case 0x1e: return DRC_ZEROOPERANDS;
-    case 0x1f: return DRC_ZEROOPERANDS;
-    case 0x20: return DRC_ZEROOPERANDS;
-    case 0x21: return DRC_ZEROOPERANDS;
-    case 0x22: return DRC_ZEROOPERANDS;
-    case 0x23: return DRC_ONEOPERAND;
-    case 0x24: return DRC_ZEROOPERANDS;
-    case 0x25: return DRC_ZEROOPERANDS;
-    case 0x26: return DRC_ZEROOPERANDS;
-    case 0x27: return DRC_ZEROOPERANDS;
-    case 0x2f: return DRC_ONEOPERAND;
-    case 0x28: return DRC_ONEOPERAND;
-    case 0x29: return DRC_ZEROOPERANDS;
-    case 0x2a: return DRC_ZEROOPERANDS;
-    case 0x2b: return DRC_ZEROOPERANDS;
-    case 0x2c: return DRC_ZEROOPERANDS;
-    case 0x2d: return DRC_ZEROOPERANDS;
-    case 0x2e: return DRC_ZEROOPERANDS;
-    case 0x30: return DRC_ZEROOPERANDS;
-    case 0x31: return DRC_ZEROOPERANDS;
-    case 0x32: return DRC_ZEROOPERANDS;
-    case 0x33: return DRC_ZEROOPERANDS;
-    case 0x34: return DRC_ZEROOPERANDS;
-    case 0x35: return DRC_ZEROOPERANDS;
-    case 0x36: return DRC_ZEROOPERANDS;
-    case 0x37: return DRC_ZEROOPERANDS;
-    case 0x38: return DRC_ZEROOPERANDS;
-    case 0x39: return DRC_ZEROOPERANDS;
-    case 0x3a: return DRC_ZEROOPERANDS;
-    case 0x3b: return DRC_ZEROOPERANDS;
-    case 0x3c: return DRC_ZEROOPERANDS;
-    case 0x3d: return DRC_ZEROOPERANDS;
-    case 0x3e: return DRC_ZEROOPERANDS;
-    case 0x3f: return DRC_ZEROOPERANDS;
-    case 0x40: return DRC_ZEROOPERANDS;
-    case 0x41: return DRC_ZEROOPERANDS;
-    case 0x42: return DRC_ZEROOPERANDS;
-    case 0x43: return DRC_ZEROOPERANDS;
-    case 0x44: return DRC_ZEROOPERANDS;
-    case 0x45: return DRC_ZEROOPERANDS;
-    case 0x46: return DRC_ZEROOPERANDS;
-    case 0x47: return DRC_ZEROOPERANDS;
-    case 0x48: return DRC_ZEROOPERANDS;
-    case 0x49: return DRC_ZEROOPERANDS;
-    case 0x4a: return DRC_ZEROOPERANDS;
-    case 0x4b: return DRC_ZEROOPERANDS;
-    case 0x4c: return DRC_ZEROOPERANDS;
-    case 0x4d: return DRC_ZEROOPERANDS;
-    case 0x4e: return DRC_ZEROOPERANDS;
-    case 0x4f: return DRC_ZEROOPERANDS;
-    case 0x50: return DRC_ZEROOPERANDS;
-    case 0x51: return DRC_ZEROOPERANDS;
-    case 0x52: return DRC_ZEROOPERANDS;
-    case 0x53: return DRC_ZEROOPERANDS;
-    case 0x54: return DRC_ZEROOPERANDS;
-    case 0x55: return DRC_ZEROOPERANDS;
-    case 0x56: return DRC_ZEROOPERANDS;
-    case 0x57: return DRC_ZEROOPERANDS;
-    case 0x58: return DRC_ZEROOPERANDS;
-    case 0x59: return DRC_ZEROOPERANDS;
-    case 0x5a: return DRC_ZEROOPERANDS;
-    case 0x5b: return DRC_ZEROOPERANDS;
-    case 0x5c: return DRC_ZEROOPERANDS;
-    case 0x5d: return DRC_ZEROOPERANDS;
-    case 0x5e: return DRC_ZEROOPERANDS;
-    case 0x5f: return DRC_ZEROOPERANDS;
-    case 0x60: return DRC_ZEROOPERANDS;
-    case 0x61: return DRC_ZEROOPERANDS;
-    case 0x62: return DRC_ZEROOPERANDS;
-    case 0x63: return DRC_ZEROOPERANDS;
-    case 0x64: return DRC_ZEROOPERANDS;
-    case 0x65: return DRC_ZEROOPERANDS;
-    case 0x66: return DRC_ZEROOPERANDS;
-    case 0x67: return DRC_ZEROOPERANDS;
-    case 0x68: return DRC_ZEROOPERANDS;
-    case 0x69: return DRC_ZEROOPERANDS;
-    case 0x6a: return DRC_ZEROOPERANDS;
-    case 0x6b: return DRC_ZEROOPERANDS;
-    case 0x6c: return DRC_ZEROOPERANDS;
-    case 0x6d: return DRC_ZEROOPERANDS;
-    case 0x6e: return DRC_ZEROOPERANDS;
-    case 0x6f: return DRC_ZEROOPERANDS;
-    case 0x70: return DRC_ONEOPERAND;
-    case 0x71: return DRC_ONEOPERAND;
-    case 0x72: return DRC_ONEOPERAND;
-    case 0x73: return DRC_ONEOPERAND;
-    case 0x74: return DRC_ONEOPERAND;
-    case 0x75: return DRC_ONEOPERAND;
-    case 0x76: return DRC_ONEOPERAND;
-    case 0x77: return DRC_ONEOPERAND;
-    case 0x78: return DRC_ONEOPERAND;
-    case 0x79: return DRC_ONEOPERAND;
-    case 0x7a: return DRC_ONEOPERAND;
-    case 0x7b: return DRC_ONEOPERAND;
-    case 0x7c: return DRC_ONEOPERAND;
-    case 0x7d: return DRC_ONEOPERAND;
-    case 0x7e: return DRC_ONEOPERAND;
-    case 0x7f: return DRC_ONEOPERAND;
-    case 0x80: return DRC_ONEOPERAND;
-    case 0x81: return DRC_ONEOPERAND;
-    case 0x82: return DRC_ONEOPERAND;
-    case 0x83: return DRC_ONEOPERAND;
-    case 0x84: return DRC_ONEOPERAND;
-    case 0x85: return DRC_ONEOPERAND;
-    case 0x86: return DRC_ONEOPERAND;
-    case 0x87: return DRC_ONEOPERAND;
-    case 0x88: return DRC_ONEOPERAND;
-    case 0x89: return DRC_ONEOPERAND;
-    case 0x8a: return DRC_ONEOPERAND;
-    case 0x8b: return DRC_ONEOPERAND;
-    case 0x8c: return DRC_ONEOPERAND;
-    case 0x8d: return DRC_ONEOPERAND;
-    case 0x8e: return DRC_ONEOPERAND;
-    case 0x8f: return DRC_ONEOPERAND;
-    case 0x90: return DRC_ONEOPERAND;
-    case 0x91: return DRC_ONEOPERAND;
-    case 0x92: return DRC_TWOOPERANDS;
-    case 0x93: return DRC_ONEOPERAND;
-    case 0x94: return DRC_ONEOPERAND;
-    case 0x95: return DRC_ONEOPERAND;
-    case 0x96: return DRC_ZEROOPERANDS;
-    case 0x97: return DRC_DWARFv3 | DRC_ZEROOPERANDS;
-    case 0x98: return DRC_DWARFv3 | DRC_ONEOPERAND;
-    case 0x99: return DRC_DWARFv3 | DRC_ONEOPERAND;
-    case 0x9a: return DRC_DWARFv3 | DRC_ONEOPERAND;
-    case 0xf0: return DRC_ZEROOPERANDS; /* DW_OP_APPLE_uninit */
-    case 0xe0: return 0;
-    case 0xff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.8] Figure 23 "Base type encoding values" (pp. 140-141) in DWARFv3 draft 8 */
-
-const char *
-DW_ATE_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_ATE_address";
-    case 0x02: return "DW_ATE_boolean";
-    case 0x03: return "DW_ATE_complex_float";
-    case 0x04: return "DW_ATE_float";
-    case 0x05: return "DW_ATE_signed";
-    case 0x06: return "DW_ATE_signed_char";
-    case 0x07: return "DW_ATE_unsigned";
-    case 0x08: return "DW_ATE_unsigned_char";
-    case 0x09: return "DW_ATE_imaginary_float";
-    case 0x80: return "DW_ATE_lo_user";
-    case 0xff: return "DW_ATE_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ATE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ATE_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "address";
-    case 0x02: return "boolean";
-    case 0x03: return "complex float";
-    case 0x04: return "float";
-    case 0x05: return "signed";
-    case 0x06: return "signed char";
-    case 0x07: return "unsigned";
-    case 0x08: return "unsigned char";
-    case 0x09: return "imaginary float";
-    case 0x80: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ATE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ATE_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x04: return 0;
-    case 0x05: return 0;
-    case 0x06: return 0;
-    case 0x07: return 0;
-    case 0x08: return 0;
-    case 0x09: return DRC_DWARFv3;
-    case 0x80: return 0;
-    case 0xff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.9] Figure 24 "Accessibility encodings" (p. 141) in DWARFv3 draft 8 */
-
-const char *
-DW_ACCESS_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "DW_ACCESS_public";
-    case 0x2: return "DW_ACCESS_protected";
-    case 0x3: return "DW_ACCESS_private";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ACCESS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ACCESS_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "public";
-    case 0x2: return "protected";
-    case 0x3: return "private";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ACCESS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ACCESS_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.10] Figure 25 "Visibility encodings" (p. 142) in DWARFv3 draft 8 */
-
-const char *
-DW_VIS_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "DW_VIS_local";
-    case 0x2: return "DW_VIS_exported";
-    case 0x3: return "DW_VIS_qualified";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_VIS_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "local";
-    case 0x2: return "exported";
-    case 0x3: return "qualified";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_VIS_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.11] Figure 26 "Virtuality encodings" (p. 142) in DWARFv3 draft 8 */
-
-const char *
-DW_VIRTUALITY_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_VIRTUALITY_none";
-    case 0x1: return "DW_VIRTUALITY_virtual";
-    case 0x2: return "DW_VIRTUALITY_pure_virtual";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIRTUALITY constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_VIRTUALITY_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "none";
-    case 0x1: return "virtual";
-    case 0x2: return "pure virtual";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIRTUALITY constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_VIRTUALITY_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    case 0x2: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.12] Figure 27 "Language encodings" (p. 143) in DWARFv3 draft 8 */
-
-const char *
-DW_LANG_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0001: return "DW_LANG_C89";
-    case 0x0002: return "DW_LANG_C";
-    case 0x0003: return "DW_LANG_Ada83";
-    case 0x0004: return "DW_LANG_C_plus_plus";
-    case 0x0005: return "DW_LANG_Cobol74";
-    case 0x0006: return "DW_LANG_Cobol85";
-    case 0x0007: return "DW_LANG_Fortran77";
-    case 0x0008: return "DW_LANG_Fortran90";
-    case 0x0009: return "DW_LANG_Pascal83";
-    case 0x000a: return "DW_LANG_Modula2";
-    case 0x000b: return "DW_LANG_Java";
-    case 0x000c: return "DW_LANG_C99";
-    case 0x000d: return "DW_LANG_Ada95";
-    case 0x000e: return "DW_LANG_Fortran95";
-    case 0x000f: return "DW_LANG_PLI";
-    case 0x0010: return "DW_LANG_ObjC";
-    case 0x0011: return "DW_LANG_ObjC_plus_plus";
-    case 0x0012: return "DW_LANG_UPC";
-    case 0x0013: return "DW_LANG_D";
-    case 0x8000: return "DW_LANG_lo_user";
-    case 0x8001: return "DW_LANG_Mips_Assembler";
-    case 0x8765: return "DW_LANG_Upc";
-    case 0xffff: return "DW_LANG_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LANG constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_LANG_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0001: return "C89";
-    case 0x0002: return "C";
-    case 0x0003: return "Ada83";
-    case 0x0004: return "C++";
-    case 0x0005: return "Cobol74";
-    case 0x0006: return "Cobol85";
-    case 0x0007: return "Fortran77";
-    case 0x0008: return "Fortran90";
-    case 0x0009: return "Pascal83";
-    case 0x000a: return "Modula2";
-    case 0x000b: return "Java";
-    case 0x000c: return "C99";
-    case 0x000d: return "Ada95";
-    case 0x000e: return "Fortran95";
-    case 0x000f: return "PLI";
-    case 0x0010: return "Objective C";
-    case 0x0011: return "Objective C++";
-    case 0x0012: return "UPC";
-    case 0x0013: return "D";
-    case 0x8000: return "lo user";
-    case 0x8001: return "MIPS Assembler";
-    case 0x8765: return "UPC";
-    case 0xffff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LANG constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_LANG_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0001: return 0;
-    case 0x0002: return 0;
-    case 0x0003: return 0;
-    case 0x0004: return 0;
-    case 0x0005: return 0;
-    case 0x0006: return 0;
-    case 0x0007: return 0;
-    case 0x0008: return 0;
-    case 0x0009: return 0;
-    case 0x000a: return 0;
-    case 0x000b: return DRC_DWARFv3;
-    case 0x000c: return DRC_DWARFv3;
-    case 0x000d: return DRC_DWARFv3;
-    case 0x000e: return DRC_DWARFv3;
-    case 0x000f: return DRC_DWARFv3;
-    case 0x0010: return DRC_DWARFv3;
-    case 0x0011: return DRC_DWARFv3;
-    case 0x0012: return DRC_DWARFv3;
-    case 0x0013: return DRC_DWARFv3;
-    case 0x8000: return 0;
-    case 0x8001: return 0;
-    case 0x8765: return 0;
-    case 0xffff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.13], "Address Class Encodings" (p. 144) in DWARFv3 draft 8 */
-
-const char *
-DW_ADDR_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_ADDR_none";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ADDR constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ADDR_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "none";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ADDR constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ADDR_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.14] Figure 28 "Identifier case encodings" (p. 144) in DWARFv3 draft 8 */
-
-const char *
-DW_ID_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_ID_case_sensitive";
-    case 0x1: return "DW_ID_up_case";
-    case 0x2: return "DW_ID_down_case";
-    case 0x3: return "DW_ID_case_insensitive";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ID constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ID_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "case sensitive";
-    case 0x1: return "up case";
-    case 0x2: return "down case";
-    case 0x3: return "case insensitive";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ID constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ID_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.15] Figure 29 "Calling convention encodings" (p. 144) in DWARFv3 draft 8 */
-
-const char *
-DW_CC_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_CC_normal";
-    case 0x02: return "DW_CC_program";
-    case 0x03: return "DW_CC_nocall";
-    case 0x40: return "DW_CC_lo_user";
-    case 0xff: return "DW_CC_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_CC_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "normal";
-    case 0x02: return "program";
-    case 0x03: return "nocall";
-    case 0x40: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_CC_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x40: return 0;
-    case 0xff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.16] Figure 30 "Inline encodings" (p. 145) in DWARFv3 draft 8 */
-
-const char *
-DW_INL_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_INL_not_inlined";
-    case 0x1: return "DW_INL_inlined";
-    case 0x2: return "DW_INL_declared_not_inlined";
-    case 0x3: return "DW_INL_declared_inlined";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_INL constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_INL_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "not inlined";
-    case 0x1: return "inlined";
-    case 0x2: return "declared not inlined";
-    case 0x3: return "declared inlined";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_INL constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_INL_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.17] Figure 31 "Ordering encodings" (p. 145) in DWARFv3 draft 8 */
-
-const char *
-DW_ORD_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_ORD_row_major";
-    case 0x1: return "DW_ORD_col_major";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ORD constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ORD_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "row major";
-    case 0x1: return "col major";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ORD constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ORD_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.18] Figure 32 "Discriminant descriptor encodings" (p. 146) in DWARFv3 draft 8 */
-
-const char *
-DW_DSC_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_DSC_label";
-    case 0x1: return "DW_DSC_range";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_DSC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_DSC_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "label";
-    case 0x1: return "range";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_DSC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_DSC_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.21] Figure 33 "Line Number Standard Opcode Encodings" (pp. 148-149) in DWARFv3 draft 8 */
-
-const char *
-DW_LNS_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "DW_LNS_copy";
-    case 0x2: return "DW_LNS_advance_pc";
-    case 0x3: return "DW_LNS_advance_line";
-    case 0x4: return "DW_LNS_set_file";
-    case 0x5: return "DW_LNS_set_column";
-    case 0x6: return "DW_LNS_negate_stmt";
-    case 0x7: return "DW_LNS_set_basic_block";
-    case 0x8: return "DW_LNS_const_add_pc";
-    case 0x9: return "DW_LNS_fixed_advance_pc";
-    case 0xa: return "DW_LNS_set_prologue_end";
-    case 0xb: return "DW_LNS_set_epilogue_begin";
-    case 0xc: return "DW_LNS_set_isa";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_LNS_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "copy";
-    case 0x2: return "advance pc";
-    case 0x3: return "advance line";
-    case 0x4: return "set file";
-    case 0x5: return "set column";
-    case 0x6: return "negate stmt";
-    case 0x7: return "set basic block";
-    case 0x8: return "const add pc";
-    case 0x9: return "fixed advance pc";
-    case 0xa: return "set prologue end";
-    case 0xb: return "set epilogue begin";
-    case 0xc: return "set isa";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_LNS_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    case 0x4: return 0;
-    case 0x5: return 0;
-    case 0x6: return 0;
-    case 0x7: return 0;
-    case 0x8: return 0;
-    case 0x9: return 0;
-    case 0xa: return DRC_DWARFv3;
-    case 0xb: return DRC_DWARFv3;
-    case 0xc: return DRC_DWARFv3;
-    default: return 0;
-  }
-}
-
-/* [7.21] Figure 34 "Line Number Extended Opcode Encodings" (p. 149) in DWARFv3 draft 8 */
-
-const char *
-DW_LNE_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_LNE_end_sequence";
-    case 0x02: return "DW_LNE_set_address";
-    case 0x03: return "DW_LNE_define_file";
-    case 0x80: return "DW_LNE_lo_user";
-    case 0xff: return "DW_LNE_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_LNE_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "end sequence";
-    case 0x02: return "set address";
-    case 0x03: return "define file";
-    case 0x80: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_LNE_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x80: return DRC_DWARFv3;
-    case 0xff: return DRC_DWARFv3;
-    default: return 0;
-  }
-}
-
-/* [7.22] Figure 35 "Macinfo Type Encodings" (p. 150) in DWARFv3 draft 8 */
-
-const char *
-DW_MACINFO_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_MACINFO_define";
-    case 0x02: return "DW_MACINFO_undef";
-    case 0x03: return "DW_MACINFO_start_file";
-    case 0x04: return "DW_MACINFO_end_file";
-    case 0xff: return "DW_MACINFO_vendor_ext";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_MACINFO constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_MACINFO_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "define";
-    case 0x02: return "undef";
-    case 0x03: return "start file";
-    case 0x04: return "end file";
-    case 0xff: return "vendor ext";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_MACINFO constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_MACINFO_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x04: return 0;
-    case 0xff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.23] Figure 36 "Call frame instruction encodings" (pp. 151-152) in DWARFv3 draft 8 */
-
-const char *
-DW_CFA_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x40: return "DW_CFA_advance_loc";
-    case 0x80: return "DW_CFA_offset";
-    case 0xc0: return "DW_CFA_restore";
-    case 0x00: return "DW_CFA_nop";
-    case 0x01: return "DW_CFA_set_loc";
-    case 0x02: return "DW_CFA_advance_loc1";
-    case 0x03: return "DW_CFA_advance_loc2";
-    case 0x04: return "DW_CFA_advance_loc4";
-    case 0x05: return "DW_CFA_offset_extended";
-    case 0x06: return "DW_CFA_restore_extended";
-    case 0x07: return "DW_CFA_undefined";
-    case 0x08: return "DW_CFA_same_value";
-    case 0x09: return "DW_CFA_register";
-    case 0x0a: return "DW_CFA_remember_state";
-    case 0x0b: return "DW_CFA_restore_state";
-    case 0x0c: return "DW_CFA_def_cfa";
-    case 0x0d: return "DW_CFA_def_cfa_register";
-    case 0x0e: return "DW_CFA_def_cfa_offset";
-    case 0x0f: return "DW_CFA_def_cfa_expression";
-    case 0x10: return "DW_CFA_expression";
-    case 0x11: return "DW_CFA_offset_extended_sf";
-    case 0x12: return "DW_CFA_def_cfa_sf";
-    case 0x13: return "DW_CFA_def_cfa_offset_sf";
-    case 0x1c: return "DW_CFA_lo_user";
-    case 0x3f: return "DW_CFA_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CFA constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_CFA_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x40: return "advance loc";
-    case 0x80: return "offset";
-    case 0xc0: return "restore";
-    case 0x00: return "nop";
-    case 0x01: return "set loc";
-    case 0x02: return "advance loc1";
-    case 0x03: return "advance loc2";
-    case 0x04: return "advance loc4";
-    case 0x05: return "offset extended";
-    case 0x06: return "restore extended";
-    case 0x07: return "undefined";
-    case 0x08: return "same value";
-    case 0x09: return "register";
-    case 0x0a: return "remember state";
-    case 0x0b: return "restore state";
-    case 0x0c: return "def cfa";
-    case 0x0d: return "def cfa register";
-    case 0x0e: return "def cfa offset";
-    case 0x0f: return "def cfa expression";
-    case 0x10: return "expression";
-    case 0x11: return "offset extended sf";
-    case 0x12: return "def cfa sf";
-    case 0x13: return "def cfa offset sf";
-    case 0x1c: return "lo user";
-    case 0x3f: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CFA constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_CFA_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x40: return DRC_ZEROOPERANDS;
-    case 0x80: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_OFFSET;
-    case 0xc0: return DRC_ZEROOPERANDS;
-    case 0x00: return DRC_ZEROOPERANDS;
-    case 0x01: return DRC_ONEOPERAND | DRC_OPERANDONE_ADDRESS;
-    case 0x02: return DRC_ONEOPERAND | DRC_OPERANDONE_1BYTE_DELTA;
-    case 0x03: return DRC_ONEOPERAND | DRC_OPERANDONE_2BYTE_DELTA;
-    case 0x04: return DRC_ONEOPERAND | DRC_OPERANDONE_4BYTE_DELTA;
-    case 0x05: return DRC_OPERANDTWO_ULEB128_OFFSET | DRC_OPERNADONE_ULEB128_REGISTER | DRC_TWOOPERANDS;
-    case 0x06: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x07: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x08: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x09: return DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_ULEB128_REGISTER | DRC_TWOOPERANDS;
-    case 0x0a: return DRC_ZEROOPERANDS;
-    case 0x0b: return DRC_ZEROOPERANDS;
-    case 0x0c: return DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_ULEB128_OFFSET | DRC_TWOOPERANDS;
-    case 0x0d: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x0e: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_OFFSET;
-    case 0x0f: return DRC_DWARFv3 | DRC_ONEOPERAND | DRC_OPERANDONE_BLOCK;
-    case 0x10: return DRC_DWARFv3 | DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_BLOCK | DRC_TWOOPERANDS;
-    case 0x11: return DRC_DWARFv3 | DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_SLEB128_OFFSET | DRC_TWOOPERANDS;
-    case 0x12: return DRC_DWARFv3 | DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_SLEB128_OFFSET | DRC_TWOOPERANDS;
-    case 0x13: return DRC_DWARFv3 | DRC_ONEOPERAND | DRC_OPERANDONE_SLEB128_OFFSET;
-    case 0x1c: return 0;
-    case 0x3f: return 0;
-    default: return 0;
-  }
-}
-
-/* FSF exception handling Pointer-Encoding constants (CFI augmentation) -- "DW_EH_PE_..." in the FSF sources */
-
-const char *
-DW_GNU_EH_PE_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x00: return "DW_GNU_EH_PE_absptr";
-    case 0x01: return "DW_GNU_EH_PE_uleb128";
-    case 0x02: return "DW_GNU_EH_PE_udata2";
-    case 0x03: return "DW_GNU_EH_PE_udata4";
-    case 0x04: return "DW_GNU_EH_PE_udata8";
-    case 0x09: return "DW_GNU_EH_PE_sleb128";
-    case 0x0a: return "DW_GNU_EH_PE_sdata2";
-    case 0x0b: return "DW_GNU_EH_PE_sdata4";
-    case 0x0c: return "DW_GNU_EH_PE_sdata8";
-    case 0x08: return "DW_GNU_EH_PE_signed";
-    case 0x10: return "DW_GNU_EH_PE_pcrel";
-    case 0x20: return "DW_GNU_EH_PE_textrel";
-    case 0x30: return "DW_GNU_EH_PE_datarel";
-    case 0x40: return "DW_GNU_EH_PE_funcrel";
-    case 0x50: return "DW_GNU_EH_PE_aligned";
-    case 0x80: return "DW_GNU_EH_PE_indirect";
-    case 0xff: return "DW_GNU_EH_PE_omit";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_GNU_EH_PE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_GNU_EH_PE_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x00: return "absptr";
-    case 0x01: return "uleb128";
-    case 0x02: return "udata2";
-    case 0x03: return "udata4";
-    case 0x04: return "udata8";
-    case 0x09: return "sleb128";
-    case 0x0a: return "sdata2";
-    case 0x0b: return "sdata4";
-    case 0x0c: return "sdata8";
-    case 0x08: return "signed";
-    case 0x10: return "pcrel";
-    case 0x20: return "textrel";
-    case 0x30: return "datarel";
-    case 0x40: return "funcrel";
-    case 0x50: return "aligned";
-    case 0x80: return "indirect";
-    case 0xff: return "omit";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_GNU_EH_PE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_GNU_EH_PE_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x00: return DRC_VENDOR_GNU;
-    case 0x01: return DRC_VENDOR_GNU;
-    case 0x02: return DRC_VENDOR_GNU;
-    case 0x03: return DRC_VENDOR_GNU;
-    case 0x04: return DRC_VENDOR_GNU;
-    case 0x09: return DRC_VENDOR_GNU;
-    case 0x0a: return DRC_VENDOR_GNU;
-    case 0x0b: return DRC_VENDOR_GNU;
-    case 0x0c: return DRC_VENDOR_GNU;
-    case 0x08: return DRC_VENDOR_GNU;
-    case 0x10: return DRC_VENDOR_GNU;
-    case 0x20: return DRC_VENDOR_GNU;
-    case 0x30: return DRC_VENDOR_GNU;
-    case 0x40: return DRC_VENDOR_GNU;
-    case 0x50: return DRC_VENDOR_GNU;
-    case 0x80: return DRC_VENDOR_GNU;
-    case 0xff: return DRC_VENDOR_GNU;
-    default: return 0;
-  }
-}
-
-bool
-is_type_tag (uint16_t tag)
-{
-  switch (tag)
-    {
-      case DW_TAG_array_type:
-      case DW_TAG_base_type:
-      case DW_TAG_class_type:
-      case DW_TAG_const_type:
-      case DW_TAG_enumeration_type:
-      case DW_TAG_file_type:
-      case DW_TAG_interface_type:
-      case DW_TAG_packed_type:
-      case DW_TAG_pointer_type:
-      case DW_TAG_ptr_to_member_type:
-      case DW_TAG_reference_type:
-      case DW_TAG_restrict_type:
-      case DW_TAG_set_type:
-      case DW_TAG_shared_type:
-      case DW_TAG_string_type:
-      case DW_TAG_structure_type:
-      case DW_TAG_subrange_type:
-      case DW_TAG_subroutine_type:
-      case DW_TAG_thrown_type:
-      case DW_TAG_union_type:
-      case DW_TAG_unspecified_type:
-      case DW_TAG_volatile_type:
-        return true;
-      default:
-        return false;
-    }
-}
-
-bool
-is_pubtype_tag (uint16_t tag)
-{
-  switch (tag)
-    {
-      case DW_TAG_array_type:
-      case DW_TAG_class_type:
-      case DW_TAG_enumeration_type:
-      case DW_TAG_file_type:
-      case DW_TAG_interface_type:
-      case DW_TAG_set_type:
-      case DW_TAG_string_type:
-      case DW_TAG_structure_type:
-      case DW_TAG_subrange_type:
-      case DW_TAG_subroutine_type:
-      case DW_TAG_thrown_type:
-      case DW_TAG_typedef:
-      case DW_TAG_union_type:
-      case DW_TAG_unspecified_type:
-        return true;
-      default:
-        break;
-    }
-  return false;
-}
-
-DW_TAG_CategoryEnum
-get_tag_category (uint16_t tag)
-{
-  switch (tag)
-    {
-      case DW_TAG_array_type                 : return TagCategoryType;
-      case DW_TAG_class_type                 : return TagCategoryType;
-      case DW_TAG_entry_point                : return TagCategoryProgram;
-      case DW_TAG_enumeration_type           : return TagCategoryType;
-      case DW_TAG_formal_parameter           : return TagCategoryVariable;
-      case DW_TAG_imported_declaration       : return TagCategoryProgram;
-      case DW_TAG_label                      : return TagCategoryProgram;
-      case DW_TAG_lexical_block              : return TagCategoryProgram;
-      case DW_TAG_member                     : return TagCategoryType;
-      case DW_TAG_pointer_type               : return TagCategoryType;
-      case DW_TAG_reference_type             : return TagCategoryType;
-      case DW_TAG_compile_unit               : return TagCategoryProgram;
-      case DW_TAG_string_type                : return TagCategoryType;
-      case DW_TAG_structure_type             : return TagCategoryType;
-      case DW_TAG_subroutine_type            : return TagCategoryType;
-      case DW_TAG_typedef                    : return TagCategoryType;
-      case DW_TAG_union_type                 : return TagCategoryType;
-      case DW_TAG_unspecified_parameters     : return TagCategoryVariable;
-      case DW_TAG_variant                    : return TagCategoryType;
-      case DW_TAG_common_block               : return TagCategoryProgram;
-      case DW_TAG_common_inclusion           : return TagCategoryProgram;
-      case DW_TAG_inheritance                : return TagCategoryType;
-      case DW_TAG_inlined_subroutine         : return TagCategoryProgram;
-      case DW_TAG_module                     : return TagCategoryProgram;
-      case DW_TAG_ptr_to_member_type         : return TagCategoryType;
-      case DW_TAG_set_type                   : return TagCategoryType;
-      case DW_TAG_subrange_type              : return TagCategoryType;
-      case DW_TAG_with_stmt                  : return TagCategoryProgram;
-      case DW_TAG_access_declaration         : return TagCategoryProgram;
-      case DW_TAG_base_type                  : return TagCategoryType;
-      case DW_TAG_catch_block                : return TagCategoryProgram;
-      case DW_TAG_const_type                 : return TagCategoryType;
-      case DW_TAG_constant                   : return TagCategoryVariable;
-      case DW_TAG_enumerator                 : return TagCategoryType;
-      case DW_TAG_file_type                  : return TagCategoryType;
-      case DW_TAG_friend                     : return TagCategoryType;
-      case DW_TAG_namelist                   : return TagCategoryVariable;
-      case DW_TAG_namelist_item              : return TagCategoryVariable;
-      case DW_TAG_packed_type                : return TagCategoryType;
-      case DW_TAG_subprogram                 : return TagCategoryProgram;
-      case DW_TAG_template_type_parameter    : return TagCategoryType;
-      case DW_TAG_template_value_parameter   : return TagCategoryType;
-      case DW_TAG_thrown_type                : return TagCategoryType;
-      case DW_TAG_try_block                  : return TagCategoryProgram;
-      case DW_TAG_variant_part               : return TagCategoryType;
-      case DW_TAG_variable                   : return TagCategoryVariable;
-      case DW_TAG_volatile_type              : return TagCategoryType;
-      case DW_TAG_dwarf_procedure            : return TagCategoryProgram;
-      case DW_TAG_restrict_type              : return TagCategoryType;
-      case DW_TAG_interface_type             : return TagCategoryType;
-      case DW_TAG_namespace                  : return TagCategoryProgram;
-      case DW_TAG_imported_module            : return TagCategoryProgram;
-      case DW_TAG_unspecified_type           : return TagCategoryType;
-      case DW_TAG_partial_unit               : return TagCategoryProgram;
-      case DW_TAG_imported_unit              : return TagCategoryProgram;
-      case DW_TAG_shared_type                : return TagCategoryType;
-      default: break;
-    }
-    return TagCategoryProgram;
-}
-

Copied: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp (from r106035, lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp?p2=lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp&p1=lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c&r1=106035&r2=107716&rev=107716&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.c (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp Tue Jul  6 17:38:03 2010
@@ -9,1045 +9,171 @@
 
 #include "DWARFDefines.h"
 #include <stdio.h>
+#include <string>
+#include "lldb/Core/ConstString.h"
 
-#define DW_TAG_PREFIX   "TAG_"
-#define DW_AT_PREFIX    " AT_"
-#define DW_FORM_PREFIX  "FORM_"
-
-/* [7.5.4] Figure 16 "Tag Encodings" (pp. 125-127) in DWARFv3 draft 8 */
+namespace lldb_private {
 
 const char *
 DW_TAG_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0000: return DW_TAG_PREFIX "NULL";
-    case 0x0001: return DW_TAG_PREFIX "array_type";
-    case 0x0002: return DW_TAG_PREFIX "class_type";
-    case 0x0003: return DW_TAG_PREFIX "entry_point";
-    case 0x0004: return DW_TAG_PREFIX "enumeration_type";
-    case 0x0005: return DW_TAG_PREFIX "formal_parameter";
-    case 0x0008: return DW_TAG_PREFIX "imported_declaration";
-    case 0x000a: return DW_TAG_PREFIX "label";
-    case 0x000b: return DW_TAG_PREFIX "lexical_block";
-    case 0x000d: return DW_TAG_PREFIX "member";
-    case 0x000f: return DW_TAG_PREFIX "pointer_type";
-    case 0x0010: return DW_TAG_PREFIX "reference_type";
-    case 0x0011: return DW_TAG_PREFIX "compile_unit";
-    case 0x0012: return DW_TAG_PREFIX "string_type";
-    case 0x0013: return DW_TAG_PREFIX "structure_type";
-    case 0x0015: return DW_TAG_PREFIX "subroutine_type";
-    case 0x0016: return DW_TAG_PREFIX "typedef";
-    case 0x0017: return DW_TAG_PREFIX "union_type";
-    case 0x0018: return DW_TAG_PREFIX "unspecified_parameters";
-    case 0x0019: return DW_TAG_PREFIX "variant";
-    case 0x001a: return DW_TAG_PREFIX "common_block";
-    case 0x001b: return DW_TAG_PREFIX "common_inclusion";
-    case 0x001c: return DW_TAG_PREFIX "inheritance";
-    case 0x001d: return DW_TAG_PREFIX "inlined_subroutine";
-    case 0x001e: return DW_TAG_PREFIX "module";
-    case 0x001f: return DW_TAG_PREFIX "ptr_to_member_type";
-    case 0x0020: return DW_TAG_PREFIX "set_type";
-    case 0x0021: return DW_TAG_PREFIX "subrange_type";
-    case 0x0022: return DW_TAG_PREFIX "with_stmt";
-    case 0x0023: return DW_TAG_PREFIX "access_declaration";
-    case 0x0024: return DW_TAG_PREFIX "base_type";
-    case 0x0025: return DW_TAG_PREFIX "catch_block";
-    case 0x0026: return DW_TAG_PREFIX "const_type";
-    case 0x0027: return DW_TAG_PREFIX "constant";
-    case 0x0028: return DW_TAG_PREFIX "enumerator";
-    case 0x0029: return DW_TAG_PREFIX "file_type";
-    case 0x002a: return DW_TAG_PREFIX "friend";
-    case 0x002b: return DW_TAG_PREFIX "namelist";
-    case 0x002c: return DW_TAG_PREFIX "namelist_item";
-    case 0x002d: return DW_TAG_PREFIX "packed_type";
-    case 0x002e: return DW_TAG_PREFIX "subprogram";
-    case 0x002f: return DW_TAG_PREFIX "template_type_parameter";
-    case 0x0030: return DW_TAG_PREFIX "template_value_parameter";
-    case 0x0031: return DW_TAG_PREFIX "thrown_type";
-    case 0x0032: return DW_TAG_PREFIX "try_block";
-    case 0x0033: return DW_TAG_PREFIX "variant_part";
-    case 0x0034: return DW_TAG_PREFIX "variable";
-    case 0x0035: return DW_TAG_PREFIX "volatile_type";
-    case 0x0036: return DW_TAG_PREFIX "dwarf_procedure";
-    case 0x0037: return DW_TAG_PREFIX "restrict_type";
-    case 0x0038: return DW_TAG_PREFIX "interface_type";
-    case 0x0039: return DW_TAG_PREFIX "namespace";
-    case 0x003a: return DW_TAG_PREFIX "imported_module";
-    case 0x003b: return DW_TAG_PREFIX "unspecified_type";
-    case 0x003c: return DW_TAG_PREFIX "partial_unit";
-    case 0x003d: return DW_TAG_PREFIX "imported_unit";
-//  case 0x003d: return DW_TAG_PREFIX "condition";
-    case 0x0040: return DW_TAG_PREFIX "shared_type";
-    case 0x4080: return DW_TAG_PREFIX "lo_user";
-    case 0xffff: return DW_TAG_PREFIX "hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_TAG constant: 0x%x", val);
-       return invalid;
+
+  if (val == 0)
+      return "NULL";
+
+  const char *llvmstr = TagString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_TAG constant: 0x%x", val);
+      return invalid;
   }
-}
+  return llvmstr;
+}   
 
 const char *
 DW_TAG_value_to_englishy_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0001: return "array type";
-    case 0x0002: return "class type";
-    case 0x0003: return "entry point";
-    case 0x0004: return "enumeration type";
-    case 0x0005: return "formal parameter";
-    case 0x0008: return "imported declaration";
-    case 0x000a: return "label";
-    case 0x000b: return "lexical block";
-    case 0x000d: return "member";
-    case 0x000f: return "pointer type";
-    case 0x0010: return "reference type";
-    case 0x0011: return "file";
-    case 0x0012: return "string type";
-    case 0x0013: return "structure type";
-    case 0x0015: return "subroutine type";
-    case 0x0016: return "typedef";
-    case 0x0017: return "union type";
-    case 0x0018: return "unspecified parameters";
-    case 0x0019: return "variant";
-    case 0x001a: return "common block";
-    case 0x001b: return "common inclusion";
-    case 0x001c: return "inheritance";
-    case 0x001d: return "inlined subroutine";
-    case 0x001e: return "module";
-    case 0x001f: return "ptr to member type";
-    case 0x0020: return "set type";
-    case 0x0021: return "subrange type";
-    case 0x0022: return "with stmt";
-    case 0x0023: return "access declaration";
-    case 0x0024: return "base type";
-    case 0x0025: return "catch block";
-    case 0x0026: return "const type";
-    case 0x0027: return "constant";
-    case 0x0028: return "enumerator";
-    case 0x0029: return "file type";
-    case 0x002a: return "friend";
-    case 0x002b: return "namelist";
-    case 0x002c: return "namelist item";
-    case 0x002d: return "packed type";
-    case 0x002e: return "function";
-    case 0x002f: return "template type parameter";
-    case 0x0030: return "template value parameter";
-    case 0x0031: return "thrown type";
-    case 0x0032: return "try block";
-    case 0x0033: return "variant part";
-    case 0x0034: return "variable";
-    case 0x0035: return "volatile type";
-    case 0x0036: return "dwarf procedure";
-    case 0x0037: return "restrict type";
-    case 0x0038: return "interface type";
-    case 0x0039: return "namespace";
-    case 0x003a: return "imported module";
-    case 0x003b: return "unspecified type";
-    case 0x003c: return "partial unit";
-    case 0x003d: return "imported unit";
-//  case 0x003d: return "condition";
-    case 0x0040: return "shared type";
-    case 0x4080: return "lo user";
-    case 0xffff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_TAG constant: 0x%x", val);
-       return invalid;
-  }
-}
 
-DRC_class
-DW_TAG_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0001: return 0;
-    case 0x0002: return 0;
-    case 0x0003: return 0;
-    case 0x0004: return 0;
-    case 0x0005: return 0;
-    case 0x0008: return 0;
-    case 0x000a: return 0;
-    case 0x000b: return 0;
-    case 0x000d: return 0;
-    case 0x000f: return 0;
-    case 0x0010: return 0;
-    case 0x0011: return 0;
-    case 0x0012: return 0;
-    case 0x0013: return 0;
-    case 0x0015: return 0;
-    case 0x0016: return 0;
-    case 0x0017: return 0;
-    case 0x0018: return 0;
-    case 0x0019: return 0;
-    case 0x001a: return 0;
-    case 0x001b: return 0;
-    case 0x001c: return 0;
-    case 0x001d: return 0;
-    case 0x001e: return 0;
-    case 0x001f: return 0;
-    case 0x0020: return 0;
-    case 0x0021: return 0;
-    case 0x0022: return 0;
-    case 0x0023: return 0;
-    case 0x0024: return 0;
-    case 0x0025: return 0;
-    case 0x0026: return 0;
-    case 0x0027: return 0;
-    case 0x0028: return 0;
-    case 0x0029: return 0;
-    case 0x002a: return 0;
-    case 0x002b: return 0;
-    case 0x002c: return 0;
-    case 0x002d: return 0;
-    case 0x002e: return 0;
-    case 0x002f: return 0;
-    case 0x0030: return 0;
-    case 0x0031: return 0;
-    case 0x0032: return 0;
-    case 0x0033: return 0;
-    case 0x0034: return 0;
-    case 0x0035: return 0;
-    case 0x0036: return DRC_DWARFv3;
-    case 0x0037: return DRC_DWARFv3;
-    case 0x0038: return DRC_DWARFv3;
-    case 0x0039: return DRC_DWARFv3;
-    case 0x003a: return DRC_DWARFv3;
-    case 0x003b: return DRC_DWARFv3;
-    case 0x003c: return DRC_DWARFv3;
-    case 0x003d: return DRC_DWARFv3;
-//  case 0x003d: return DRC_DWARFv3;
-    case 0x0040: return DRC_DWARFv3;
-    case 0x4080: return 0;
-    case 0xffff: return 0;
-    default: return 0;
-  }
-}
+  if (val == 0)
+      return "NULL";
 
-/* [7.5.4] Figure 17 "Child determination encodings" (p. 128) in DWARFv3 draft 8 */
+  const char *llvmstr = TagString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_TAG constant: 0x%x", val);
+      return invalid;
+  }
+
+  std::string str;
+  if (strncmp (llvmstr, "DW_TAG_", 7) == 0)
+    llvmstr += 7;
+  
+  for (const char *i = llvmstr; *i != '\0'; i++)
+    str += *i == '_' ? ' ' : *i;
 
-const char *
-DW_CHILDREN_value_to_name (uint8_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_CHILDREN_no";
-    case 0x1: return "DW_CHILDREN_yes";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CHILDREN constant: 0x%x", val);
-       return invalid;
-  }
+  ConstString const_str (str.c_str());
+
+  return const_str.GetCString();
 }
 
 const char *
-DW_CHILDREN_value_to_englishy_name (uint8_t val)
+DW_CHILDREN_value_to_name (uint8_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0: return "no";
-    case 0x1: return "yes";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CHILDREN constant: 0x%x", val);
+  const char *llvmstr = ChildrenString (val);
+  if (llvmstr == NULL)
+  {
+       snprintf (invalid, sizeof (invalid), "Unknown DW_CHILDREN constant: 0x%x", val);
        return invalid;
   }
+  return llvmstr;
 }
 
-DRC_class
-DW_CHILDREN_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.5.4] Figure 18 "Attribute encodings" (pp. 129-132) in DWARFv3 draft 8 */
-
 const char *
 DW_AT_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0001: return DW_AT_PREFIX "sibling";
-    case 0x0002: return DW_AT_PREFIX "location";
-    case 0x0003: return DW_AT_PREFIX "name";
-    case 0x0009: return DW_AT_PREFIX "ordering";
-    case 0x000b: return DW_AT_PREFIX "byte_size";
-    case 0x000c: return DW_AT_PREFIX "bit_offset";
-    case 0x000d: return DW_AT_PREFIX "bit_size";
-    case 0x0010: return DW_AT_PREFIX "stmt_list";
-    case 0x0011: return DW_AT_PREFIX "low_pc";
-    case 0x0012: return DW_AT_PREFIX "high_pc";
-    case 0x0013: return DW_AT_PREFIX "language";
-    case 0x0015: return DW_AT_PREFIX "discr";
-    case 0x0016: return DW_AT_PREFIX "discr_value";
-    case 0x0017: return DW_AT_PREFIX "visibility";
-    case 0x0018: return DW_AT_PREFIX "import";
-    case 0x0019: return DW_AT_PREFIX "string_length";
-    case 0x001a: return DW_AT_PREFIX "common_reference";
-    case 0x001b: return DW_AT_PREFIX "comp_dir";
-    case 0x001c: return DW_AT_PREFIX "const_value";
-    case 0x001d: return DW_AT_PREFIX "containing_type";
-    case 0x001e: return DW_AT_PREFIX "default_value";
-    case 0x0020: return DW_AT_PREFIX "inline";
-    case 0x0021: return DW_AT_PREFIX "is_optional";
-    case 0x0022: return DW_AT_PREFIX "lower_bound";
-    case 0x0025: return DW_AT_PREFIX "producer";
-    case 0x0027: return DW_AT_PREFIX "prototyped";
-    case 0x002a: return DW_AT_PREFIX "return_addr";
-    case 0x002c: return DW_AT_PREFIX "start_scope";
-    case 0x002e: return DW_AT_PREFIX "bit_stride";
-    case 0x002f: return DW_AT_PREFIX "upper_bound";
-    case 0x0031: return DW_AT_PREFIX "abstract_origin";
-    case 0x0032: return DW_AT_PREFIX "accessibility";
-    case 0x0033: return DW_AT_PREFIX "address_class";
-    case 0x0034: return DW_AT_PREFIX "artificial";
-    case 0x0035: return DW_AT_PREFIX "base_types";
-    case 0x0036: return DW_AT_PREFIX "calling_convention";
-    case 0x0037: return DW_AT_PREFIX "count";
-    case 0x0038: return DW_AT_PREFIX "data_member_location";
-    case 0x0039: return DW_AT_PREFIX "decl_column";
-    case 0x003a: return DW_AT_PREFIX "decl_file";
-    case 0x003b: return DW_AT_PREFIX "decl_line";
-    case 0x003c: return DW_AT_PREFIX "declaration";
-    case 0x003d: return DW_AT_PREFIX "discr_list";
-    case 0x003e: return DW_AT_PREFIX "encoding";
-    case 0x003f: return DW_AT_PREFIX "external";
-    case 0x0040: return DW_AT_PREFIX "frame_base";
-    case 0x0041: return DW_AT_PREFIX "friend";
-    case 0x0042: return DW_AT_PREFIX "identifier_case";
-    case 0x0043: return DW_AT_PREFIX "macro_info";
-    case 0x0044: return DW_AT_PREFIX "namelist_item";
-    case 0x0045: return DW_AT_PREFIX "priority";
-    case 0x0046: return DW_AT_PREFIX "segment";
-    case 0x0047: return DW_AT_PREFIX "specification";
-    case 0x0048: return DW_AT_PREFIX "static_link";
-    case 0x0049: return DW_AT_PREFIX "type";
-    case 0x004a: return DW_AT_PREFIX "use_location";
-    case 0x004b: return DW_AT_PREFIX "variable_parameter";
-    case 0x004c: return DW_AT_PREFIX "virtuality";
-    case 0x004d: return DW_AT_PREFIX "vtable_elem_location";
-    case 0x004e: return DW_AT_PREFIX "allocated";
-    case 0x004f: return DW_AT_PREFIX "associated";
-    case 0x0050: return DW_AT_PREFIX "data_location";
-    case 0x0051: return DW_AT_PREFIX "byte_stride";
-    case 0x0052: return DW_AT_PREFIX "entry_pc";
-    case 0x0053: return DW_AT_PREFIX "use_UTF8";
-    case 0x0054: return DW_AT_PREFIX "extension";
-    case 0x0055: return DW_AT_PREFIX "ranges";
-    case 0x0056: return DW_AT_PREFIX "trampoline";
-    case 0x0057: return DW_AT_PREFIX "call_column";
-    case 0x0058: return DW_AT_PREFIX "call_file";
-    case 0x0059: return DW_AT_PREFIX "call_line";
-    case 0x005a: return DW_AT_PREFIX "description";
-    case 0x005b: return DW_AT_PREFIX "binary_scale";
-    case 0x005c: return DW_AT_PREFIX "decimal_scale";
-    case 0x005d: return DW_AT_PREFIX "small";
-    case 0x005e: return DW_AT_PREFIX "decimal_sign";
-    case 0x005f: return DW_AT_PREFIX "digit_count";
-    case 0x0060: return DW_AT_PREFIX "picture_string";
-    case 0x0061: return DW_AT_PREFIX "mutable";
-    case 0x0062: return DW_AT_PREFIX "threads_scaled";
-    case 0x0063: return DW_AT_PREFIX "explicit";
-    case 0x0064: return DW_AT_PREFIX "object_pointer";
-    case 0x0065: return DW_AT_PREFIX "endianity";
-    case 0x0066: return DW_AT_PREFIX "elemental";
-    case 0x0067: return DW_AT_PREFIX "pure";
-    case 0x0068: return DW_AT_PREFIX "recursive";
-    case 0x2000: return DW_AT_PREFIX "lo_user";
-    case 0x3fff: return DW_AT_PREFIX "hi_user";
-    case 0x2001: return DW_AT_PREFIX "MIPS_fde";
-    case 0x2002: return DW_AT_PREFIX "MIPS_loop_begin";
-    case 0x2003: return DW_AT_PREFIX "MIPS_tail_loop_begin";
-    case 0x2004: return DW_AT_PREFIX "MIPS_epilog_begin";
-    case 0x2005: return DW_AT_PREFIX "MIPS_loop_unroll_factor";
-    case 0x2006: return DW_AT_PREFIX "MIPS_software_pipeline_depth";
-    case 0x2007: return DW_AT_PREFIX "MIPS_linkage_name";
-    case 0x2008: return DW_AT_PREFIX "MIPS_stride";
-    case 0x2009: return DW_AT_PREFIX "MIPS_abstract_name";
-    case 0x200a: return DW_AT_PREFIX "MIPS_clone_origin";
-    case 0x200b: return DW_AT_PREFIX "MIPS_has_inlines";
-    case 0x2101: return DW_AT_PREFIX "sf_names";
-    case 0x2102: return DW_AT_PREFIX "src_info";
-    case 0x2103: return DW_AT_PREFIX "mac_info";
-    case 0x2104: return DW_AT_PREFIX "src_coords";
-    case 0x2105: return DW_AT_PREFIX "body_begin";
-    case 0x2106: return DW_AT_PREFIX "body_end";
-    case 0x2107: return DW_AT_PREFIX "GNU_vector";
-    case 0x2501: return DW_AT_PREFIX "APPLE_repository_file";
-    case 0x2502: return DW_AT_PREFIX "APPLE_repository_type";
-    case 0x2503: return DW_AT_PREFIX "APPLE_repository_name";
-    case 0x2504: return DW_AT_PREFIX "APPLE_repository_specification";
-    case 0x2505: return DW_AT_PREFIX "APPLE_repository_import";
-    case 0x2506: return DW_AT_PREFIX "APPLE_repository_abstract_origin";
-    case DW_AT_APPLE_flags: return DW_AT_PREFIX "APPLE_flags";
-    case DW_AT_APPLE_optimized: return DW_AT_PREFIX "APPLE_optimized";
-    case DW_AT_APPLE_isa: return DW_AT_PREFIX "APPLE_isa";
-    case DW_AT_APPLE_block: return DW_AT_PREFIX "APPLE_block";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_AT constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = AttributeString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_AT constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
 const char *
 DW_AT_value_to_englishy_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0001: return "sibling";
-    case 0x0002: return "location";
-    case 0x0003: return "name";
-    case 0x0009: return "ordering";
-    case 0x000b: return "byte size";
-    case 0x000c: return "bit offset";
-    case 0x000d: return "bit size";
-    case 0x0010: return "stmt list";
-    case 0x0011: return "low pc";
-    case 0x0012: return "high pc";
-    case 0x0013: return "language";
-    case 0x0015: return "discr";
-    case 0x0016: return "discr value";
-    case 0x0017: return "visibility";
-    case 0x0018: return "import";
-    case 0x0019: return "string length";
-    case 0x001a: return "common reference";
-    case 0x001b: return "comp dir";
-    case 0x001c: return "const value";
-    case 0x001d: return "containing type";
-    case 0x001e: return "default value";
-    case 0x0020: return "inline";
-    case 0x0021: return "is optional";
-    case 0x0022: return "lower bound";
-    case 0x0025: return "producer";
-    case 0x0027: return "prototyped";
-    case 0x002a: return "return addr";
-    case 0x002c: return "start scope";
-    case 0x002e: return "bit stride";
-    case 0x002f: return "upper bound";
-    case 0x0031: return "abstract origin";
-    case 0x0032: return "accessibility";
-    case 0x0033: return "address class";
-    case 0x0034: return "artificial";
-    case 0x0035: return "base types";
-    case 0x0036: return "calling convention";
-    case 0x0037: return "count";
-    case 0x0038: return "data member location";
-    case 0x0039: return "decl column";
-    case 0x003a: return "decl file";
-    case 0x003b: return "decl line";
-    case 0x003c: return "declaration";
-    case 0x003d: return "discr list";
-    case 0x003e: return "encoding";
-    case 0x003f: return "external";
-    case 0x0040: return "frame base";
-    case 0x0041: return "friend";
-    case 0x0042: return "identifier case";
-    case 0x0043: return "macro info";
-    case 0x0044: return "namelist item";
-    case 0x0045: return "priority";
-    case 0x0046: return "segment";
-    case 0x0047: return "specification";
-    case 0x0048: return "static link";
-    case 0x0049: return "type";
-    case 0x004a: return "use location";
-    case 0x004b: return "variable parameter";
-    case 0x004c: return "virtuality";
-    case 0x004d: return "vtable elem location";
-    case 0x004e: return "allocated";
-    case 0x004f: return "associated";
-    case 0x0050: return "data location";
-    case 0x0051: return "byte stride";
-    case 0x0052: return "entry pc";
-    case 0x0053: return "use UTF8";
-    case 0x0054: return "extension";
-    case 0x0055: return "ranges";
-    case 0x0056: return "trampoline";
-    case 0x0057: return "call column";
-    case 0x0058: return "call file";
-    case 0x0059: return "call line";
-    case 0x005a: return "description";
-    case 0x005b: return "binary scale";
-    case 0x005c: return "decimal scale";
-    case 0x005d: return "small";
-    case 0x005e: return "decimal sign";
-    case 0x005f: return "digit count";
-    case 0x0060: return "picture string";
-    case 0x0061: return "mutable";
-    case 0x0062: return "threads scaled";
-    case 0x0063: return "explicit";
-    case 0x0064: return "object pointer";
-    case 0x0065: return "endianity";
-    case 0x0066: return "elemental";
-    case 0x0067: return "pure";
-    case 0x0068: return "recursive";
-    case 0x2000: return "lo user";
-    case 0x3fff: return "hi user";
-    case 0x2001: return "MIPS fde";
-    case 0x2002: return "MIPS loop begin";
-    case 0x2003: return "MIPS tail loop begin";
-    case 0x2004: return "MIPS epilog begin";
-    case 0x2005: return "MIPS loop unroll factor";
-    case 0x2006: return "MIPS software pipeline depth";
-    case 0x2007: return "MIPS linkage name";
-    case 0x2008: return "MIPS stride";
-    case 0x2009: return "MIPS abstract name";
-    case 0x200a: return "MIPS clone origin";
-    case 0x200b: return "MIPS has inlines";
-    case 0x2101: return "source file names";
-    case 0x2102: return "source info";
-    case 0x2103: return "macro info";
-    case 0x2104: return "source coordinates";
-    case 0x2105: return "body begin";
-    case 0x2106: return "body end";
-    case 0x2107: return "GNU vector";
-    case 0x2501: return "repository file";
-    case 0x2502: return "repository type";
-    case 0x2503: return "repository name";
-    case 0x2504: return "repository specification";
-    case 0x2505: return "repository import";
-    case 0x2506: return "repository abstract origin";
-    case DW_AT_APPLE_flags: return "Apple gcc compiler flags";
-    case DW_AT_APPLE_optimized: return "APPLE optimized";
-    case DW_AT_APPLE_isa: return "APPLE instruction set architecture";
-    case DW_AT_APPLE_block: return "APPLE block";
-   default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_AT constant: 0x%x", val);
-       return invalid;
-  }
-}
+  const char *llvmstr = AttributeString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_AT constant: 0x%x", val);
+      return invalid;
+  }
+
+  std::string str;
+  if (strncmp (llvmstr, "DW_AT_", 6) == 0)
+    llvmstr += 6;
 
-DRC_class
-DW_AT_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0001: return DRC_REFERENCE;
-    case 0x0002: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0003: return DRC_STRING;
-    case 0x0009: return DRC_CONSTANT;
-    case 0x000b: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x000c: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x000d: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0010: return DRC_LINEPTR;
-    case 0x0011: return DRC_ADDRESS;
-    case 0x0012: return DRC_ADDRESS;
-    case 0x0013: return DRC_CONSTANT;
-    case 0x0015: return DRC_REFERENCE;
-    case 0x0016: return DRC_CONSTANT;
-    case 0x0017: return DRC_CONSTANT;
-    case 0x0018: return DRC_REFERENCE;
-    case 0x0019: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x001a: return DRC_REFERENCE;
-    case 0x001b: return DRC_STRING;
-    case 0x001c: return DRC_BLOCK | DRC_CONSTANT | DRC_STRING;
-    case 0x001d: return DRC_REFERENCE;
-    case 0x001e: return DRC_REFERENCE;
-    case 0x0020: return DRC_CONSTANT;
-    case 0x0021: return DRC_FLAG;
-    case 0x0022: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0025: return DRC_STRING;
-    case 0x0027: return DRC_FLAG;
-    case 0x002a: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x002c: return DRC_CONSTANT;
-    case 0x002e: return DRC_CONSTANT;
-    case 0x002f: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0031: return DRC_REFERENCE;
-    case 0x0032: return DRC_CONSTANT;
-    case 0x0033: return DRC_CONSTANT;
-    case 0x0034: return DRC_FLAG;
-    case 0x0035: return DRC_REFERENCE;
-    case 0x0036: return DRC_CONSTANT;
-    case 0x0037: return DRC_BLOCK | DRC_CONSTANT | DRC_REFERENCE;
-    case 0x0038: return DRC_BLOCK | DRC_CONSTANT | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0039: return DRC_CONSTANT;
-    case 0x003a: return DRC_CONSTANT;
-    case 0x003b: return DRC_CONSTANT;
-    case 0x003c: return DRC_FLAG;
-    case 0x003d: return DRC_BLOCK;
-    case 0x003e: return DRC_CONSTANT;
-    case 0x003f: return DRC_FLAG;
-    case 0x0040: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0041: return DRC_REFERENCE;
-    case 0x0042: return DRC_CONSTANT;
-    case 0x0043: return DRC_MACPTR;
-    case 0x0044: return DRC_BLOCK;
-    case 0x0045: return DRC_REFERENCE;
-    case 0x0046: return DRC_BLOCK | DRC_CONSTANT;
-    case 0x0047: return DRC_REFERENCE;
-    case 0x0048: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x0049: return DRC_REFERENCE;
-    case 0x004a: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x004b: return DRC_FLAG;
-    case 0x004c: return DRC_CONSTANT;
-    case 0x004d: return DRC_BLOCK | DRC_LOCEXPR | DRC_LOCLISTPTR;
-    case 0x004e: return DRC_BLOCK | DRC_CONSTANT | DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x004f: return DRC_BLOCK | DRC_CONSTANT | DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0050: return DRC_BLOCK | DRC_DWARFv3;
-    case 0x0051: return DRC_BLOCK | DRC_CONSTANT | DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0052: return DRC_ADDRESS | DRC_DWARFv3;
-    case 0x0053: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0054: return DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0055: return DRC_DWARFv3 | DRC_RANGELISTPTR;
-    case 0x0056: return DRC_ADDRESS | DRC_DWARFv3 | DRC_FLAG | DRC_REFERENCE | DRC_STRING;
-    case 0x0057: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0058: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0059: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005a: return DRC_DWARFv3 | DRC_STRING;
-    case 0x005b: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005c: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005d: return DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x005e: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x005f: return DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0060: return DRC_DWARFv3 | DRC_STRING;
-    case 0x0061: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0062: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0063: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0064: return DRC_DWARFv3 | DRC_REFERENCE;
-    case 0x0065: return DRC_0x65 | DRC_CONSTANT | DRC_DWARFv3;
-    case 0x0066: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0067: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x0068: return DRC_DWARFv3 | DRC_FLAG;
-    case 0x2000: return 0;
-    case 0x3fff: return 0;
-    case 0x2001: return DRC_VENDOR_MIPS;
-    case 0x2002: return DRC_VENDOR_MIPS;
-    case 0x2003: return DRC_VENDOR_MIPS;
-    case 0x2004: return DRC_VENDOR_MIPS;
-    case 0x2005: return DRC_VENDOR_MIPS;
-    case 0x2006: return DRC_VENDOR_MIPS;
-    case 0x2007: return DRC_STRING | DRC_VENDOR_MIPS;
-    case 0x2008: return DRC_VENDOR_MIPS;
-    case 0x2009: return DRC_VENDOR_MIPS;
-    case 0x200a: return DRC_VENDOR_MIPS;
-    case 0x200b: return DRC_VENDOR_MIPS;
-    default: return 0;
-  }
-}
+  for (const char *i = llvmstr; *i != '\0'; i++)
+    str += *i == '_' ? ' ' : *i;
 
-/* [7.5.4] Figure 19 "Attribute form encodings" (pp. 133-134) in DWARFv3 draft 8 */
+  ConstString const_str (str.c_str());
+  return const_str.GetCString();
+}
 
 const char *
 DW_FORM_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x01: return DW_FORM_PREFIX "addr";
-    case 0x03: return DW_FORM_PREFIX "block2";
-    case 0x04: return DW_FORM_PREFIX "block4";
-    case 0x05: return DW_FORM_PREFIX "data2";
-    case 0x06: return DW_FORM_PREFIX "data4";
-    case 0x07: return DW_FORM_PREFIX "data8";
-    case 0x08: return DW_FORM_PREFIX "string";
-    case 0x09: return DW_FORM_PREFIX "block";
-    case 0x0a: return DW_FORM_PREFIX "block1";
-    case 0x0b: return DW_FORM_PREFIX "data1";
-    case 0x0c: return DW_FORM_PREFIX "flag";
-    case 0x0d: return DW_FORM_PREFIX "sdata";
-    case 0x0e: return DW_FORM_PREFIX "strp";
-    case 0x0f: return DW_FORM_PREFIX "udata";
-    case 0x10: return DW_FORM_PREFIX "ref_addr";
-    case 0x11: return DW_FORM_PREFIX "ref1";
-    case 0x12: return DW_FORM_PREFIX "ref2";
-    case 0x13: return DW_FORM_PREFIX "ref4";
-    case 0x14: return DW_FORM_PREFIX "ref8";
-    case 0x15: return DW_FORM_PREFIX "ref_udata";
-    case 0x16: return DW_FORM_PREFIX "indirect";
-//  case DW_FORM_APPLE_db_str: return DW_FORM_PREFIX "APPLE_db_str";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_FORM constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = FormEncodingString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_FORM constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
 const char *
 DW_FORM_value_to_englishy_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x01: return "addr";
-    case 0x03: return "block2";
-    case 0x04: return "block4";
-    case 0x05: return "data2";
-    case 0x06: return "data4";
-    case 0x07: return "data8";
-    case 0x08: return "string";
-    case 0x09: return "block";
-    case 0x0a: return "block1";
-    case 0x0b: return "data1";
-    case 0x0c: return "flag";
-    case 0x0d: return "sdata";
-    case 0x0e: return "strp";
-    case 0x0f: return "udata";
-    case 0x10: return "ref addr";
-    case 0x11: return "ref1";
-    case 0x12: return "ref2";
-    case 0x13: return "ref4";
-    case 0x14: return "ref8";
-    case 0x15: return "ref udata";
-    case 0x16: return "indirect";
-//  case DW_FORM_APPLE_db_str: return "repository str";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_FORM constant: 0x%x", val);
-       return invalid;
-  }
-}
+  const char *llvmstr = FormEncodingString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_FORM constant: 0x%x", val);
+      return invalid;
+  }
+
+  std::string str;
+  if (strncmp (llvmstr, "DW_FORM_", 8) == 0)
+    llvmstr += 8;
 
-DRC_class
-DW_FORM_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return DRC_ADDRESS;
-    case 0x03: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x04: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x05: return DRC_CONSTANT;
-    case 0x06: return DRC_CONSTANT | DRC_LINEPTR | DRC_LOCLISTPTR | DRC_MACPTR | DRC_RANGELISTPTR;
-    case 0x07: return DRC_CONSTANT | DRC_LINEPTR | DRC_LOCLISTPTR | DRC_MACPTR | DRC_RANGELISTPTR;
-    case 0x08: return DRC_STRING;
-    case 0x09: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x0a: return DRC_BLOCK | DRC_LOCEXPR;
-    case 0x0b: return DRC_CONSTANT;
-    case 0x0c: return DRC_FLAG;
-    case 0x0d: return DRC_CONSTANT;
-    case 0x0e: return DRC_STRING;
-    case 0x0f: return DRC_CONSTANT;
-    case 0x10: return DRC_REFERENCE;
-    case 0x11: return DRC_REFERENCE;
-    case 0x12: return DRC_REFERENCE;
-    case 0x13: return DRC_REFERENCE;
-    case 0x14: return DRC_REFERENCE;
-    case 0x15: return DRC_REFERENCE;
-    case 0x16: return DRC_INDIRECT_SPECIAL;
-    default: return 0;
-  }
-}
+  for (const char *i = llvmstr; *i != '\0'; i++)
+    str += *i == '_' ? ' ' : *i;
 
-/* [7.7.1] Figure 22 "DWARF operation encodings" (pp. 136-139) in DWARFv3 draft 8 */
+  ConstString const_str (str.c_str());
+  return const_str.GetCString();
+}
 
 const char *
 DW_OP_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x03: return "DW_OP_addr";
-    case 0x06: return "DW_OP_deref";
-    case 0x08: return "DW_OP_const1u";
-    case 0x09: return "DW_OP_const1s";
-    case 0x0a: return "DW_OP_const2u";
-    case 0x0b: return "DW_OP_const2s";
-    case 0x0c: return "DW_OP_const4u";
-    case 0x0d: return "DW_OP_const4s";
-    case 0x0e: return "DW_OP_const8u";
-    case 0x0f: return "DW_OP_const8s";
-    case 0x10: return "DW_OP_constu";
-    case 0x11: return "DW_OP_consts";
-    case 0x12: return "DW_OP_dup";
-    case 0x13: return "DW_OP_drop";
-    case 0x14: return "DW_OP_over";
-    case 0x15: return "DW_OP_pick";
-    case 0x16: return "DW_OP_swap";
-    case 0x17: return "DW_OP_rot";
-    case 0x18: return "DW_OP_xderef";
-    case 0x19: return "DW_OP_abs";
-    case 0x1a: return "DW_OP_and";
-    case 0x1b: return "DW_OP_div";
-    case 0x1c: return "DW_OP_minus";
-    case 0x1d: return "DW_OP_mod";
-    case 0x1e: return "DW_OP_mul";
-    case 0x1f: return "DW_OP_neg";
-    case 0x20: return "DW_OP_not";
-    case 0x21: return "DW_OP_or";
-    case 0x22: return "DW_OP_plus";
-    case 0x23: return "DW_OP_plus_uconst";
-    case 0x24: return "DW_OP_shl";
-    case 0x25: return "DW_OP_shr";
-    case 0x26: return "DW_OP_shra";
-    case 0x27: return "DW_OP_xor";
-    case 0x2f: return "DW_OP_skip";
-    case 0x28: return "DW_OP_bra";
-    case 0x29: return "DW_OP_eq";
-    case 0x2a: return "DW_OP_ge";
-    case 0x2b: return "DW_OP_gt";
-    case 0x2c: return "DW_OP_le";
-    case 0x2d: return "DW_OP_lt";
-    case 0x2e: return "DW_OP_ne";
-    case 0x30: return "DW_OP_lit0";
-    case 0x31: return "DW_OP_lit1";
-    case 0x32: return "DW_OP_lit2";
-    case 0x33: return "DW_OP_lit3";
-    case 0x34: return "DW_OP_lit4";
-    case 0x35: return "DW_OP_lit5";
-    case 0x36: return "DW_OP_lit6";
-    case 0x37: return "DW_OP_lit7";
-    case 0x38: return "DW_OP_lit8";
-    case 0x39: return "DW_OP_lit9";
-    case 0x3a: return "DW_OP_lit10";
-    case 0x3b: return "DW_OP_lit11";
-    case 0x3c: return "DW_OP_lit12";
-    case 0x3d: return "DW_OP_lit13";
-    case 0x3e: return "DW_OP_lit14";
-    case 0x3f: return "DW_OP_lit15";
-    case 0x40: return "DW_OP_lit16";
-    case 0x41: return "DW_OP_lit17";
-    case 0x42: return "DW_OP_lit18";
-    case 0x43: return "DW_OP_lit19";
-    case 0x44: return "DW_OP_lit20";
-    case 0x45: return "DW_OP_lit21";
-    case 0x46: return "DW_OP_lit22";
-    case 0x47: return "DW_OP_lit23";
-    case 0x48: return "DW_OP_lit24";
-    case 0x49: return "DW_OP_lit25";
-    case 0x4a: return "DW_OP_lit26";
-    case 0x4b: return "DW_OP_lit27";
-    case 0x4c: return "DW_OP_lit28";
-    case 0x4d: return "DW_OP_lit29";
-    case 0x4e: return "DW_OP_lit30";
-    case 0x4f: return "DW_OP_lit31";
-    case 0x50: return "DW_OP_reg0";
-    case 0x51: return "DW_OP_reg1";
-    case 0x52: return "DW_OP_reg2";
-    case 0x53: return "DW_OP_reg3";
-    case 0x54: return "DW_OP_reg4";
-    case 0x55: return "DW_OP_reg5";
-    case 0x56: return "DW_OP_reg6";
-    case 0x57: return "DW_OP_reg7";
-    case 0x58: return "DW_OP_reg8";
-    case 0x59: return "DW_OP_reg9";
-    case 0x5a: return "DW_OP_reg10";
-    case 0x5b: return "DW_OP_reg11";
-    case 0x5c: return "DW_OP_reg12";
-    case 0x5d: return "DW_OP_reg13";
-    case 0x5e: return "DW_OP_reg14";
-    case 0x5f: return "DW_OP_reg15";
-    case 0x60: return "DW_OP_reg16";
-    case 0x61: return "DW_OP_reg17";
-    case 0x62: return "DW_OP_reg18";
-    case 0x63: return "DW_OP_reg19";
-    case 0x64: return "DW_OP_reg20";
-    case 0x65: return "DW_OP_reg21";
-    case 0x66: return "DW_OP_reg22";
-    case 0x67: return "DW_OP_reg23";
-    case 0x68: return "DW_OP_reg24";
-    case 0x69: return "DW_OP_reg25";
-    case 0x6a: return "DW_OP_reg26";
-    case 0x6b: return "DW_OP_reg27";
-    case 0x6c: return "DW_OP_reg28";
-    case 0x6d: return "DW_OP_reg29";
-    case 0x6e: return "DW_OP_reg30";
-    case 0x6f: return "DW_OP_reg31";
-    case 0x70: return "DW_OP_breg0";
-    case 0x71: return "DW_OP_breg1";
-    case 0x72: return "DW_OP_breg2";
-    case 0x73: return "DW_OP_breg3";
-    case 0x74: return "DW_OP_breg4";
-    case 0x75: return "DW_OP_breg5";
-    case 0x76: return "DW_OP_breg6";
-    case 0x77: return "DW_OP_breg7";
-    case 0x78: return "DW_OP_breg8";
-    case 0x79: return "DW_OP_breg9";
-    case 0x7a: return "DW_OP_breg10";
-    case 0x7b: return "DW_OP_breg11";
-    case 0x7c: return "DW_OP_breg12";
-    case 0x7d: return "DW_OP_breg13";
-    case 0x7e: return "DW_OP_breg14";
-    case 0x7f: return "DW_OP_breg15";
-    case 0x80: return "DW_OP_breg16";
-    case 0x81: return "DW_OP_breg17";
-    case 0x82: return "DW_OP_breg18";
-    case 0x83: return "DW_OP_breg19";
-    case 0x84: return "DW_OP_breg20";
-    case 0x85: return "DW_OP_breg21";
-    case 0x86: return "DW_OP_breg22";
-    case 0x87: return "DW_OP_breg23";
-    case 0x88: return "DW_OP_breg24";
-    case 0x89: return "DW_OP_breg25";
-    case 0x8a: return "DW_OP_breg26";
-    case 0x8b: return "DW_OP_breg27";
-    case 0x8c: return "DW_OP_breg28";
-    case 0x8d: return "DW_OP_breg29";
-    case 0x8e: return "DW_OP_breg30";
-    case 0x8f: return "DW_OP_breg31";
-    case 0x90: return "DW_OP_regx";
-    case 0x91: return "DW_OP_fbreg";
-    case 0x92: return "DW_OP_bregx";
-    case 0x93: return "DW_OP_piece";
-    case 0x94: return "DW_OP_deref_size";
-    case 0x95: return "DW_OP_xderef_size";
-    case 0x96: return "DW_OP_nop";
-    case 0x97: return "DW_OP_push_object_address";
-    case 0x98: return "DW_OP_call2";
-    case 0x99: return "DW_OP_call4";
-    case 0x9a: return "DW_OP_call_ref";
-    case 0xf0: return "DW_OP_APPLE_uninit";
-    case 0xe0: return "DW_OP_lo_user";
-    case 0xff: return "DW_OP_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_OP constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = OperationEncodingString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_OP constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
 const char *
 DW_OP_value_to_englishy_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x03: return "addr";
-    case 0x06: return "deref";
-    case 0x08: return "const1u";
-    case 0x09: return "const1s";
-    case 0x0a: return "const2u";
-    case 0x0b: return "const2s";
-    case 0x0c: return "const4u";
-    case 0x0d: return "const4s";
-    case 0x0e: return "const8u";
-    case 0x0f: return "const8s";
-    case 0x10: return "constu";
-    case 0x11: return "consts";
-    case 0x12: return "dup";
-    case 0x13: return "drop";
-    case 0x14: return "over";
-    case 0x15: return "pick";
-    case 0x16: return "swap";
-    case 0x17: return "rot";
-    case 0x18: return "xderef";
-    case 0x19: return "abs";
-    case 0x1a: return "and";
-    case 0x1b: return "div";
-    case 0x1c: return "minus";
-    case 0x1d: return "mod";
-    case 0x1e: return "mul";
-    case 0x1f: return "neg";
-    case 0x20: return "not";
-    case 0x21: return "or";
-    case 0x22: return "plus";
-    case 0x23: return "plus uconst";
-    case 0x24: return "shl";
-    case 0x25: return "shr";
-    case 0x26: return "shra";
-    case 0x27: return "xor";
-    case 0x2f: return "skip";
-    case 0x28: return "bra";
-    case 0x29: return "eq";
-    case 0x2a: return "ge";
-    case 0x2b: return "gt";
-    case 0x2c: return "le";
-    case 0x2d: return "lt";
-    case 0x2e: return "ne";
-    case 0x30: return "lit0";
-    case 0x31: return "lit1";
-    case 0x32: return "lit2";
-    case 0x33: return "lit3";
-    case 0x34: return "lit4";
-    case 0x35: return "lit5";
-    case 0x36: return "lit6";
-    case 0x37: return "lit7";
-    case 0x38: return "lit8";
-    case 0x39: return "lit9";
-    case 0x3a: return "lit10";
-    case 0x3b: return "lit11";
-    case 0x3c: return "lit12";
-    case 0x3d: return "lit13";
-    case 0x3e: return "lit14";
-    case 0x3f: return "lit15";
-    case 0x40: return "lit16";
-    case 0x41: return "lit17";
-    case 0x42: return "lit18";
-    case 0x43: return "lit19";
-    case 0x44: return "lit20";
-    case 0x45: return "lit21";
-    case 0x46: return "lit22";
-    case 0x47: return "lit23";
-    case 0x48: return "lit24";
-    case 0x49: return "lit25";
-    case 0x4a: return "lit26";
-    case 0x4b: return "lit27";
-    case 0x4c: return "lit28";
-    case 0x4d: return "lit29";
-    case 0x4e: return "lit30";
-    case 0x4f: return "lit31";
-    case 0x50: return "reg0";
-    case 0x51: return "reg1";
-    case 0x52: return "reg2";
-    case 0x53: return "reg3";
-    case 0x54: return "reg4";
-    case 0x55: return "reg5";
-    case 0x56: return "reg6";
-    case 0x57: return "reg7";
-    case 0x58: return "reg8";
-    case 0x59: return "reg9";
-    case 0x5a: return "reg10";
-    case 0x5b: return "reg11";
-    case 0x5c: return "reg12";
-    case 0x5d: return "reg13";
-    case 0x5e: return "reg14";
-    case 0x5f: return "reg15";
-    case 0x60: return "reg16";
-    case 0x61: return "reg17";
-    case 0x62: return "reg18";
-    case 0x63: return "reg19";
-    case 0x64: return "reg20";
-    case 0x65: return "reg21";
-    case 0x66: return "reg22";
-    case 0x67: return "reg23";
-    case 0x68: return "reg24";
-    case 0x69: return "reg25";
-    case 0x6a: return "reg26";
-    case 0x6b: return "reg27";
-    case 0x6c: return "reg28";
-    case 0x6d: return "reg29";
-    case 0x6e: return "reg30";
-    case 0x6f: return "reg31";
-    case 0x70: return "breg0";
-    case 0x71: return "breg1";
-    case 0x72: return "breg2";
-    case 0x73: return "breg3";
-    case 0x74: return "breg4";
-    case 0x75: return "breg5";
-    case 0x76: return "breg6";
-    case 0x77: return "breg7";
-    case 0x78: return "breg8";
-    case 0x79: return "breg9";
-    case 0x7a: return "breg10";
-    case 0x7b: return "breg11";
-    case 0x7c: return "breg12";
-    case 0x7d: return "breg13";
-    case 0x7e: return "breg14";
-    case 0x7f: return "breg15";
-    case 0x80: return "breg16";
-    case 0x81: return "breg17";
-    case 0x82: return "breg18";
-    case 0x83: return "breg19";
-    case 0x84: return "breg20";
-    case 0x85: return "breg21";
-    case 0x86: return "breg22";
-    case 0x87: return "breg23";
-    case 0x88: return "breg24";
-    case 0x89: return "breg25";
-    case 0x8a: return "breg26";
-    case 0x8b: return "breg27";
-    case 0x8c: return "breg28";
-    case 0x8d: return "breg29";
-    case 0x8e: return "breg30";
-    case 0x8f: return "breg31";
-    case 0x90: return "regx";
-    case 0x91: return "fbreg";
-    case 0x92: return "bregx";
-    case 0x93: return "piece";
-    case 0x94: return "deref size";
-    case 0x95: return "xderef size";
-    case 0x96: return "nop";
-    case 0x97: return "push object address";
-    case 0x98: return "call2";
-    case 0x99: return "call4";
-    case 0x9a: return "call ref";
-    case 0xf0: return "uninitialized";
-    case 0xe0: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_OP constant: 0x%x", val);
-       return invalid;
-  }
+  const char *llvmstr = OperationEncodingString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_OP constant: 0x%x", val);
+      return invalid;
+  }
+
+  std::string str;
+  if (strncmp (llvmstr, "DW_OP_", 6) == 0)
+    llvmstr += 6;
+
+  for (const char *i = llvmstr; *i != '\0'; i++)
+    str += *i == '_' ? ' ' : *i;
+
+  ConstString const_str (str.c_str());
+  return const_str.GetCString();
 }
 
 DRC_class
@@ -1210,950 +336,187 @@
   }
 }
 
-/* [7.8] Figure 23 "Base type encoding values" (pp. 140-141) in DWARFv3 draft 8 */
-
 const char *
 DW_ATE_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_ATE_address";
-    case 0x02: return "DW_ATE_boolean";
-    case 0x03: return "DW_ATE_complex_float";
-    case 0x04: return "DW_ATE_float";
-    case 0x05: return "DW_ATE_signed";
-    case 0x06: return "DW_ATE_signed_char";
-    case 0x07: return "DW_ATE_unsigned";
-    case 0x08: return "DW_ATE_unsigned_char";
-    case 0x09: return "DW_ATE_imaginary_float";
-    case 0x80: return "DW_ATE_lo_user";
-    case 0xff: return "DW_ATE_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ATE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ATE_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "address";
-    case 0x02: return "boolean";
-    case 0x03: return "complex float";
-    case 0x04: return "float";
-    case 0x05: return "signed";
-    case 0x06: return "signed char";
-    case 0x07: return "unsigned";
-    case 0x08: return "unsigned char";
-    case 0x09: return "imaginary float";
-    case 0x80: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ATE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ATE_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x04: return 0;
-    case 0x05: return 0;
-    case 0x06: return 0;
-    case 0x07: return 0;
-    case 0x08: return 0;
-    case 0x09: return DRC_DWARFv3;
-    case 0x80: return 0;
-    case 0xff: return 0;
-    default: return 0;
+  const char *llvmstr = AttributeEncodingString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_ATE constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.9] Figure 24 "Accessibility encodings" (p. 141) in DWARFv3 draft 8 */
-
 const char *
 DW_ACCESS_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x1: return "DW_ACCESS_public";
-    case 0x2: return "DW_ACCESS_protected";
-    case 0x3: return "DW_ACCESS_private";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ACCESS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ACCESS_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "public";
-    case 0x2: return "protected";
-    case 0x3: return "private";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ACCESS constant: 0x%x", val);
-       return invalid;
-  }
-}
 
-DRC_class
-DW_ACCESS_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
+  const char *llvmstr = AccessibilityString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_ACCESS constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.10] Figure 25 "Visibility encodings" (p. 142) in DWARFv3 draft 8 */
-
 const char *
 DW_VIS_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x1: return "DW_VIS_local";
-    case 0x2: return "DW_VIS_exported";
-    case 0x3: return "DW_VIS_qualified";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_VIS_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "local";
-    case 0x2: return "exported";
-    case 0x3: return "qualified";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_VIS_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
+  const char *llvmstr = VisibilityString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_VIS constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.11] Figure 26 "Virtuality encodings" (p. 142) in DWARFv3 draft 8 */
-
 const char *
 DW_VIRTUALITY_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_VIRTUALITY_none";
-    case 0x1: return "DW_VIRTUALITY_virtual";
-    case 0x2: return "DW_VIRTUALITY_pure_virtual";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIRTUALITY constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_VIRTUALITY_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "none";
-    case 0x1: return "virtual";
-    case 0x2: return "pure virtual";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_VIRTUALITY constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = VirtualityString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_VIRTUALITY constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-DRC_class
-DW_VIRTUALITY_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    case 0x2: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.12] Figure 27 "Language encodings" (p. 143) in DWARFv3 draft 8 */
-
 const char *
 DW_LANG_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0001: return "DW_LANG_C89";
-    case 0x0002: return "DW_LANG_C";
-    case 0x0003: return "DW_LANG_Ada83";
-    case 0x0004: return "DW_LANG_C_plus_plus";
-    case 0x0005: return "DW_LANG_Cobol74";
-    case 0x0006: return "DW_LANG_Cobol85";
-    case 0x0007: return "DW_LANG_Fortran77";
-    case 0x0008: return "DW_LANG_Fortran90";
-    case 0x0009: return "DW_LANG_Pascal83";
-    case 0x000a: return "DW_LANG_Modula2";
-    case 0x000b: return "DW_LANG_Java";
-    case 0x000c: return "DW_LANG_C99";
-    case 0x000d: return "DW_LANG_Ada95";
-    case 0x000e: return "DW_LANG_Fortran95";
-    case 0x000f: return "DW_LANG_PLI";
-    case 0x0010: return "DW_LANG_ObjC";
-    case 0x0011: return "DW_LANG_ObjC_plus_plus";
-    case 0x0012: return "DW_LANG_UPC";
-    case 0x0013: return "DW_LANG_D";
-    case 0x8000: return "DW_LANG_lo_user";
-    case 0x8001: return "DW_LANG_Mips_Assembler";
-    case 0x8765: return "DW_LANG_Upc";
-    case 0xffff: return "DW_LANG_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LANG constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_LANG_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0001: return "C89";
-    case 0x0002: return "C";
-    case 0x0003: return "Ada83";
-    case 0x0004: return "C++";
-    case 0x0005: return "Cobol74";
-    case 0x0006: return "Cobol85";
-    case 0x0007: return "Fortran77";
-    case 0x0008: return "Fortran90";
-    case 0x0009: return "Pascal83";
-    case 0x000a: return "Modula2";
-    case 0x000b: return "Java";
-    case 0x000c: return "C99";
-    case 0x000d: return "Ada95";
-    case 0x000e: return "Fortran95";
-    case 0x000f: return "PLI";
-    case 0x0010: return "Objective C";
-    case 0x0011: return "Objective C++";
-    case 0x0012: return "UPC";
-    case 0x0013: return "D";
-    case 0x8000: return "lo user";
-    case 0x8001: return "MIPS Assembler";
-    case 0x8765: return "UPC";
-    case 0xffff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LANG constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_LANG_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0001: return 0;
-    case 0x0002: return 0;
-    case 0x0003: return 0;
-    case 0x0004: return 0;
-    case 0x0005: return 0;
-    case 0x0006: return 0;
-    case 0x0007: return 0;
-    case 0x0008: return 0;
-    case 0x0009: return 0;
-    case 0x000a: return 0;
-    case 0x000b: return DRC_DWARFv3;
-    case 0x000c: return DRC_DWARFv3;
-    case 0x000d: return DRC_DWARFv3;
-    case 0x000e: return DRC_DWARFv3;
-    case 0x000f: return DRC_DWARFv3;
-    case 0x0010: return DRC_DWARFv3;
-    case 0x0011: return DRC_DWARFv3;
-    case 0x0012: return DRC_DWARFv3;
-    case 0x0013: return DRC_DWARFv3;
-    case 0x8000: return 0;
-    case 0x8001: return 0;
-    case 0x8765: return 0;
-    case 0xffff: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.13], "Address Class Encodings" (p. 144) in DWARFv3 draft 8 */
-
-const char *
-DW_ADDR_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_ADDR_none";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ADDR constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ADDR_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "none";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ADDR constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ADDR_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    default: return 0;
+  const char *llvmstr = LanguageString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_LANG constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.14] Figure 28 "Identifier case encodings" (p. 144) in DWARFv3 draft 8 */
-
 const char *
 DW_ID_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_ID_case_sensitive";
-    case 0x1: return "DW_ID_up_case";
-    case 0x2: return "DW_ID_down_case";
-    case 0x3: return "DW_ID_case_insensitive";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ID constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = CaseString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_ID constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
 const char *
-DW_ID_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "case sensitive";
-    case 0x1: return "up case";
-    case 0x2: return "down case";
-    case 0x3: return "case insensitive";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ID constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ID_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
-  }
-}
-
-/* [7.15] Figure 29 "Calling convention encodings" (p. 144) in DWARFv3 draft 8 */
-
-const char *
 DW_CC_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_CC_normal";
-    case 0x02: return "DW_CC_program";
-    case 0x03: return "DW_CC_nocall";
-    case 0x40: return "DW_CC_lo_user";
-    case 0xff: return "DW_CC_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_CC_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "normal";
-    case 0x02: return "program";
-    case 0x03: return "nocall";
-    case 0x40: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_CC_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x40: return 0;
-    case 0xff: return 0;
-    default: return 0;
+  const char *llvmstr = ConventionString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_CC constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.16] Figure 30 "Inline encodings" (p. 145) in DWARFv3 draft 8 */
-
 const char *
 DW_INL_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_INL_not_inlined";
-    case 0x1: return "DW_INL_inlined";
-    case 0x2: return "DW_INL_declared_not_inlined";
-    case 0x3: return "DW_INL_declared_inlined";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_INL constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_INL_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "not inlined";
-    case 0x1: return "inlined";
-    case 0x2: return "declared not inlined";
-    case 0x3: return "declared inlined";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_INL constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_INL_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    default: return 0;
+  const char *llvmstr = InlineCodeString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_INL constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.17] Figure 31 "Ordering encodings" (p. 145) in DWARFv3 draft 8 */
-
 const char *
 DW_ORD_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_ORD_row_major";
-    case 0x1: return "DW_ORD_col_major";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ORD constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_ORD_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "row major";
-    case 0x1: return "col major";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_ORD constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_ORD_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    default: return 0;
+  const char *llvmstr = ArrayOrderString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_ORD constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.18] Figure 32 "Discriminant descriptor encodings" (p. 146) in DWARFv3 draft 8 */
-
 const char *
 DW_DSC_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x0: return "DW_DSC_label";
-    case 0x1: return "DW_DSC_range";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_DSC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_DSC_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x0: return "label";
-    case 0x1: return "range";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_DSC constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_DSC_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x0: return 0;
-    case 0x1: return 0;
-    default: return 0;
+  const char *llvmstr = DiscriminantString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_DSC constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.21] Figure 33 "Line Number Standard Opcode Encodings" (pp. 148-149) in DWARFv3 draft 8 */
-
 const char *
 DW_LNS_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x1: return "DW_LNS_copy";
-    case 0x2: return "DW_LNS_advance_pc";
-    case 0x3: return "DW_LNS_advance_line";
-    case 0x4: return "DW_LNS_set_file";
-    case 0x5: return "DW_LNS_set_column";
-    case 0x6: return "DW_LNS_negate_stmt";
-    case 0x7: return "DW_LNS_set_basic_block";
-    case 0x8: return "DW_LNS_const_add_pc";
-    case 0x9: return "DW_LNS_fixed_advance_pc";
-    case 0xa: return "DW_LNS_set_prologue_end";
-    case 0xb: return "DW_LNS_set_epilogue_begin";
-    case 0xc: return "DW_LNS_set_isa";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNS constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = LNStandardString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_LNS constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
 const char *
-DW_LNS_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x1: return "copy";
-    case 0x2: return "advance pc";
-    case 0x3: return "advance line";
-    case 0x4: return "set file";
-    case 0x5: return "set column";
-    case 0x6: return "negate stmt";
-    case 0x7: return "set basic block";
-    case 0x8: return "const add pc";
-    case 0x9: return "fixed advance pc";
-    case 0xa: return "set prologue end";
-    case 0xb: return "set epilogue begin";
-    case 0xc: return "set isa";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNS constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_LNS_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x1: return 0;
-    case 0x2: return 0;
-    case 0x3: return 0;
-    case 0x4: return 0;
-    case 0x5: return 0;
-    case 0x6: return 0;
-    case 0x7: return 0;
-    case 0x8: return 0;
-    case 0x9: return 0;
-    case 0xa: return DRC_DWARFv3;
-    case 0xb: return DRC_DWARFv3;
-    case 0xc: return DRC_DWARFv3;
-    default: return 0;
-  }
-}
-
-/* [7.21] Figure 34 "Line Number Extended Opcode Encodings" (p. 149) in DWARFv3 draft 8 */
-
-const char *
 DW_LNE_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_LNE_end_sequence";
-    case 0x02: return "DW_LNE_set_address";
-    case 0x03: return "DW_LNE_define_file";
-    case 0x80: return "DW_LNE_lo_user";
-    case 0xff: return "DW_LNE_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_LNE_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "end sequence";
-    case 0x02: return "set address";
-    case 0x03: return "define file";
-    case 0x80: return "lo user";
-    case 0xff: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_LNE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_LNE_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x80: return DRC_DWARFv3;
-    case 0xff: return DRC_DWARFv3;
-    default: return 0;
+  const char *llvmstr = LNExtendedString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_LNE constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.22] Figure 35 "Macinfo Type Encodings" (p. 150) in DWARFv3 draft 8 */
-
 const char *
 DW_MACINFO_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x01: return "DW_MACINFO_define";
-    case 0x02: return "DW_MACINFO_undef";
-    case 0x03: return "DW_MACINFO_start_file";
-    case 0x04: return "DW_MACINFO_end_file";
-    case 0xff: return "DW_MACINFO_vendor_ext";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_MACINFO constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_MACINFO_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x01: return "define";
-    case 0x02: return "undef";
-    case 0x03: return "start file";
-    case 0x04: return "end file";
-    case 0xff: return "vendor ext";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_MACINFO constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_MACINFO_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x01: return 0;
-    case 0x02: return 0;
-    case 0x03: return 0;
-    case 0x04: return 0;
-    case 0xff: return 0;
-    default: return 0;
+  const char *llvmstr = MacinfoString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_MACINFO constant: 0x%x", val);
+      return invalid;
   }
+  return llvmstr;
 }
 
-/* [7.23] Figure 36 "Call frame instruction encodings" (pp. 151-152) in DWARFv3 draft 8 */
-
 const char *
 DW_CFA_value_to_name (uint32_t val)
 {
   static char invalid[100];
-  switch (val) {
-    case 0x40: return "DW_CFA_advance_loc";
-    case 0x80: return "DW_CFA_offset";
-    case 0xc0: return "DW_CFA_restore";
-    case 0x00: return "DW_CFA_nop";
-    case 0x01: return "DW_CFA_set_loc";
-    case 0x02: return "DW_CFA_advance_loc1";
-    case 0x03: return "DW_CFA_advance_loc2";
-    case 0x04: return "DW_CFA_advance_loc4";
-    case 0x05: return "DW_CFA_offset_extended";
-    case 0x06: return "DW_CFA_restore_extended";
-    case 0x07: return "DW_CFA_undefined";
-    case 0x08: return "DW_CFA_same_value";
-    case 0x09: return "DW_CFA_register";
-    case 0x0a: return "DW_CFA_remember_state";
-    case 0x0b: return "DW_CFA_restore_state";
-    case 0x0c: return "DW_CFA_def_cfa";
-    case 0x0d: return "DW_CFA_def_cfa_register";
-    case 0x0e: return "DW_CFA_def_cfa_offset";
-    case 0x0f: return "DW_CFA_def_cfa_expression";
-    case 0x10: return "DW_CFA_expression";
-    case 0x11: return "DW_CFA_offset_extended_sf";
-    case 0x12: return "DW_CFA_def_cfa_sf";
-    case 0x13: return "DW_CFA_def_cfa_offset_sf";
-    case 0x1c: return "DW_CFA_lo_user";
-    case 0x3f: return "DW_CFA_hi_user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CFA constant: 0x%x", val);
-       return invalid;
+  const char *llvmstr = CallFrameString (val);
+  if (llvmstr == NULL)
+  {
+      snprintf (invalid, sizeof (invalid), "Unknown DW_CFA constant: 0x%x", val);
+      return invalid;
   }
-}
-
-const char *
-DW_CFA_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x40: return "advance loc";
-    case 0x80: return "offset";
-    case 0xc0: return "restore";
-    case 0x00: return "nop";
-    case 0x01: return "set loc";
-    case 0x02: return "advance loc1";
-    case 0x03: return "advance loc2";
-    case 0x04: return "advance loc4";
-    case 0x05: return "offset extended";
-    case 0x06: return "restore extended";
-    case 0x07: return "undefined";
-    case 0x08: return "same value";
-    case 0x09: return "register";
-    case 0x0a: return "remember state";
-    case 0x0b: return "restore state";
-    case 0x0c: return "def cfa";
-    case 0x0d: return "def cfa register";
-    case 0x0e: return "def cfa offset";
-    case 0x0f: return "def cfa expression";
-    case 0x10: return "expression";
-    case 0x11: return "offset extended sf";
-    case 0x12: return "def cfa sf";
-    case 0x13: return "def cfa offset sf";
-    case 0x1c: return "lo user";
-    case 0x3f: return "hi user";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_CFA constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_CFA_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x40: return DRC_ZEROOPERANDS;
-    case 0x80: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_OFFSET;
-    case 0xc0: return DRC_ZEROOPERANDS;
-    case 0x00: return DRC_ZEROOPERANDS;
-    case 0x01: return DRC_ONEOPERAND | DRC_OPERANDONE_ADDRESS;
-    case 0x02: return DRC_ONEOPERAND | DRC_OPERANDONE_1BYTE_DELTA;
-    case 0x03: return DRC_ONEOPERAND | DRC_OPERANDONE_2BYTE_DELTA;
-    case 0x04: return DRC_ONEOPERAND | DRC_OPERANDONE_4BYTE_DELTA;
-    case 0x05: return DRC_OPERANDTWO_ULEB128_OFFSET | DRC_OPERNADONE_ULEB128_REGISTER | DRC_TWOOPERANDS;
-    case 0x06: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x07: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x08: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x09: return DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_ULEB128_REGISTER | DRC_TWOOPERANDS;
-    case 0x0a: return DRC_ZEROOPERANDS;
-    case 0x0b: return DRC_ZEROOPERANDS;
-    case 0x0c: return DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_ULEB128_OFFSET | DRC_TWOOPERANDS;
-    case 0x0d: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_REGISTER;
-    case 0x0e: return DRC_ONEOPERAND | DRC_OPERANDONE_ULEB128_OFFSET;
-    case 0x0f: return DRC_DWARFv3 | DRC_ONEOPERAND | DRC_OPERANDONE_BLOCK;
-    case 0x10: return DRC_DWARFv3 | DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_BLOCK | DRC_TWOOPERANDS;
-    case 0x11: return DRC_DWARFv3 | DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_SLEB128_OFFSET | DRC_TWOOPERANDS;
-    case 0x12: return DRC_DWARFv3 | DRC_OPERANDONE_ULEB128_REGISTER | DRC_OPERANDTWO_SLEB128_OFFSET | DRC_TWOOPERANDS;
-    case 0x13: return DRC_DWARFv3 | DRC_ONEOPERAND | DRC_OPERANDONE_SLEB128_OFFSET;
-    case 0x1c: return 0;
-    case 0x3f: return 0;
-    default: return 0;
-  }
-}
-
-/* FSF exception handling Pointer-Encoding constants (CFI augmentation) -- "DW_EH_PE_..." in the FSF sources */
-
-const char *
-DW_GNU_EH_PE_value_to_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x00: return "DW_GNU_EH_PE_absptr";
-    case 0x01: return "DW_GNU_EH_PE_uleb128";
-    case 0x02: return "DW_GNU_EH_PE_udata2";
-    case 0x03: return "DW_GNU_EH_PE_udata4";
-    case 0x04: return "DW_GNU_EH_PE_udata8";
-    case 0x09: return "DW_GNU_EH_PE_sleb128";
-    case 0x0a: return "DW_GNU_EH_PE_sdata2";
-    case 0x0b: return "DW_GNU_EH_PE_sdata4";
-    case 0x0c: return "DW_GNU_EH_PE_sdata8";
-    case 0x08: return "DW_GNU_EH_PE_signed";
-    case 0x10: return "DW_GNU_EH_PE_pcrel";
-    case 0x20: return "DW_GNU_EH_PE_textrel";
-    case 0x30: return "DW_GNU_EH_PE_datarel";
-    case 0x40: return "DW_GNU_EH_PE_funcrel";
-    case 0x50: return "DW_GNU_EH_PE_aligned";
-    case 0x80: return "DW_GNU_EH_PE_indirect";
-    case 0xff: return "DW_GNU_EH_PE_omit";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_GNU_EH_PE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-const char *
-DW_GNU_EH_PE_value_to_englishy_name (uint32_t val)
-{
-  static char invalid[100];
-  switch (val) {
-    case 0x00: return "absptr";
-    case 0x01: return "uleb128";
-    case 0x02: return "udata2";
-    case 0x03: return "udata4";
-    case 0x04: return "udata8";
-    case 0x09: return "sleb128";
-    case 0x0a: return "sdata2";
-    case 0x0b: return "sdata4";
-    case 0x0c: return "sdata8";
-    case 0x08: return "signed";
-    case 0x10: return "pcrel";
-    case 0x20: return "textrel";
-    case 0x30: return "datarel";
-    case 0x40: return "funcrel";
-    case 0x50: return "aligned";
-    case 0x80: return "indirect";
-    case 0xff: return "omit";
-    default:
-       snprintf (invalid, sizeof(invalid), "Unknown DW_GNU_EH_PE constant: 0x%x", val);
-       return invalid;
-  }
-}
-
-DRC_class
-DW_GNU_EH_PE_value_to_class (uint32_t val)
-{
-  switch (val) {
-    case 0x00: return DRC_VENDOR_GNU;
-    case 0x01: return DRC_VENDOR_GNU;
-    case 0x02: return DRC_VENDOR_GNU;
-    case 0x03: return DRC_VENDOR_GNU;
-    case 0x04: return DRC_VENDOR_GNU;
-    case 0x09: return DRC_VENDOR_GNU;
-    case 0x0a: return DRC_VENDOR_GNU;
-    case 0x0b: return DRC_VENDOR_GNU;
-    case 0x0c: return DRC_VENDOR_GNU;
-    case 0x08: return DRC_VENDOR_GNU;
-    case 0x10: return DRC_VENDOR_GNU;
-    case 0x20: return DRC_VENDOR_GNU;
-    case 0x30: return DRC_VENDOR_GNU;
-    case 0x40: return DRC_VENDOR_GNU;
-    case 0x50: return DRC_VENDOR_GNU;
-    case 0x80: return DRC_VENDOR_GNU;
-    case 0xff: return DRC_VENDOR_GNU;
-    default: return 0;
-  }
-}
-
-bool
-is_type_tag (uint16_t tag)
-{
-  switch (tag)
-    {
-      case DW_TAG_array_type:
-      case DW_TAG_base_type:
-      case DW_TAG_class_type:
-      case DW_TAG_const_type:
-      case DW_TAG_enumeration_type:
-      case DW_TAG_file_type:
-      case DW_TAG_interface_type:
-      case DW_TAG_packed_type:
-      case DW_TAG_pointer_type:
-      case DW_TAG_ptr_to_member_type:
-      case DW_TAG_reference_type:
-      case DW_TAG_restrict_type:
-      case DW_TAG_set_type:
-      case DW_TAG_shared_type:
-      case DW_TAG_string_type:
-      case DW_TAG_structure_type:
-      case DW_TAG_subrange_type:
-      case DW_TAG_subroutine_type:
-      case DW_TAG_thrown_type:
-      case DW_TAG_union_type:
-      case DW_TAG_unspecified_type:
-      case DW_TAG_volatile_type:
-        return true;
-      default:
-        return false;
-    }
-}
-
-bool
-is_pubtype_tag (uint16_t tag)
-{
-  switch (tag)
-    {
-      case DW_TAG_array_type:
-      case DW_TAG_class_type:
-      case DW_TAG_enumeration_type:
-      case DW_TAG_file_type:
-      case DW_TAG_interface_type:
-      case DW_TAG_set_type:
-      case DW_TAG_string_type:
-      case DW_TAG_structure_type:
-      case DW_TAG_subrange_type:
-      case DW_TAG_subroutine_type:
-      case DW_TAG_thrown_type:
-      case DW_TAG_typedef:
-      case DW_TAG_union_type:
-      case DW_TAG_unspecified_type:
-        return true;
-      default:
-        break;
-    }
-  return false;
+  return llvmstr;
 }
 
 DW_TAG_CategoryEnum
@@ -2222,3 +585,5 @@
     return TagCategoryProgram;
 }
 
+} // namespace lldb_private
+

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h Tue Jul  6 17:38:03 2010
@@ -10,21 +10,14 @@
 #ifndef liblldb_DWARFDefines_h_
 #define liblldb_DWARFDefines_h_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <stdint.h>
 #include <stdbool.h>
 #include "lldb/Core/dwarf.h"
 
-/* DWARF constants generated on Wed Sep  7 16:41:50 2005 */
+namespace lldb_private {
 
 typedef uint32_t DRC_class;          // Holds DRC_* class bitfields
 
-/* [7.5.4] Figure 16 "Tag Encodings" (pp. 125-127) in DWARFv3 draft 8 */
-
-
 enum DW_TAG_Category
 {
     TagCategoryVariable,
@@ -36,171 +29,49 @@
 typedef enum DW_TAG_Category DW_TAG_CategoryEnum;
 const char *DW_TAG_value_to_name (uint32_t val);
 const char *DW_TAG_value_to_englishy_name (uint32_t val);
-DRC_class DW_TAG_value_to_class (uint32_t val);
 DW_TAG_CategoryEnum get_tag_category (uint16_t tag);
-#define DW_TAG_MAX_NAME_LENGTH 31
-
-
-/* [7.5.4] Figure 17 "Child determination encodings" (p. 128) in DWARFv3 draft 8 */
 
 const char *DW_CHILDREN_value_to_name (uint8_t val);
-const char *DW_CHILDREN_value_to_englishy_name (uint8_t val);
-DRC_class DW_CHILDREN_value_to_class (uint32_t val);
-#define DW_CHILDREN_MAX_NAME_LENGTH 15
-
-
-/* [7.5.4] Figure 18 "Attribute encodings" (pp. 129-132) in DWARFv3 draft 8 */
-
 
 const char *DW_AT_value_to_name (uint32_t val);
 const char *DW_AT_value_to_englishy_name (uint32_t val);
-DRC_class DW_AT_value_to_class (uint32_t val);
-#define DW_AT_MAX_NAME_LENGTH 34
-
-
-/* [7.5.4] Figure 19 "Attribute form encodings" (pp. 133-134) in DWARFv3 draft 8 */
 
 const char *DW_FORM_value_to_name (uint32_t val);
 const char *DW_FORM_value_to_englishy_name (uint32_t val);
-DRC_class DW_FORM_value_to_class (uint32_t val);
-#define DW_FORM_MAX_NAME_LENGTH 17
-
-
-/* [7.7.1] Figure 22 "DWARF operation encodings" (pp. 136-139) in DWARFv3 draft 8 */
 
 const char *DW_OP_value_to_name (uint32_t val);
 const char *DW_OP_value_to_englishy_name (uint32_t val);
 DRC_class DW_OP_value_to_class (uint32_t val);
-#define DW_OP_MAX_NAME_LENGTH 25
-
-
-/* [7.8] Figure 23 "Base type encoding values" (pp. 140-141) in DWARFv3 draft 8 */
 
 const char *DW_ATE_value_to_name (uint32_t val);
-const char *DW_ATE_value_to_englishy_name (uint32_t val);
-DRC_class DW_ATE_value_to_class (uint32_t val);
-#define DW_ATE_MAX_NAME_LENGTH 22
-
-
-/* [7.9] Figure 24 "Accessibility encodings" (p. 141) in DWARFv3 draft 8 */
 
 const char *DW_ACCESS_value_to_name (uint32_t val);
-const char *DW_ACCESS_value_to_englishy_name (uint32_t val);
-DRC_class DW_ACCESS_value_to_class (uint32_t val);
-#define DW_ACCESS_MAX_NAME_LENGTH 19
-
-
-/* [7.10] Figure 25 "Visibility encodings" (p. 142) in DWARFv3 draft 8 */
 
 const char *DW_VIS_value_to_name (uint32_t val);
-const char *DW_VIS_value_to_englishy_name (uint32_t val);
-DRC_class DW_VIS_value_to_class (uint32_t val);
-#define DW_VIS_MAX_NAME_LENGTH 16
-
-
-/* [7.11] Figure 26 "Virtuality encodings" (p. 142) in DWARFv3 draft 8 */
 
 const char *DW_VIRTUALITY_value_to_name (uint32_t val);
-const char *DW_VIRTUALITY_value_to_englishy_name (uint32_t val);
-DRC_class DW_VIRTUALITY_value_to_class (uint32_t val);
-#define DW_VIRTUALITY_MAX_NAME_LENGTH 26
-
-
-/* [7.12] Figure 27 "Language encodings" (p. 143) in DWARFv3 draft 8 */
 
 const char *DW_LANG_value_to_name (uint32_t val);
-const char *DW_LANG_value_to_englishy_name (uint32_t val);
-DRC_class DW_LANG_value_to_class (uint32_t val);
-#define DW_LANG_MAX_NAME_LENGTH 19
-
-
-/* [7.13], "Address Class Encodings" (p. 144) in DWARFv3 draft 8 */
-
-const char *DW_ADDR_value_to_name (uint32_t val);
-const char *DW_ADDR_value_to_englishy_name (uint32_t val);
-DRC_class DW_ADDR_value_to_class (uint32_t val);
-#define DW_ADDR_MAX_NAME_LENGTH 12
-
-
-/* [7.14] Figure 28 "Identifier case encodings" (p. 144) in DWARFv3 draft 8 */
 
 const char *DW_ID_value_to_name (uint32_t val);
-const char *DW_ID_value_to_englishy_name (uint32_t val);
-DRC_class DW_ID_value_to_class (uint32_t val);
-#define DW_ID_MAX_NAME_LENGTH 22
-
-
-/* [7.15] Figure 29 "Calling convention encodings" (p. 144) in DWARFv3 draft 8 */
 
 const char *DW_CC_value_to_name (uint32_t val);
-const char *DW_CC_value_to_englishy_name (uint32_t val);
-DRC_class DW_CC_value_to_class (uint32_t val);
-#define DW_CC_MAX_NAME_LENGTH 13
-
-
-/* [7.16] Figure 30 "Inline encodings" (p. 145) in DWARFv3 draft 8 */
 
 const char *DW_INL_value_to_name (uint32_t val);
-const char *DW_INL_value_to_englishy_name (uint32_t val);
-DRC_class DW_INL_value_to_class (uint32_t val);
-#define DW_INL_MAX_NAME_LENGTH 27
-
-
-/* [7.17] Figure 31 "Ordering encodings" (p. 145) in DWARFv3 draft 8 */
 
 const char *DW_ORD_value_to_name (uint32_t val);
-const char *DW_ORD_value_to_englishy_name (uint32_t val);
-DRC_class DW_ORD_value_to_class (uint32_t val);
-#define DW_ORD_MAX_NAME_LENGTH 16
-
-
-/* [7.18] Figure 32 "Discriminant descriptor encodings" (p. 146) in DWARFv3 draft 8 */
 
 const char *DW_DSC_value_to_name (uint32_t val);
-const char *DW_DSC_value_to_englishy_name (uint32_t val);
-DRC_class DW_DSC_value_to_class (uint32_t val);
-#define DW_DSC_MAX_NAME_LENGTH 12
-
-
-/* [7.21] Figure 33 "Line Number Standard Opcode Encodings" (pp. 148-149) in DWARFv3 draft 8 */
 
 const char *DW_LNS_value_to_name (uint32_t val);
-const char *DW_LNS_value_to_englishy_name (uint32_t val);
-DRC_class DW_LNS_value_to_class (uint32_t val);
-#define DW_LNS_MAX_NAME_LENGTH 25
-
-
-/* [7.21] Figure 34 "Line Number Extended Opcode Encodings" (p. 149) in DWARFv3 draft 8 */
 
 const char *DW_LNE_value_to_name (uint32_t val);
-const char *DW_LNE_value_to_englishy_name (uint32_t val);
-DRC_class DW_LNE_value_to_class (uint32_t val);
-#define DW_LNE_MAX_NAME_LENGTH 19
-
-
-/* [7.22] Figure 35 "Macinfo Type Encodings" (p. 150) in DWARFv3 draft 8 */
 
 const char *DW_MACINFO_value_to_name (uint32_t val);
-const char *DW_MACINFO_value_to_englishy_name (uint32_t val);
-DRC_class DW_MACINFO_value_to_class (uint32_t val);
-#define DW_MACINFO_MAX_NAME_LENGTH 21
-
-
-/* [7.23] Figure 36 "Call frame instruction encodings" (pp. 151-152) in DWARFv3 draft 8 */
 
 const char *DW_CFA_value_to_name (uint32_t val);
-const char *DW_CFA_value_to_englishy_name (uint32_t val);
-DRC_class DW_CFA_value_to_class (uint32_t val);
-#define DW_CFA_MAX_NAME_LENGTH 25
-
-
-/* FSF exception handling Pointer-Encoding constants (CFI augmentation) -- "DW_EH_PE_..." in the FSF sources */
 
 const char *DW_GNU_EH_PE_value_to_name (uint32_t val);
-const char *DW_GNU_EH_PE_value_to_englishy_name (uint32_t val);
-DRC_class DW_GNU_EH_PE_value_to_class (uint32_t val);
-#define DW_GNU_EH_PE_MAX_NAME_LENGTH 21
-
 
 /* These DRC are entirely our own construction,
     although they are derived from various comments in the DWARF standard.
@@ -240,13 +111,7 @@
 #define DRC_VENDOR_MIPS                 0x40000000
 #define DRC_ZEROOPERANDS                0x80000000
 
-bool is_type_tag (uint16_t tag);
-bool is_pubtype_tag (uint16_t tag);
-
-
-#ifdef __cplusplus
-}
-#endif
+} // namespace lldb_private
 
 
 #endif  // liblldb_DWARFDefines_h_

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue Jul  6 17:38:03 2010
@@ -21,6 +21,7 @@
 #include "llvm/ADT/DenseMap.h"
 
 #include "lldb/Core/ConstString.h"
+#include "lldb/Core/dwarf.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Flags.h"
 #include "lldb/Core/UniqueCStringMap.h"

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Jul  6 17:38:03 2010
@@ -27,7 +27,6 @@
 #include "clang/Frontend/FrontendOptions.h"
 #include "clang/Frontend/LangStandard.h"
 
-// Project includes
 #include "lldb/Core/dwarf.h"
 
 #include <stdio.h>
@@ -36,7 +35,6 @@
 using namespace llvm;
 using namespace clang;
 
-
 static void
 ParseLangArgs
 (

Modified: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp?rev=107716&r1=107715&r2=107716&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Tue Jul  6 17:38:03 2010
@@ -353,7 +353,7 @@
     return_addr_reg_num (0),
     inst_offset (0),
     inst_length (0),
-    ptr_encoding (DW_GNU_EH_PE_absptr)
+    ptr_encoding (DW_EH_PE_absptr)
 {
 }
 
@@ -456,7 +456,7 @@
         //    cie.offset = cie_offset;
         //    cie.length = length;
         //    cie.cieID = cieID;
-        cie_sp->ptr_encoding = DW_GNU_EH_PE_absptr;
+        cie_sp->ptr_encoding = DW_EH_PE_absptr;
         cie_sp->version = m_cfi_data.GetU8(&offset);
 
         for (i=0; i<CFI_AUG_MAX_SIZE; ++i)
@@ -584,7 +584,7 @@
         const lldb::addr_t text_addr = LLDB_INVALID_ADDRESS;
         const lldb::addr_t data_addr = LLDB_INVALID_ADDRESS;
         lldb::addr_t range_base = m_cfi_data.GetGNUEHPointer(&offset, cie->ptr_encoding, pc_rel_addr, text_addr, data_addr);
-        lldb::addr_t range_len = m_cfi_data.GetGNUEHPointer(&offset, cie->ptr_encoding & DW_GNU_EH_PE_MASK_ENCODING, pc_rel_addr, text_addr, data_addr);
+        lldb::addr_t range_len = m_cfi_data.GetGNUEHPointer(&offset, cie->ptr_encoding & DW_EH_PE_MASK_ENCODING, pc_rel_addr, text_addr, data_addr);
 
         if (cie->augmentation[0] == 'z')
         {
@@ -680,7 +680,7 @@
                 const CIE* cie = GetCIE(cie_offset);
                 assert(cie);
                 lldb::addr_t addr = m_cfi_data.GetGNUEHPointer(&offset, cie->ptr_encoding, pc_rel_addr, text_addr, data_addr);
-                lldb::addr_t length = m_cfi_data.GetGNUEHPointer(&offset, cie->ptr_encoding & DW_GNU_EH_PE_MASK_ENCODING, pc_rel_addr, text_addr, data_addr);
+                lldb::addr_t length = m_cfi_data.GetGNUEHPointer(&offset, cie->ptr_encoding & DW_EH_PE_MASK_ENCODING, pc_rel_addr, text_addr, data_addr);
                 m_fde_map[VMRange(addr, addr + length)] = FDEInfo(curr_offset);
             }
 





More information about the lldb-commits mailing list