3 Copyright (C) 1994-2020 Free Software Foundation, Inc.
5 Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
6 Inc. with support from Florida State University (under contract
7 with the Ada Joint Program Office), and Silicon Graphics, Inc.
8 Initial contribution by Brent Benson, Harris Computer Systems, Inc.,
9 based on Fred Fish's (Cygnus Support) implementation of DWARF 1
12 This file is part of GDB.
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 3 of the License, or
17 (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program. If not, see <http://www.gnu.org/licenses/>. */
27 #ifndef GDB_DWARF2_ABBREV_H
28 #define GDB_DWARF2_ABBREV_H
30 /* This data structure holds the information of an abbrev. */
33 unsigned int number
; /* number identifying abbrev */
34 enum dwarf_tag tag
; /* dwarf tag */
35 unsigned short has_children
; /* boolean */
36 unsigned short num_attrs
; /* number of attributes */
37 struct attr_abbrev
*attrs
; /* an array of attribute descriptions */
42 ENUM_BITFIELD(dwarf_attribute
) name
: 16;
43 ENUM_BITFIELD(dwarf_form
) form
: 16;
45 /* It is valid only if FORM is DW_FORM_implicit_const. */
46 LONGEST implicit_const
;
50 typedef std::unique_ptr
<struct abbrev_table
> abbrev_table_up
;
52 /* Top level data structure to contain an abbreviation table. */
56 static abbrev_table_up
read (struct objfile
*objfile
,
57 struct dwarf2_section_info
*section
,
58 sect_offset sect_off
);
60 /* Look up an abbrev in the table.
61 Returns NULL if the abbrev is not found. */
63 struct abbrev_info
*lookup_abbrev (unsigned int abbrev_number
);
66 /* Where the abbrev table came from.
67 This is used as a sanity check when the table is used. */
68 const sect_offset sect_off
;
72 explicit abbrev_table (sect_offset off
);
74 DISABLE_COPY_AND_ASSIGN (abbrev_table
);
76 /* Allocate space for a struct abbrev_info object in
78 struct abbrev_info
*alloc_abbrev ();
80 /* Add an abbreviation to the table. */
81 void add_abbrev (unsigned int abbrev_number
, struct abbrev_info
*abbrev
);
83 /* Hash table of abbrevs. */
86 /* Storage for the abbrev table. */
87 auto_obstack m_abbrev_obstack
;
90 #endif /* GDB_DWARF2_ABBREV_H */