module Data.Dwarf.AT where
import Data.Dwarf.Types
import Data.Int (Int64)
import Data.Word (Word64)
import qualified Data.ByteString as B
data DW_ATVAL
= DW_ATVAL_INT Int64
| DW_ATVAL_UINT Word64
| DW_ATVAL_REF DieID
| DW_ATVAL_STRING String
| DW_ATVAL_BLOB B.ByteString
| DW_ATVAL_BOOL Bool
deriving (Eq, Ord, Show)
data DW_AT
= DW_AT_sibling
| DW_AT_location
| DW_AT_name
| DW_AT_ordering
| DW_AT_byte_size
| DW_AT_bit_offset
| DW_AT_bit_size
| DW_AT_stmt_list
| DW_AT_low_pc
| DW_AT_high_pc
| DW_AT_language
| DW_AT_discr
| DW_AT_discr_value
| DW_AT_visibility
| DW_AT_import
| DW_AT_string_length
| DW_AT_common_reference
| DW_AT_comp_dir
| DW_AT_const_value
| DW_AT_containing_type
| DW_AT_default_value
| DW_AT_inline
| DW_AT_is_optional
| DW_AT_lower_bound
| DW_AT_producer
| DW_AT_prototyped
| DW_AT_return_addr
| DW_AT_start_scope
| DW_AT_bit_stride
| DW_AT_upper_bound
| DW_AT_abstract_origin
| DW_AT_accessibility
| DW_AT_address_class
| DW_AT_artificial
| DW_AT_base_types
| DW_AT_calling_convention
| DW_AT_count
| DW_AT_data_member_location
| DW_AT_decl_column
| DW_AT_decl_file
| DW_AT_decl_line
| DW_AT_declaration
| DW_AT_discr_list
| DW_AT_encoding
| DW_AT_external
| DW_AT_frame_base
| DW_AT_friend
| DW_AT_identifier_case
| DW_AT_macro_info
| DW_AT_namelist_item
| DW_AT_priority
| DW_AT_segment
| DW_AT_specification
| DW_AT_static_link
| DW_AT_type
| DW_AT_use_location
| DW_AT_variable_parameter
| DW_AT_virtuality
| DW_AT_vtable_elem_location
| DW_AT_allocated
| DW_AT_associated
| DW_AT_data_location
| DW_AT_byte_stride
| DW_AT_entry_pc
| DW_AT_use_UTF8
| DW_AT_extension
| DW_AT_ranges
| DW_AT_trampoline
| DW_AT_call_column
| DW_AT_call_file
| DW_AT_call_line
| DW_AT_description
| DW_AT_binary_scale
| DW_AT_decimal_scale
| DW_AT_small
| DW_AT_decimal_sign
| DW_AT_digit_count
| DW_AT_picture_string
| DW_AT_mutable
| DW_AT_threads_scaled
| DW_AT_explicit
| DW_AT_object_pointer
| DW_AT_endianity
| DW_AT_elemental
| DW_AT_return
| DW_AT_recursive
| DW_AT_user Word64
deriving (Eq, Ord, Read, Show)
dw_at :: Word64 -> DW_AT
dw_at 0x01 = DW_AT_sibling
dw_at 0x02 = DW_AT_location
dw_at 0x03 = DW_AT_name
dw_at 0x09 = DW_AT_ordering
dw_at 0x0b = DW_AT_byte_size
dw_at 0x0c = DW_AT_bit_offset
dw_at 0x0d = DW_AT_bit_size
dw_at 0x10 = DW_AT_stmt_list
dw_at 0x11 = DW_AT_low_pc
dw_at 0x12 = DW_AT_high_pc
dw_at 0x13 = DW_AT_language
dw_at 0x15 = DW_AT_discr
dw_at 0x16 = DW_AT_discr_value
dw_at 0x17 = DW_AT_visibility
dw_at 0x18 = DW_AT_import
dw_at 0x19 = DW_AT_string_length
dw_at 0x1a = DW_AT_common_reference
dw_at 0x1b = DW_AT_comp_dir
dw_at 0x1c = DW_AT_const_value
dw_at 0x1d = DW_AT_containing_type
dw_at 0x1e = DW_AT_default_value
dw_at 0x20 = DW_AT_inline
dw_at 0x21 = DW_AT_is_optional
dw_at 0x22 = DW_AT_lower_bound
dw_at 0x25 = DW_AT_producer
dw_at 0x27 = DW_AT_prototyped
dw_at 0x2a = DW_AT_return_addr
dw_at 0x2c = DW_AT_start_scope
dw_at 0x2e = DW_AT_bit_stride
dw_at 0x2f = DW_AT_upper_bound
dw_at 0x31 = DW_AT_abstract_origin
dw_at 0x32 = DW_AT_accessibility
dw_at 0x33 = DW_AT_address_class
dw_at 0x34 = DW_AT_artificial
dw_at 0x35 = DW_AT_base_types
dw_at 0x36 = DW_AT_calling_convention
dw_at 0x37 = DW_AT_count
dw_at 0x38 = DW_AT_data_member_location
dw_at 0x39 = DW_AT_decl_column
dw_at 0x3a = DW_AT_decl_file
dw_at 0x3b = DW_AT_decl_line
dw_at 0x3c = DW_AT_declaration
dw_at 0x3d = DW_AT_discr_list
dw_at 0x3e = DW_AT_encoding
dw_at 0x3f = DW_AT_external
dw_at 0x40 = DW_AT_frame_base
dw_at 0x41 = DW_AT_friend
dw_at 0x42 = DW_AT_identifier_case
dw_at 0x43 = DW_AT_macro_info
dw_at 0x44 = DW_AT_namelist_item
dw_at 0x45 = DW_AT_priority
dw_at 0x46 = DW_AT_segment
dw_at 0x47 = DW_AT_specification
dw_at 0x48 = DW_AT_static_link
dw_at 0x49 = DW_AT_type
dw_at 0x4a = DW_AT_use_location
dw_at 0x4b = DW_AT_variable_parameter
dw_at 0x4c = DW_AT_virtuality
dw_at 0x4d = DW_AT_vtable_elem_location
dw_at 0x4e = DW_AT_allocated
dw_at 0x4f = DW_AT_associated
dw_at 0x50 = DW_AT_data_location
dw_at 0x51 = DW_AT_byte_stride
dw_at 0x52 = DW_AT_entry_pc
dw_at 0x53 = DW_AT_use_UTF8
dw_at 0x54 = DW_AT_extension
dw_at 0x55 = DW_AT_ranges
dw_at 0x56 = DW_AT_trampoline
dw_at 0x57 = DW_AT_call_column
dw_at 0x58 = DW_AT_call_file
dw_at 0x59 = DW_AT_call_line
dw_at 0x5a = DW_AT_description
dw_at 0x5b = DW_AT_binary_scale
dw_at 0x5c = DW_AT_decimal_scale
dw_at 0x5d = DW_AT_small
dw_at 0x5e = DW_AT_decimal_sign
dw_at 0x5f = DW_AT_digit_count
dw_at 0x60 = DW_AT_picture_string
dw_at 0x61 = DW_AT_mutable
dw_at 0x62 = DW_AT_threads_scaled
dw_at 0x63 = DW_AT_explicit
dw_at 0x64 = DW_AT_object_pointer
dw_at 0x65 = DW_AT_endianity
dw_at 0x66 = DW_AT_elemental
dw_at 0x67 = DW_AT_return
dw_at 0x68 = DW_AT_recursive
dw_at n | 0x2000 <= n && n <= 0x3fff = DW_AT_user n
dw_at n = error $ "Unrecognized DW_AT " ++ show n