namespace
{
+ typedef preset_attribute<cl_reference, cl_constant> const_or_ref_attribute;
+
struct dwarf_2_attributes
: public attribute_table
{
// appropriate attributes with cl_exprloc form DWARF 4 and
// cl_loclistptr (even though in DWARF 4 it's actually only
// DW_FORM_exprloc that has this class).
+ //
+ // Similarly with cl_lineptr and cl_macptr. cl_rangelistptr
+ // wasn't introduced until DWARF 3.
add (ref_attribute (DW_AT_sibling));
add (location_attribute (DW_AT_location));
add (const_attribute (DW_AT_byte_size));
add (const_attribute (DW_AT_bit_offset));
add (const_attribute (DW_AT_bit_size));
- add (const_attribute (DW_AT_stmt_list));
+ add (attribute (DW_AT_stmt_list, cl_lineptr));
add (addr_attribute (DW_AT_low_pc));
add (addr_attribute (DW_AT_high_pc));
add (const_attribute (DW_AT_language));
add (location_attribute (DW_AT_frame_base));
add (ref_attribute (DW_AT_friend));
add (const_attribute (DW_AT_identifier_case));
- add (const_attribute (DW_AT_macro_info));
+ add (attribute (DW_AT_macro_info, cl_macptr));
add (block_attribute (DW_AT_namelist_item));
add (ref_attribute (DW_AT_priority));
add (location_attribute (DW_AT_segment));
{}
};
- // xxx We still need to retrofit all the cl_*ptr to above list of
- // attributes. Except cl_loclistptr which is already done.
typedef preset_form<sc_value,
cl_constant, cl_lineptr, cl_loclistptr,
- cl_macptr, cl_rangelistptr> dw2_data_form;
+ cl_macptr> dw2_data_form;
struct dwarf_2_forms
: public form_table
add (dynval_attribute (DW_AT_byte_size));
add (dynval_attribute (DW_AT_bit_offset));
add (dynval_attribute (DW_AT_bit_size));
- add (attribute (DW_AT_stmt_list, cl_lineptr));
add (location_attribute (DW_AT_string_length));
add (dynval_attribute (DW_AT_lower_bound));
add (location_attribute (DW_AT_return_addr));
add (attribute (DW_AT_data_member_location,
dw_class_set (cl_exprloc, cl_constant, cl_loclistptr)));
add (location_attribute (DW_AT_frame_base));
- add (attribute (DW_AT_macro_info, cl_macptr));
add (location_attribute (DW_AT_segment));
add (location_attribute (DW_AT_static_link));
add (location_attribute (DW_AT_use_location));
// In DWARF 2 we made all the const forms into various cl_*ptr,
// since that's how the standard was worded: it allowed
- // DW_AT_location to have any constant form. Revert that.
+ // DW_AT_location to have any constant form. In DWARF 3, only
+ // data4 and data8 are like this. In addition, these two can
+ // also be cl_rangelistptr.
add (const_form (DW_FORM_data1, fw_1));
add (const_form (DW_FORM_data2, fw_2));
add (dw3_data_form (DW_FORM_data4, fw_4));
typedef preset_form<sc_value, cl_constant> const_form;
typedef preset_form<sc_value, cl_reference> ref_form;
typedef preset_form<sc_value, cl_flag> flag_form;
-typedef preset_form<sc_block, cl_block> block_form;
typedef preset_attribute<cl_constant> const_attribute;
typedef preset_attribute<cl_reference> ref_attribute;
typedef preset_attribute<cl_string> string_attribute;
typedef preset_attribute<cl_flag> flag_attribute;
typedef preset_attribute<cl_block> block_attribute;
-typedef preset_attribute<cl_reference, cl_constant> const_or_ref_attribute;
// [DWARF 3, DWARF 4, section 2.19]: attributes that [...] specify a
// property [...] that is an integer value, where the value may be