#include "macrotab.h"
#include "language.h"
#include "complaints.h"
-#include "bcache.h"
#include "dwarf2expr.h"
#include "dwarf2loc.h"
#include "cp-support.h"
#include "psympriv.h"
#include <sys/stat.h>
#include "completer.h"
-#include "vec.h"
+#include "common/vec.h"
#include "c-lang.h"
#include "go-lang.h"
#include "valprint.h"
#include "gdb_bfd.h"
#include "f-lang.h"
#include "source.h"
-#include "filestuff.h"
+#include "common/filestuff.h"
#include "build-id.h"
#include "namespace.h"
#include "common/gdb_unlinker.h"
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
-#include "selftest.h"
+#include "common/selftest.h"
#include <cmath>
#include <set>
#include <forward_list>
/* When non-zero, do not reject deprecated .gdb_index sections. */
static int use_deprecated_index_sections = 0;
-static const struct objfile_data *dwarf2_objfile_data_key;
+static const struct objfile_key<dwarf2_per_objfile> dwarf2_objfile_data_key;
/* The "aclass" indices for various kinds of computed DWARF symbols. */
bool symbol_name_slot_invalid (offset_type idx) const override
{
const auto &bucket = this->symbol_table[idx];
- return bucket.name == 0 && bucket.vec;
+ return bucket.name == 0 && bucket.vec == 0;
}
/* Convenience method to get at the name of the symbol at IDX in the
dwarf2_per_objfile *
get_dwarf2_per_objfile (struct objfile *objfile)
{
- return ((struct dwarf2_per_objfile *)
- objfile_data (objfile, dwarf2_objfile_data_key));
-}
-
-/* Set the dwarf2_per_objfile associated to OBJFILE. */
-
-void
-set_dwarf2_per_objfile (struct objfile *objfile,
- struct dwarf2_per_objfile *dwarf2_per_objfile)
-{
- gdb_assert (get_dwarf2_per_objfile (objfile) == NULL);
- set_objfile_data (objfile, dwarf2_objfile_data_key, dwarf2_per_objfile);
+ return dwarf2_objfile_data_key.get (objfile);
}
/* Default names of the debugging sections. */
DISABLE_COPY_AND_ASSIGN (dwarf2_cu);
+ /* TU version of handle_DW_AT_stmt_list for read_type_unit_scope.
+ Create the set of symtabs used by this TU, or if this TU is sharing
+ symtabs with another TU and the symtabs have already been created
+ then restore those symtabs in the line header.
+ We don't need the pc/line-number mapping for type units. */
+ void setup_type_unit_groups (struct die_info *die);
+
+ /* Start a symtab for DWARF. NAME, COMP_DIR, LOW_PC are passed to the
+ buildsym_compunit constructor. */
+ struct compunit_symtab *start_symtab (const char *name,
+ const char *comp_dir,
+ CORE_ADDR low_pc);
+
+ /* Reset the builder. */
+ void reset_builder () { m_builder.reset (); }
+
/* The header of the compilation unit. */
struct comp_unit_head header {};
const char *producer = nullptr;
+private:
/* The symtab builder for this CU. This is only non-NULL when full
symbols are being read. */
- std::unique_ptr<buildsym_compunit> builder;
+ std::unique_ptr<buildsym_compunit> m_builder;
+public:
/* The generic symbol table building routines have separate lists for
file scope symbols and all all other scopes (local scopes). So
we need to select the right one to pass to add_symbol_to_list().
bool processing_has_namespace_info : 1;
struct partial_die_info *find_partial_die (sect_offset sect_off);
+
+ /* If this CU was inherited by another CU (via specification,
+ abstract_origin, etc), this is the ancestor CU. */
+ dwarf2_cu *ancestor;
+
+ /* Get the buildsym_compunit for this CU. */
+ buildsym_compunit *get_builder ()
+ {
+ /* If this CU has a builder associated with it, use that. */
+ if (m_builder != nullptr)
+ return m_builder.get ();
+
+ /* Otherwise, search ancestors for a valid builder. */
+ if (ancestor != nullptr)
+ return ancestor->get_builder ();
+
+ return nullptr;
+ }
};
/* A struct that can be used as a hash key for tables based on DW_AT_stmt_list.
return &file_names[vec_index];
}
- /* Const version of the above. */
- const file_entry *file_name_at (unsigned int index) const
- {
- if (index >= file_names.size ())
- return NULL;
- return &file_names[index];
- }
-
/* Offset of line number information in .debug_line section. */
sect_offset sect_off {};
static struct partial_die_info *load_partial_dies
(const struct die_reader_specs *, const gdb_byte *, int);
-static struct partial_die_info *find_partial_die (sect_offset, int,
- struct dwarf2_cu *);
+/* A pair of partial_die_info and compilation unit. */
+struct cu_partial_die_info
+{
+ /* The compilation unit of the partial_die_info. */
+ struct dwarf2_cu *cu;
+ /* A partial_die_info. */
+ struct partial_die_info *pdi;
+
+ cu_partial_die_info (struct dwarf2_cu *cu, struct partial_die_info *pdi)
+ : cu (cu),
+ pdi (pdi)
+ { /* Nothhing. */ }
+
+private:
+ cu_partial_die_info () = delete;
+};
+
+static const struct cu_partial_die_info find_partial_die (sect_offset, int,
+ struct dwarf2_cu *);
static const gdb_byte *read_attribute (const struct die_reader_specs *,
struct attribute *, struct attr_abbrev *,
static unsigned int read_2_bytes (bfd *, const gdb_byte *);
+/* Read the next three bytes (little-endian order) as an unsigned integer. */
+static unsigned int read_3_bytes (bfd *, const gdb_byte *);
+
static unsigned int read_4_bytes (bfd *, const gdb_byte *);
static ULONGEST read_8_bytes (bfd *, const gdb_byte *);
static void dwarf2_start_subfile (struct dwarf2_cu *, const char *,
const char *);
-static struct compunit_symtab *dwarf2_start_symtab (struct dwarf2_cu *,
- const char *, const char *,
- CORE_ADDR);
-
static struct symbol *new_symbol (struct die_info *, struct type *,
struct dwarf2_cu *, struct symbol * = NULL);
{
CORE_ADDR addr;
- if (attr->form != DW_FORM_addr && attr->form != DW_FORM_GNU_addr_index)
+ if (attr->form != DW_FORM_addr && attr->form != DW_FORM_addrx
+ && attr->form != DW_FORM_GNU_addr_index)
{
/* Aside from a few clearly defined exceptions, attributes that
contain an address must always be in DW_FORM_addr form.
= get_dwarf2_per_objfile (objfile);
if (dwarf2_per_objfile == NULL)
- {
- /* Initialize per-objfile state. */
- dwarf2_per_objfile
- = new (&objfile->objfile_obstack) struct dwarf2_per_objfile (objfile,
- names);
- set_dwarf2_per_objfile (objfile, dwarf2_per_objfile);
- }
+ dwarf2_per_objfile = dwarf2_objfile_data_key.emplace (objfile, objfile,
+ names);
+
return (!dwarf2_per_objfile->info.is_virtual
&& dwarf2_per_objfile->info.s.section != NULL
&& !dwarf2_per_objfile->abbrev.is_virtual
asection **sectp, const gdb_byte **bufp,
bfd_size_type *sizep)
{
- struct dwarf2_per_objfile *data
- = (struct dwarf2_per_objfile *) objfile_data (objfile,
- dwarf2_objfile_data_key);
+ struct dwarf2_per_objfile *data = dwarf2_objfile_data_key.get (objfile);
struct dwarf2_section_info *info;
/* We may see an objfile without any DWARF, in which case we just
if (dwz_bfd != NULL)
{
if (!build_id_verify (dwz_bfd.get (), buildid_len, buildid))
- dwz_bfd.release ();
+ dwz_bfd.reset (nullptr);
}
if (dwz_bfd == NULL)
struct symbol *sym, *with_opaque = NULL;
struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
- struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
+ const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_find_symbol (block, name, domain,
block_find_non_opaque_type_preferred,
dw2_map_matching_symbols (struct objfile *objfile,
const char * name, domain_enum domain,
int global,
- int (*callback) (struct block *,
+ int (*callback) (const struct block *,
struct symbol *, void *),
void *data, symbol_name_match_type match,
symbol_compare_ftype *ordered_compare)
struct symbol *sym, *with_opaque = NULL;
struct compunit_symtab *stab = dw2_instantiate_symtab (per_cu, false);
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
- struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
+ const struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
sym = block_find_symbol (block, name, domain,
block_find_non_opaque_type_preferred,
init_psymbol_list (objfile, 1024);
- TRY
+ try
{
/* This isn't really ideal: all the data we allocate on the
objfile's obstack is still uselessly kept around. However,
/* (maybe) store an index in the cache. */
global_index_cache.store (dwarf2_per_objfile);
}
- CATCH (except, RETURN_MASK_ERROR)
+ catch (const gdb_exception_error &except)
{
exception_print (gdb_stderr, except);
}
- END_CATCH
}
/* Return the total length of the CU described by HEADER. */
comp_dir = dwarf2_attr (stub_comp_unit_die, DW_AT_comp_dir, cu);
/* There should be a DW_AT_addr_base attribute here (if needed).
- We need the value before we can process DW_FORM_GNU_addr_index. */
+ We need the value before we can process DW_FORM_GNU_addr_index
+ or DW_FORM_addrx. */
cu->addr_base = 0;
attr = dwarf2_attr (stub_comp_unit_die, DW_AT_GNU_addr_base, cu);
if (attr)
real_pdi = pdi;
while (real_pdi->has_specification)
- real_pdi = find_partial_die (real_pdi->spec_offset,
- real_pdi->spec_is_dwz, cu);
+ {
+ auto res = find_partial_die (real_pdi->spec_offset,
+ real_pdi->spec_is_dwz, cu);
+ real_pdi = res.pdi;
+ cu = res.cu;
+ }
parent = real_pdi->die_parent;
if (parent == NULL)
/* FIXME drow/2004-04-01: What should we be doing with
function-local names? For partial symbols, we should probably be
ignoring them. */
- complaint (_("unhandled containing DIE tag %d for DIE at %s"),
- parent->tag, sect_offset_str (pdi->sect_off));
+ complaint (_("unhandled containing DIE tag %s for DIE at %s"),
+ dwarf_tag_name (parent->tag),
+ sect_offset_str (pdi->sect_off));
parent->scope = grandparent_scope;
}
0, cu->language, objfile);
break;
case DW_TAG_module:
- add_psymbol_to_list (actual_name, strlen (actual_name),
- built_actual_name != NULL,
- MODULE_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::GLOBAL,
- 0, cu->language, objfile);
+ /* With Fortran 77 there might be a "BLOCK DATA" module
+ available without any name. If so, we skip the module as it
+ doesn't bring any value. */
+ if (actual_name != nullptr)
+ add_psymbol_to_list (actual_name, strlen (actual_name),
+ built_actual_name != NULL,
+ MODULE_DOMAIN, LOC_TYPEDEF, -1,
+ psymbol_placement::GLOBAL,
+ 0, cu->language, objfile);
break;
case DW_TAG_class_type:
case DW_TAG_interface_type:
case DW_FORM_block4:
info_ptr += 4 + read_4_bytes (abfd, info_ptr);
break;
+ case DW_FORM_addrx:
+ case DW_FORM_strx:
case DW_FORM_sdata:
case DW_FORM_udata:
case DW_FORM_ref_udata:
struct pending *list;
int i;
- for (list = *cu->builder->get_global_symbols ();
+ for (list = *cu->get_builder ()->get_global_symbols ();
list != NULL;
list = list->next)
{
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_TYPE (sym) = type;
- add_symbol_to_list (sym, cu->builder->get_global_symbols ());
+ add_symbol_to_list (sym, cu->get_builder ()->get_global_symbols ());
xfree (package_name);
}
get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu);
addr = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
- static_block = cu->builder->end_symtab_get_static_block (addr, 0, 1);
+ static_block = cu->get_builder ()->end_symtab_get_static_block (addr, 0, 1);
/* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
Also, DW_AT_ranges may record ranges not belonging to any child DIEs
this comp unit. */
dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);
- cust = cu->builder->end_symtab_from_static_block (static_block,
+ cust = cu->get_builder ()->end_symtab_from_static_block (static_block,
SECT_OFF_TEXT (objfile),
0);
dwarf2_per_objfile->just_read_cus.push_back (per_cu);
/* Not needed any more. */
- cu->builder.reset ();
+ cu->reset_builder ();
}
/* Generate full symbol information for type unit PER_CU, whose DIEs have
this TU's symbols to the existing symtab. */
if (sig_type->type_unit_group->compunit_symtab == NULL)
{
- cust = cu->builder->end_expandable_symtab (0, SECT_OFF_TEXT (objfile));
+ buildsym_compunit *builder = cu->get_builder ();
+ cust = builder->end_expandable_symtab (0, SECT_OFF_TEXT (objfile));
sig_type->type_unit_group->compunit_symtab = cust;
if (cust != NULL)
}
else
{
- cu->builder->augment_type_symtab ();
+ cu->get_builder ()->augment_type_symtab ();
cust = sig_type->type_unit_group->compunit_symtab;
}
}
/* Not needed any more. */
- cu->builder.reset ();
+ cu->reset_builder ();
}
/* Process an imported unit DIE. */
static struct using_direct **
using_directives (struct dwarf2_cu *cu)
{
- if (cu->language == language_ada && cu->builder->outermost_context_p ())
- return cu->builder->get_global_using_directives ();
+ if (cu->language == language_ada
+ && cu->get_builder ()->outermost_context_p ())
+ return cu->get_builder ()->get_global_using_directives ();
else
- return cu->builder->get_local_using_directives ();
+ return cu->get_builder ()->get_local_using_directives ();
}
/* Read the import statement specified by the given die and record it. */
if (cu->producer && strstr (cu->producer, "GNU Go ") != NULL)
set_cu_language (DW_LANG_Go, cu);
- dwarf2_start_symtab (cu, fnd.name, fnd.comp_dir, lowpc);
+ cu->start_symtab (fnd.name, fnd.comp_dir, lowpc);
/* Decode line number information if present. We do this before
processing child DIEs, so that the line header table is available
}
}
-/* TU version of handle_DW_AT_stmt_list for read_type_unit_scope.
- Create the set of symtabs used by this TU, or if this TU is sharing
- symtabs with another TU and the symtabs have already been created
- then restore those symtabs in the line header.
- We don't need the pc/line-number mapping for type units. */
-
-static void
-setup_type_unit_groups (struct die_info *die, struct dwarf2_cu *cu)
+void
+dwarf2_cu::setup_type_unit_groups (struct die_info *die)
{
- struct dwarf2_per_cu_data *per_cu = cu->per_cu;
struct type_unit_group *tu_group;
int first_time;
struct attribute *attr;
gdb_assert (per_cu->is_debug_types);
sig_type = (struct signatured_type *) per_cu;
- attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
+ attr = dwarf2_attr (die, DW_AT_stmt_list, this);
/* If we're using .gdb_index (includes -readnow) then
per_cu->type_unit_group may not have been set up yet. */
if (sig_type->type_unit_group == NULL)
- sig_type->type_unit_group = get_type_unit_group (cu, attr);
+ sig_type->type_unit_group = get_type_unit_group (this, attr);
tu_group = sig_type->type_unit_group;
/* If we've already processed this stmt_list there's no real need to
if (attr != NULL)
{
sect_offset line_offset = (sect_offset) DW_UNSND (attr);
- lh = dwarf_decode_line_header (line_offset, cu);
+ lh = dwarf_decode_line_header (line_offset, this);
}
if (lh == NULL)
{
if (first_time)
- dwarf2_start_symtab (cu, "", NULL, 0);
+ start_symtab ("", NULL, 0);
else
{
gdb_assert (tu_group->symtabs == NULL);
- gdb_assert (cu->builder == nullptr);
+ gdb_assert (m_builder == nullptr);
struct compunit_symtab *cust = tu_group->compunit_symtab;
- cu->builder.reset (new struct buildsym_compunit
- (COMPUNIT_OBJFILE (cust), "",
- COMPUNIT_DIRNAME (cust),
- compunit_language (cust),
- 0, cust));
+ m_builder.reset (new struct buildsym_compunit
+ (COMPUNIT_OBJFILE (cust), "",
+ COMPUNIT_DIRNAME (cust),
+ compunit_language (cust),
+ 0, cust));
}
return;
}
- cu->line_header = lh.release ();
- cu->line_header_die_owner = die;
+ line_header = lh.release ();
+ line_header_die_owner = die;
if (first_time)
{
- struct compunit_symtab *cust = dwarf2_start_symtab (cu, "", NULL, 0);
+ struct compunit_symtab *cust = start_symtab ("", NULL, 0);
/* Note: We don't assign tu_group->compunit_symtab yet because we're
still initializing it, and our caller (a few levels up)
process_full_type_unit still needs to know if this is the first
time. */
- tu_group->num_symtabs = cu->line_header->file_names.size ();
+ tu_group->num_symtabs = line_header->file_names.size ();
tu_group->symtabs = XNEWVEC (struct symtab *,
- cu->line_header->file_names.size ());
+ line_header->file_names.size ());
- for (i = 0; i < cu->line_header->file_names.size (); ++i)
+ for (i = 0; i < line_header->file_names.size (); ++i)
{
- file_entry &fe = cu->line_header->file_names[i];
-
- dwarf2_start_subfile (cu, fe.name, fe.include_dir (cu->line_header));
+ file_entry &fe = line_header->file_names[i];
- if (cu->builder->get_current_subfile ()->symtab == NULL)
+ dwarf2_start_subfile (this, fe.name,
+ fe.include_dir (line_header));
+ buildsym_compunit *b = get_builder ();
+ if (b->get_current_subfile ()->symtab == NULL)
{
/* NOTE: start_subfile will recognize when it's been
passed a file it has already seen. So we can't
assume there's a simple mapping from
cu->line_header->file_names to subfiles, plus
cu->line_header->file_names may contain dups. */
- cu->builder->get_current_subfile ()->symtab
- = allocate_symtab (cust,
- cu->builder->get_current_subfile ()->name);
+ b->get_current_subfile ()->symtab
+ = allocate_symtab (cust, b->get_current_subfile ()->name);
}
- fe.symtab = cu->builder->get_current_subfile ()->symtab;
+ fe.symtab = b->get_current_subfile ()->symtab;
tu_group->symtabs[i] = fe.symtab;
}
}
else
{
- gdb_assert (cu->builder == nullptr);
+ gdb_assert (m_builder == nullptr);
struct compunit_symtab *cust = tu_group->compunit_symtab;
- cu->builder.reset (new struct buildsym_compunit
- (COMPUNIT_OBJFILE (cust), "",
- COMPUNIT_DIRNAME (cust),
- compunit_language (cust),
- 0, cust));
+ m_builder.reset (new struct buildsym_compunit
+ (COMPUNIT_OBJFILE (cust), "",
+ COMPUNIT_DIRNAME (cust),
+ compunit_language (cust),
+ 0, cust));
- for (i = 0; i < cu->line_header->file_names.size (); ++i)
+ for (i = 0; i < line_header->file_names.size (); ++i)
{
- file_entry &fe = cu->line_header->file_names[i];
+ file_entry &fe = line_header->file_names[i];
fe.symtab = tu_group->symtabs[i];
}
/* Initialize (or reinitialize) the machinery for building symtabs.
We do this before processing child DIEs, so that the line header table
is available for DW_AT_decl_file. */
- setup_type_unit_groups (die, cu);
+ cu->setup_type_unit_groups (die);
if (die->child != NULL)
{
std::unique_ptr<struct dwp_file> dwp_file
(new struct dwp_file (name, std::move (dbfd)));
- /* +1: section 0 is unused */
- dwp_file->num_sections = bfd_count_sections (dwp_file->dbfd) + 1;
+ dwp_file->num_sections = elf_numsections (dwp_file->dbfd);
dwp_file->elf_sections =
OBSTACK_CALLOC (&objfile->objfile_obstack,
dwp_file->num_sections, asection *);
}
}
- newobj = cu->builder->push_context (0, lowpc);
+ newobj = cu->get_builder ()->push_context (0, lowpc);
newobj->name = new_symbol (die, read_type_die (die, cu), cu,
(struct symbol *) templ_func);
+ if (dwarf2_flag_true_p (die, DW_AT_main_subprogram, cu))
+ set_objfile_main_name (objfile, SYMBOL_LINKAGE_NAME (newobj->name),
+ cu->language);
+
/* If there is a location expression for DW_AT_frame_base, record
it. */
attr = dwarf2_attr (die, DW_AT_frame_base, cu);
attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
}
- cu->list_in_scope = cu->builder->get_local_symbols ();
+ cu->list_in_scope = cu->get_builder ()->get_local_symbols ();
if (die->child != NULL)
{
}
}
- struct context_stack cstk = cu->builder->pop_context ();
+ struct context_stack cstk = cu->get_builder ()->pop_context ();
/* Make a block for the local symbols within. */
- block = cu->builder->finish_block (cstk.name, cstk.old_blocks,
+ block = cu->get_builder ()->finish_block (cstk.name, cstk.old_blocks,
cstk.static_link, lowpc, highpc);
/* For C++, set the block's scope. */
a function declares a class that has methods). This means that
when we finish processing a function scope, we may need to go
back to building a containing block's symbol lists. */
- *cu->builder->get_local_symbols () = cstk.locals;
- cu->builder->set_local_using_directives (cstk.local_using_directives);
+ *cu->get_builder ()->get_local_symbols () = cstk.locals;
+ cu->get_builder ()->set_local_using_directives (cstk.local_using_directives);
/* If we've finished processing a top-level function, subsequent
symbols go in the file symbol list. */
- if (cu->builder->outermost_context_p ())
- cu->list_in_scope = cu->builder->get_file_symbols ();
+ if (cu->get_builder ()->outermost_context_p ())
+ cu->list_in_scope = cu->get_builder ()->get_file_symbols ();
}
/* Process all the DIES contained within a lexical block scope. Start
lowpc = gdbarch_adjust_dwarf2_addr (gdbarch, lowpc + baseaddr);
highpc = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
- cu->builder->push_context (0, lowpc);
+ cu->get_builder ()->push_context (0, lowpc);
if (die->child != NULL)
{
child_die = die->child;
}
}
inherit_abstract_dies (die, cu);
- struct context_stack cstk = cu->builder->pop_context ();
+ struct context_stack cstk = cu->get_builder ()->pop_context ();
- if (*cu->builder->get_local_symbols () != NULL
- || (*cu->builder->get_local_using_directives ()) != NULL)
+ if (*cu->get_builder ()->get_local_symbols () != NULL
+ || (*cu->get_builder ()->get_local_using_directives ()) != NULL)
{
struct block *block
- = cu->builder->finish_block (0, cstk.old_blocks, NULL,
+ = cu->get_builder ()->finish_block (0, cstk.old_blocks, NULL,
cstk.start_addr, highpc);
/* Note that recording ranges after traversing children, as we
to do. */
dwarf2_record_block_ranges (die, block, baseaddr, cu);
}
- *cu->builder->get_local_symbols () = cstk.locals;
- cu->builder->set_local_using_directives (cstk.local_using_directives);
+ *cu->get_builder ()->get_local_symbols () = cstk.locals;
+ cu->get_builder ()->set_local_using_directives (cstk.local_using_directives);
}
/* Read in DW_TAG_call_site and insert it to CU->call_site_htab. */
low = gdbarch_adjust_dwarf2_addr (gdbarch, low + baseaddr);
high = gdbarch_adjust_dwarf2_addr (gdbarch, high + baseaddr);
- cu->builder->record_block_range (block, low, high - 1);
+ cu->get_builder ()->record_block_range (block, low, high - 1);
}
}
end += baseaddr;
start = gdbarch_adjust_dwarf2_addr (gdbarch, start);
end = gdbarch_adjust_dwarf2_addr (gdbarch, end);
- cu->builder->record_block_range (block, start, end - 1);
+ cu->get_builder ()->record_block_range (block, start, end - 1);
blockvec.emplace_back (start, end);
});
field for our sole member child. */
struct attribute *discr = dwarf2_attr (child_die, DW_AT_discr_value, cu);
- for (struct die_info *variant_child = child_die->child;
+ for (die_info *variant_child = child_die->child;
variant_child != NULL;
variant_child = sibling_die (variant_child))
{
if (has_template_parameters)
{
- /* Make sure that the symtab is set on the new symbols.
- Even though they don't appear in this symtab directly,
- other parts of gdb assume that symbols do, and this is
- reasonably true. */
- for (int i = 0; i < TYPE_N_TEMPLATE_ARGUMENTS (type); ++i)
- symbol_set_symtab (TYPE_TEMPLATE_ARGUMENT (type, i),
- symbol_symtab (sym));
+ struct symtab *symtab;
+ if (sym != nullptr)
+ symtab = symbol_symtab (sym);
+ else if (cu->line_header != nullptr)
+ {
+ /* Any related symtab will do. */
+ symtab
+ = cu->line_header->file_name_at (file_name_index (1))->symtab;
+ }
+ else
+ {
+ symtab = nullptr;
+ complaint (_("could not find suitable "
+ "symtab for template parameter"
+ " - DIE at %s [in module %s]"),
+ sect_offset_str (die->sect_off),
+ objfile_name (objfile));
+ }
+
+ if (symtab != nullptr)
+ {
+ /* Make sure that the symtab is set on the new symbols.
+ Even though they don't appear in this symtab directly,
+ other parts of gdb assume that symbols do, and this is
+ reasonably true. */
+ for (int i = 0; i < TYPE_N_TEMPLATE_ARGUMENTS (type); ++i)
+ symbol_set_symtab (TYPE_TEMPLATE_ARGUMENT (type, i), symtab);
+ }
}
}
}
struct type *type;
module_name = dwarf2_name (die, cu);
- if (!module_name)
- complaint (_("DW_TAG_module has no name, offset %s"),
- sect_offset_str (die->sect_off));
type = init_type (objfile, TYPE_CODE_MODULE, 0, module_name);
return set_die_type (die, type, cu);
return type;
}
+/* Initialise and return a floating point type of size BITS suitable for
+ use as a component of a complex number. The NAME_HINT is passed through
+ when initialising the floating point type and is the name of the complex
+ type.
+
+ As DWARF doesn't currently provide an explicit name for the components
+ of a complex number, but it can be helpful to have these components
+ named, we try to select a suitable name based on the size of the
+ component. */
+static struct type *
+dwarf2_init_complex_target_type (struct dwarf2_cu *cu,
+ struct objfile *objfile,
+ int bits, const char *name_hint)
+{
+ gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct type *tt = nullptr;
+
+ /* Try to find a suitable floating point builtin type of size BITS.
+ We're going to use the name of this type as the name for the complex
+ target type that we are about to create. */
+ switch (cu->language)
+ {
+ case language_fortran:
+ switch (bits)
+ {
+ case 32:
+ tt = builtin_f_type (gdbarch)->builtin_real;
+ break;
+ case 64:
+ tt = builtin_f_type (gdbarch)->builtin_real_s8;
+ break;
+ case 96: /* The x86-32 ABI specifies 96-bit long double. */
+ case 128:
+ tt = builtin_f_type (gdbarch)->builtin_real_s16;
+ break;
+ }
+ break;
+ default:
+ switch (bits)
+ {
+ case 32:
+ tt = builtin_type (gdbarch)->builtin_float;
+ break;
+ case 64:
+ tt = builtin_type (gdbarch)->builtin_double;
+ break;
+ case 96: /* The x86-32 ABI specifies 96-bit long double. */
+ case 128:
+ tt = builtin_type (gdbarch)->builtin_long_double;
+ break;
+ }
+ break;
+ }
+
+ /* If the type we found doesn't match the size we were looking for, then
+ pretend we didn't find a type at all, the complex target type we
+ create will then be nameless. */
+ if (tt != nullptr && TYPE_LENGTH (tt) * TARGET_CHAR_BIT != bits)
+ tt = nullptr;
+
+ const char *name = (tt == nullptr) ? nullptr : TYPE_NAME (tt);
+ return dwarf2_init_float_type (objfile, bits, name, name_hint);
+}
+
/* Find a representation of a given base type and install
it in the TYPE field of the die. */
type = init_boolean_type (objfile, bits, 1, name);
break;
case DW_ATE_complex_float:
- type = dwarf2_init_float_type (objfile, bits / 2, NULL, name);
+ type = dwarf2_init_complex_target_type (cu, objfile, bits / 2, name);
type = init_complex_type (objfile, name, type);
break;
case DW_ATE_decimal_float:
main_subprogram = DW_UNSND (&attr);
break;
+ case DW_AT_ranges:
+ {
+ /* It would be nice to reuse dwarf2_get_pc_bounds here,
+ but that requires a full DIE, so instead we just
+ reimplement it. */
+ int need_ranges_base = tag != DW_TAG_compile_unit;
+ unsigned int ranges_offset = (DW_UNSND (&attr)
+ + (need_ranges_base
+ ? cu->ranges_base
+ : 0));
+
+ /* Value of the DW_AT_ranges attribute is the offset in the
+ .debug_ranges section. */
+ if (dwarf2_ranges_read (ranges_offset, &lowpc, &highpc, cu,
+ nullptr))
+ has_pc_info = 1;
+ }
+ break;
+
default:
break;
}
outside their CU (they do however referencing other types via
DW_FORM_ref_sig8). */
-static struct partial_die_info *
+static const struct cu_partial_die_info
find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu)
{
struct dwarf2_per_objfile *dwarf2_per_objfile
{
pd = cu->find_partial_die (sect_off);
if (pd != NULL)
- return pd;
+ return { cu, pd };
/* We missed recording what we needed.
Load all dies and try again. */
per_cu = cu->per_cu;
_("could not find partial DIE %s "
"in cache [from module %s]\n"),
sect_offset_str (sect_off), bfd_get_filename (objfile->obfd));
- return pd;
+ return { per_cu->cu, pd };
}
/* See if we can figure out if the class lives in a namespace. We do
real_pdi = struct_pdi;
while (real_pdi->has_specification)
- real_pdi = find_partial_die (real_pdi->spec_offset,
- real_pdi->spec_is_dwz, cu);
+ {
+ auto res = find_partial_die (real_pdi->spec_offset,
+ real_pdi->spec_is_dwz, cu);
+ real_pdi = res.pdi;
+ cu = res.cu;
+ }
if (real_pdi->die_parent != NULL)
return;
{
struct partial_die_info *spec_die;
- spec_die = find_partial_die (spec_offset, spec_is_dwz, cu);
+ auto res = find_partial_die (spec_offset, spec_is_dwz, cu);
+ spec_die = res.pdi;
+ cu = res.cu;
spec_die->fixup (cu);
case DW_FORM_implicit_const:
DW_SND (attr) = implicit_const;
break;
+ case DW_FORM_addrx:
case DW_FORM_GNU_addr_index:
if (reader->dwo_file == NULL)
{
DW_ADDR (attr) = read_addr_index_from_leb128 (cu, info_ptr, &bytes_read);
info_ptr += bytes_read;
break;
+ case DW_FORM_strx:
+ case DW_FORM_strx1:
+ case DW_FORM_strx2:
+ case DW_FORM_strx3:
+ case DW_FORM_strx4:
case DW_FORM_GNU_str_index:
if (reader->dwo_file == NULL)
{
bfd_get_filename (abfd));
}
{
- ULONGEST str_index =
- read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
-
+ ULONGEST str_index;
+ if (form == DW_FORM_strx1)
+ {
+ str_index = read_1_byte (abfd, info_ptr);
+ info_ptr += 1;
+ }
+ else if (form == DW_FORM_strx2)
+ {
+ str_index = read_2_bytes (abfd, info_ptr);
+ info_ptr += 2;
+ }
+ else if (form == DW_FORM_strx3)
+ {
+ str_index = read_3_bytes (abfd, info_ptr);
+ info_ptr += 3;
+ }
+ else if (form == DW_FORM_strx4)
+ {
+ str_index = read_4_bytes (abfd, info_ptr);
+ info_ptr += 4;
+ }
+ else
+ {
+ str_index = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
+ info_ptr += bytes_read;
+ }
DW_STRING (attr) = read_str_index (reader, str_index);
DW_STRING_IS_CANONICAL (attr) = 0;
- info_ptr += bytes_read;
}
break;
default:
return bfd_get_signed_16 (abfd, buf);
}
+static unsigned int
+read_3_bytes (bfd *abfd, const gdb_byte *buf)
+{
+ unsigned int result = 0;
+ for (int i = 0; i < 3; ++i)
+ {
+ unsigned char byte = bfd_get_8 (abfd, buf);
+ buf++;
+ result |= ((unsigned int) byte << (i * 8));
+ }
+ return result;
+}
+
static unsigned int
read_4_bytes (bfd *abfd, const gdb_byte *buf)
{
addr_size);
}
-/* Given a DW_FORM_GNU_str_index, fetch the string.
+/* Given a DW_FORM_GNU_str_index or DW_FORM_strx, fetch the string.
This is only used by the Fission support. */
static const char *
&reader->dwo_file->sections.str_offsets;
const gdb_byte *info_ptr;
ULONGEST str_offset;
- static const char form_name[] = "DW_FORM_GNU_str_index";
+ static const char form_name[] = "DW_FORM_GNU_str_index or DW_FORM_strx";
dwarf2_read_section (objfile, str_section);
dwarf2_read_section (objfile, str_offsets_section);
{
if (attr->form == DW_FORM_strp || attr->form == DW_FORM_line_strp
|| attr->form == DW_FORM_string
+ || attr->form == DW_FORM_strx
|| attr->form == DW_FORM_GNU_str_index
|| attr->form == DW_FORM_GNU_strp_alt)
str = DW_STRING (attr);
{
const char *dir = fe->include_dir (m_line_header);
- m_last_subfile = m_cu->builder->get_current_subfile ();
+ m_last_subfile = m_cu->get_builder ()->get_current_subfile ();
m_line_has_non_zero_discriminator = m_discriminator != 0;
dwarf2_start_subfile (m_cu, fe->name, dir);
}
int line_has_non_zero_discriminator,
struct subfile *last_subfile)
{
- if (cu->builder->get_current_subfile () != last_subfile)
+ if (cu->get_builder ()->get_current_subfile () != last_subfile)
return 1;
if (line != last_line)
return 1;
}
if (cu != nullptr)
- cu->builder->record_line (subfile, line, addr);
+ cu->get_builder ()->record_line (subfile, line, addr);
}
/* Subroutine of dwarf_decode_lines_1 to simplify it.
fe->included_p = 1;
if (m_record_lines_p && (producer_is_codewarrior (m_cu) || m_is_stmt))
{
- if (m_last_subfile != m_cu->builder->get_current_subfile ()
+ if (m_last_subfile != m_cu->get_builder ()->get_current_subfile ()
|| end_sequence)
{
dwarf_finish_line (m_gdbarch, m_last_subfile, m_address,
m_line_has_non_zero_discriminator,
m_last_subfile))
{
+ buildsym_compunit *builder = m_cu->get_builder ();
dwarf_record_line_1 (m_gdbarch,
- m_cu->builder->get_current_subfile (),
+ builder->get_current_subfile (),
m_line, m_address,
m_currently_recording_lines ? m_cu : nullptr);
}
- m_last_subfile = m_cu->builder->get_current_subfile ();
+ m_last_subfile = m_cu->get_builder ()->get_current_subfile ();
m_last_line = m_line;
}
}
/* Make sure a symtab is created for every file, even files
which contain only variables (i.e. no code with associated
line numbers). */
- struct compunit_symtab *cust = cu->builder->get_compunit_symtab ();
+ buildsym_compunit *builder = cu->get_builder ();
+ struct compunit_symtab *cust = builder->get_compunit_symtab ();
int i;
for (i = 0; i < lh->file_names.size (); i++)
dwarf2_start_subfile (cu, fe.name, fe.include_dir (lh));
- if (cu->builder->get_current_subfile ()->symtab == NULL)
+ if (builder->get_current_subfile ()->symtab == NULL)
{
- cu->builder->get_current_subfile ()->symtab
+ builder->get_current_subfile ()->symtab
= allocate_symtab (cust,
- cu->builder->get_current_subfile ()->name);
+ builder->get_current_subfile ()->name);
}
- fe.symtab = cu->builder->get_current_subfile ()->symtab;
+ fe.symtab = builder->get_current_subfile ()->symtab;
}
}
}
filename = copy;
}
- cu->builder->start_subfile (filename);
+ cu->get_builder ()->start_subfile (filename);
if (copy != NULL)
xfree (copy);
/* Start a symtab for DWARF. NAME, COMP_DIR, LOW_PC are passed to the
buildsym_compunit constructor. */
-static struct compunit_symtab *
-dwarf2_start_symtab (struct dwarf2_cu *cu,
- const char *name, const char *comp_dir, CORE_ADDR low_pc)
+struct compunit_symtab *
+dwarf2_cu::start_symtab (const char *name, const char *comp_dir,
+ CORE_ADDR low_pc)
{
- gdb_assert (cu->builder == nullptr);
+ gdb_assert (m_builder == nullptr);
- cu->builder.reset (new struct buildsym_compunit
- (cu->per_cu->dwarf2_per_objfile->objfile,
- name, comp_dir, cu->language, low_pc));
+ m_builder.reset (new struct buildsym_compunit
+ (per_cu->dwarf2_per_objfile->objfile,
+ name, comp_dir, language, low_pc));
- cu->list_in_scope = cu->builder->get_file_symbols ();
+ list_in_scope = get_builder ()->get_file_symbols ();
- cu->builder->record_debugformat ("DWARF 2");
- cu->builder->record_producer (cu->producer);
+ get_builder ()->record_debugformat ("DWARF 2");
+ get_builder ()->record_producer (producer);
- cu->processing_has_namespace_info = false;
+ processing_has_namespace_info = false;
- return cu->builder->get_compunit_symtab ();
+ return get_builder ()->get_compunit_symtab ();
}
static void
/* Handle one degenerate form of location expression specially, to
preserve GDB's previous behavior when section offsets are
- specified. If this is just a DW_OP_addr or DW_OP_GNU_addr_index
- then mark this symbol as LOC_STATIC. */
+ specified. If this is just a DW_OP_addr, DW_OP_addrx, or
+ DW_OP_GNU_addr_index then mark this symbol as LOC_STATIC. */
if (attr_form_is_block (attr)
&& ((DW_BLOCK (attr)->data[0] == DW_OP_addr
&& DW_BLOCK (attr)->size == 1 + cu_header->addr_size)
- || (DW_BLOCK (attr)->data[0] == DW_OP_GNU_addr_index
+ || ((DW_BLOCK (attr)->data[0] == DW_OP_GNU_addr_index
+ || DW_BLOCK (attr)->data[0] == DW_OP_addrx)
&& (DW_BLOCK (attr)->size
== 1 + leb128_size (&DW_BLOCK (attr)->data[1])))))
{
access them globally. For instance, we want to be able
to break on a nested subprogram without having to
specify the context. */
- list_to_add = cu->builder->get_global_symbols ();
+ list_to_add = cu->get_builder ()->get_global_symbols ();
}
else
{
if (!suppress_add)
{
if (attr2 && (DW_UNSND (attr2) != 0))
- list_to_add = cu->builder->get_global_symbols ();
+ list_to_add = cu->get_builder ()->get_global_symbols ();
else
list_to_add = cu->list_in_scope;
}
/* A variable with DW_AT_external is never static,
but it may be block-scoped. */
list_to_add
- = (cu->list_in_scope == cu->builder->get_file_symbols ()
- ? cu->builder->get_global_symbols ()
+ = ((cu->list_in_scope
+ == cu->get_builder ()->get_file_symbols ())
+ ? cu->get_builder ()->get_global_symbols ()
: cu->list_in_scope);
}
else
/* A variable with DW_AT_external is never static, but it
may be block-scoped. */
list_to_add
- = (cu->list_in_scope == cu->builder->get_file_symbols ()
- ? cu->builder->get_global_symbols ()
+ = ((cu->list_in_scope
+ == cu->get_builder ()->get_file_symbols ())
+ ? cu->get_builder ()->get_global_symbols ()
: cu->list_in_scope);
SYMBOL_ACLASS_INDEX (sym) = LOC_UNRESOLVED;
pretend it's a local variable in that case so that the user can
still see it. */
struct context_stack *curr
- = cu->builder->get_current_context_stack ();
+ = cu->get_builder ()->get_current_context_stack ();
if (curr != nullptr && curr->name != nullptr)
SYMBOL_IS_ARGUMENT (sym) = 1;
attr = dwarf2_attr (die, DW_AT_location, cu);
if (!suppress_add)
{
+ buildsym_compunit *builder = cu->get_builder ();
list_to_add
- = (cu->list_in_scope == cu->builder->get_file_symbols ()
+ = (cu->list_in_scope == builder->get_file_symbols ()
&& cu->language == language_cplus
- ? cu->builder->get_global_symbols ()
+ ? builder->get_global_symbols ()
: cu->list_in_scope);
/* The semantics of C++ state that "struct foo {
DW_TAG_class_type, etc. block. */
list_to_add
- = (cu->list_in_scope == cu->builder->get_file_symbols ()
+ = (cu->list_in_scope == cu->get_builder ()->get_file_symbols ()
&& cu->language == language_cplus
- ? cu->builder->get_global_symbols ()
+ ? cu->get_builder ()->get_global_symbols ()
: cu->list_in_scope);
}
break;
case DW_TAG_imported_declaration:
case DW_TAG_namespace:
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
- list_to_add = cu->builder->get_global_symbols ();
+ list_to_add = cu->get_builder ()->get_global_symbols ();
break;
case DW_TAG_module:
SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF;
SYMBOL_DOMAIN (sym) = MODULE_DOMAIN;
- list_to_add = cu->builder->get_global_symbols ();
+ list_to_add = cu->get_builder ()->get_global_symbols ();
break;
case DW_TAG_common_block:
SYMBOL_ACLASS_INDEX (sym) = LOC_COMMON_BLOCK;
namespaces based on the demangled name. */
if (!cu->processing_has_namespace_info
&& cu->language == language_cplus)
- cp_scan_for_anonymous_namespaces (cu->builder.get (), sym, objfile);
+ cp_scan_for_anonymous_namespaces (cu->get_builder (), sym, objfile);
}
return (sym);
}
switch (attr->form)
{
case DW_FORM_addr:
+ case DW_FORM_addrx:
case DW_FORM_GNU_addr_index:
{
gdb_byte *data;
break;
case DW_FORM_string:
case DW_FORM_strp:
+ case DW_FORM_strx:
case DW_FORM_GNU_str_index:
case DW_FORM_GNU_strp_alt:
/* DW_STRING is already allocated on the objfile obstack, point
return follow_die_ref (die, attr, ext_cu);
}
+/* A convenience function that returns an "unknown" DWARF name,
+ including the value of V. STR is the name of the entity being
+ printed, e.g., "TAG". */
+
+static const char *
+dwarf_unknown (const char *str, unsigned v)
+{
+ char *cell = get_print_cell ();
+ xsnprintf (cell, PRINT_CELL_SIZE, "DW_%s_<unknown: %u>", str, v);
+ return cell;
+}
+
/* Convert a DIE tag into its string name. */
static const char *
const char *name = get_DW_TAG_name (tag);
if (name == NULL)
- return "DW_TAG_<unknown>";
+ return dwarf_unknown ("TAG", tag);
return name;
}
name = get_DW_AT_name (attr);
if (name == NULL)
- return "DW_AT_<unknown>";
+ return dwarf_unknown ("AT", attr);
return name;
}
const char *name = get_DW_FORM_name (form);
if (name == NULL)
- return "DW_FORM_<unknown>";
+ return dwarf_unknown ("FORM", form);
return name;
}
const char *name = get_DW_ATE_name (enc);
if (name == NULL)
- return "DW_ATE_<unknown>";
+ return dwarf_unknown ("ATE", enc);
return name;
}
switch (die->attrs[i].form)
{
case DW_FORM_addr:
+ case DW_FORM_addrx:
case DW_FORM_GNU_addr_index:
fprintf_unfiltered (f, "address: ");
fputs_filtered (hex_string (DW_ADDR (&die->attrs[i])), f);
case DW_FORM_string:
case DW_FORM_strp:
case DW_FORM_line_strp:
+ case DW_FORM_strx:
case DW_FORM_GNU_str_index:
case DW_FORM_GNU_strp_alt:
fprintf_unfiltered (f, "string: \"%s\" (%s canonicalized)",
*ref_cu = target_cu;
temp_die.sect_off = sect_off;
+
+ if (target_cu != cu)
+ target_cu->ancestor = cu;
+
return (struct die_info *) htab_find_with_hash (target_cu->die_hash,
&temp_die,
to_underlying (sect_off));
switch (attr->form)
{
case DW_FORM_addr:
+ case DW_FORM_addrx:
case DW_FORM_GNU_addr_index:
{
gdb_byte *tem;
break;
case DW_FORM_string:
case DW_FORM_strp:
+ case DW_FORM_strx:
case DW_FORM_GNU_str_index:
case DW_FORM_GNU_strp_alt:
/* DW_STRING is already allocated on the objfile obstack, point
struct dwarf2_cu **ref_cu)
{
struct die_info temp_die;
- struct dwarf2_cu *sig_cu;
+ struct dwarf2_cu *sig_cu, *cu = *ref_cu;
struct die_info *die;
/* While it might be nice to assert sig_type->type == NULL here,
}
*ref_cu = sig_cu;
+ if (sig_cu != cu)
+ sig_cu->ancestor = cu;
+
return die;
}
case DW_OP_GNU_uninit:
break;
+ case DW_OP_addrx:
case DW_OP_GNU_addr_index:
case DW_OP_GNU_const_index:
stack[++stacki] = read_addr_index_from_leb128 (cu, &data[i],
{
/* Note: We don't create a macro table for this compilation unit
at all until we actually get a filename. */
- struct macro_table *macro_table = cu->builder->get_macro_table ();
+ struct macro_table *macro_table = cu->get_builder ()->get_macro_table ();
/* If we have no current file, then this must be the start_file
directive for the compilation unit's main source file. */
bytes += 4 + read_4_bytes (abfd, bytes);
break;
+ case DW_FORM_addrx:
case DW_FORM_sdata:
+ case DW_FORM_strx:
case DW_FORM_udata:
case DW_FORM_GNU_addr_index:
case DW_FORM_GNU_str_index:
is_define ? _("definition") : _("undefinition"),
line == 0 ? _("zero") : _("non-zero"), line, body);
- if (is_define)
+ if (body == NULL)
+ {
+ /* Fedora's rpm-build's "debugedit" binary
+ corrupted .debug_macro sections.
+
+ For more info, see
+ https://bugzilla.redhat.com/show_bug.cgi?id=1708786 */
+ complaint (_("debug info gives %s invalid macro %s "
+ "without body (corrupted?) at line %d "
+ "on file %s"),
+ at_commandline ? _("command-line") : _("in-file"),
+ is_define ? _("definition") : _("undefinition"),
+ line, current_file->filename);
+ }
+ else if (is_define)
parse_macro_definition (current_file, line, body);
else
{
}
else
{
- this_cu = dwarf2_per_objfile->all_comp_units[low];
if (low == dwarf2_per_objfile->all_comp_units.size () - 1
&& sect_off >= this_cu->sect_off + this_cu->length)
error (_("invalid dwarf2 offset %s"), sect_offset_str (sect_off));
}
}
-/* Cleanup function for the dwarf2_per_objfile data. */
-
-static void
-dwarf2_free_objfile (struct objfile *objfile, void *datum)
-{
- struct dwarf2_per_objfile *dwarf2_per_objfile
- = static_cast<struct dwarf2_per_objfile *> (datum);
-
- delete dwarf2_per_objfile;
-}
-
/* A set of CU "per_cu" pointer, DIE offset, and GDB type pointer.
We store these in a hash table separate from the DIEs, and preserve them
when the DIEs are flushed out of cache.
void
_initialize_dwarf2_read (void)
{
- dwarf2_objfile_data_key
- = register_objfile_data_with_cleanup (nullptr, dwarf2_free_objfile);
-
add_prefix_cmd ("dwarf", class_maintenance, set_dwarf_cmd, _("\
Set DWARF specific variables.\n\
Configure DWARF variables such as the cache size"),