74 void **slot = htab_find_slot_with_hash (
m_abbrevs.get (), abbrev,
87 case DW_TAG_array_type:
88 case DW_TAG_base_type:
89 case DW_TAG_class_type:
91 case DW_TAG_enumeration_type:
92 case DW_TAG_enumerator:
93 case DW_TAG_imported_declaration:
94 case DW_TAG_imported_unit:
95 case DW_TAG_inlined_subroutine:
96 case DW_TAG_interface_type:
98 case DW_TAG_namespace:
99 case DW_TAG_ptr_to_member_type:
100 case DW_TAG_set_type:
101 case DW_TAG_string_type:
102 case DW_TAG_structure_type:
103 case DW_TAG_subprogram:
104 case DW_TAG_subrange_type:
105 case DW_TAG_generic_subrange:
106 case DW_TAG_subroutine_type:
108 case DW_TAG_union_type:
109 case DW_TAG_unspecified_type:
110 case DW_TAG_variable:
121 sect_offset sect_off)
124 const gdb_byte *abbrev_ptr;
136 unsigned int bytes_read;
140 if (abbrev_number == 0)
142 abbrev_ptr += bytes_read;
145 obstack_blank (obstack, offsetof (
abbrev_info, attrs));
146 cur_abbrev = (
struct abbrev_info *) obstack_base (obstack);
149 cur_abbrev->
number = abbrev_number;
153 abbrev_ptr += bytes_read;
157 unsigned int size = 0;
158 unsigned int sibling_offset = -1;
159 bool is_csize =
true;
161 bool has_hardcoded_declaration =
false;
162 bool has_specification_or_origin =
false;
163 bool has_name =
false;
164 bool has_linkage_name =
false;
165 bool has_external =
false;
176 abbrev_ptr += bytes_read;
180 abbrev_ptr += bytes_read;
181 if (cur_attr.
form == DW_FORM_implicit_const)
185 abbrev_ptr += bytes_read;
190 if (cur_attr.
name == 0)
193 switch (cur_attr.
name)
195 case DW_AT_declaration:
196 if (cur_attr.
form == DW_FORM_flag_present)
197 has_hardcoded_declaration =
true;
204 case DW_AT_specification:
205 case DW_AT_abstract_origin:
206 case DW_AT_extension:
207 has_specification_or_origin =
true;
214 case DW_AT_MIPS_linkage_name:
215 case DW_AT_linkage_name:
216 has_linkage_name =
true;
220 if (is_csize && cur_attr.
form == DW_FORM_ref4)
221 sibling_offset =
size;
225 switch (cur_attr.
form)
233 case DW_FORM_flag_present:
234 case DW_FORM_implicit_const:
251 case DW_FORM_ref_sig8:
264 obstack_grow (obstack, &cur_attr,
sizeof (cur_attr));
267 cur_abbrev = (
struct abbrev_info *) obstack_finish (obstack);
270 if (!has_name && !has_linkage_name && !has_specification_or_origin)
274 = (cur_abbrev->
tag == DW_TAG_namespace
275 || cur_abbrev->
tag == DW_TAG_enumeration_type);
277 else if ((cur_abbrev->
tag == DW_TAG_structure_type
278 || cur_abbrev->
tag == DW_TAG_class_type
279 || cur_abbrev->
tag == DW_TAG_union_type)
288 else if (has_hardcoded_declaration
289 && (cur_abbrev->
tag != DW_TAG_variable || !has_external))
302 || sibling_offset != (
unsigned short) sibling_offset)
static int eq_abbrev(const void *lhs, const void *rhs)
static bool tag_interesting_for_index(dwarf_tag tag)
static hashval_t hash_abbrev(const void *item)
std::unique_ptr< struct abbrev_table > abbrev_table_up
void * xcalloc(size_t number, size_t size)
LONGEST read_signed_leb128(bfd *abfd, const gdb_byte *buf, unsigned int *bytes_read_ptr)
ULONGEST read_unsigned_leb128(bfd *abfd, const gdb_byte *buf, unsigned int *bytes_read_ptr)
static unsigned int read_1_byte(bfd *abfd, const gdb_byte *buf)
__extension__ enum dwarf_tag tag
unsigned short sibling_offset
unsigned short size_if_constant
const sect_offset sect_off
void add_abbrev(struct abbrev_info *abbrev)
auto_obstack m_abbrev_obstack
static abbrev_table_up read(struct dwarf2_section_info *section, sect_offset sect_off)
abbrev_table(sect_offset off, struct dwarf2_section_info *sect)
struct dwarf2_section_info * section
__extension__ enum dwarf_attribute name
__extension__ enum dwarf_form form
struct bfd * get_bfd_owner() const