unsigned int addr_size,
const gdb_byte *op_ptr, const gdb_byte *op_end,
CORE_ADDR *initial,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
/* We keep a counter so that labels and other objects we create have
std::vector<bool> ®isters_used,
unsigned int addr_size,
const gdb_byte *op_ptr, const gdb_byte *op_end,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
do_compile_dwarf_expr_to_c (2, stream, GCC_UINTPTR, result_name, sym, pc,
std::vector<bool> ®isters_used,
unsigned int addr_size,
const gdb_byte *op_ptr, const gdb_byte *op_end,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
do_compile_dwarf_expr_to_c (2, stream, "unsigned long ", result_name,
struct ui_file;
struct gdbarch;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct dwarf2_per_objfile;
struct symbol;
struct dynamic_prop;
unsigned int addr_size,
const gdb_byte *op_ptr,
const gdb_byte *op_end,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile);
/* Compile a DWARF bounds expression to C, suitable for use by the
unsigned int addr_size,
const gdb_byte *op_ptr,
const gdb_byte *op_end,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile);
extern void compile_print_value (struct value *val, void *data_voidp);
struct gdbarch *gdbarch = objfile->arch ();
dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
- gdb::unordered_map<sect_offset, dwarf2_per_cu_data *>
- debug_info_offset_to_per_cu;
+ gdb::unordered_map<sect_offset, dwarf2_per_cu *> debug_info_offset_to_per_cu;
for (const auto &per_cu : per_bfd->all_units)
{
/* A TU will not need aranges, and skipping them here is an easy
sect_offset_str (sect_offset (debug_info_offset)));
return false;
}
- dwarf2_per_cu_data *const per_cu = per_cu_it->second;
+ dwarf2_per_cu *const per_cu = per_cu_it->second;
const uint8_t address_size = *addr++;
if (address_size < 1 || address_size > 8)
#include "gdbsupport/unordered_set.h"
struct dwarf2_locexpr_baton;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct dwarf2_per_objfile;
/* struct call_site_parameter can be referenced in callees by several ways. */
struct call_site
{
- call_site (unrelocated_addr pc, dwarf2_per_cu_data *per_cu,
+ call_site (unrelocated_addr pc, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
: per_cu (per_cu), per_objfile (per_objfile), m_unrelocated_pc (pc)
{}
/* * CU of the function where the call is located. It gets used
for DWARF blocks execution in the parameter array below. */
- dwarf2_per_cu_data *const per_cu = nullptr;
+ dwarf2_per_cu *const per_cu = nullptr;
/* objfile of the function where the call is located. */
cooked_index_entry *
cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag,
cooked_index_flag flags, enum language lang,
- const char *name,
- cooked_index_entry_ref parent_entry,
- dwarf2_per_cu_data *per_cu)
+ const char *name, cooked_index_entry_ref parent_entry,
+ dwarf2_per_cu *per_cu)
{
cooked_index_entry *result = create (die_offset, tag, flags, lang, name,
parent_entry, per_cu);
/* See cooked-index.h. */
-dwarf2_per_cu_data *
+dwarf2_per_cu *
cooked_index::lookup (unrelocated_addr addr)
{
/* Ensure that the address maps are ready. */
wait (cooked_state::MAIN_AVAILABLE, true);
for (const auto &shard : m_shards)
{
- dwarf2_per_cu_data *result = shard->lookup (addr);
+ dwarf2_per_cu *result = shard->lookup (addr);
if (result != nullptr)
return result;
}
if (obj != nullptr)
{
- const dwarf2_per_cu_data *per_cu
- = static_cast<const dwarf2_per_cu_data *> (obj);
- gdb_printf (" [%s] ((dwarf2_per_cu_data *) %p)\n",
+ const dwarf2_per_cu *per_cu
+ = static_cast<const dwarf2_per_cu *> (obj);
+ gdb_printf (" [%s] ((dwarf2_per_cu *) %p)\n",
start_addr_str, per_cu);
}
else
- gdb_printf (" [%s] ((dwarf2_per_cu_data *) 0)\n",
- start_addr_str);
+ gdb_printf (" [%s] ((dwarf2_per_cu *) 0)\n", start_addr_str);
return 0;
});
#include <condition_variable>
#endif /* CXX_STD_THREAD */
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct dwarf2_per_bfd;
struct index_cache_store_context;
struct cooked_index_entry;
cooked_index_flag flags_,
enum language lang_, const char *name_,
cooked_index_entry_ref parent_entry_,
- dwarf2_per_cu_data *per_cu_)
+ dwarf2_per_cu *per_cu_)
: name (name_),
tag (tag_),
flags (flags_),
/* The offset of this DIE. */
sect_offset die_offset;
/* The CU from which this entry originates. */
- dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
private:
cooked_index_flag flags, enum language lang,
const char *name,
cooked_index_entry_ref parent_entry,
- dwarf2_per_cu_data *per_cu);
+ dwarf2_per_cu *per_cu);
/* Install a new fixed addrmap from the given mutable addrmap. */
void install_addrmap (addrmap_mutable *map)
/* Look up ADDR in the address map, and return either the
corresponding CU, or nullptr if the address could not be
found. */
- dwarf2_per_cu_data *lookup (unrelocated_addr addr)
+ dwarf2_per_cu *lookup (unrelocated_addr addr)
{
if (m_addrmap == nullptr)
return nullptr;
- return (static_cast<dwarf2_per_cu_data *>
- (m_addrmap->find ((CORE_ADDR) addr)));
+ return (static_cast<dwarf2_per_cu *> (m_addrmap->find ((CORE_ADDR) addr)));
}
/* Create a new cooked_index_entry and register it with this object.
enum language lang,
const char *name,
cooked_index_entry_ref parent_entry,
- dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu *per_cu)
{
return new (&m_storage) cooked_index_entry (die_offset, tag, flags,
lang, name, parent_entry,
std::vector<cooked_index_entry *> m_entries;
/* If we found an entry with 'is_main' set, store it here. */
cooked_index_entry *m_main = nullptr;
- /* The addrmap. This maps address ranges to dwarf2_per_cu_data
- objects. */
+ /* The addrmap. This maps address ranges to dwarf2_per_cu objects. */
addrmap_fixed *m_addrmap = nullptr;
/* Storage for canonical names. */
std::vector<gdb::unique_xmalloc_ptr<char>> m_names;
/* Return the DIE reader corresponding to PER_CU. If no such reader
has been registered, return NULL. */
- cutu_reader *get_reader (dwarf2_per_cu_data *per_cu);
+ cutu_reader *get_reader (dwarf2_per_cu *per_cu);
/* Preserve READER by storing it in the local hash table. */
cutu_reader *preserve (cutu_reader_up reader);
cooked_index_flag flags,
const char *name,
cooked_index_entry_ref parent_entry,
- dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu *per_cu)
{
return m_shard->add (die_offset, tag, flags, per_cu->lang (),
name, parent_entry, per_cu);
/* Look up ADDR in the address map, and return either the
corresponding CU, or nullptr if the address could not be
found. */
- dwarf2_per_cu_data *lookup (unrelocated_addr addr) override;
+ dwarf2_per_cu *lookup (unrelocated_addr addr) override;
/* Return a new vector of all the addrmaps used by all the indexes
held by this object.
/* Initialize dwarf2_cu to read PER_CU, in the context of PER_OBJFILE. */
-dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile)
+dwarf2_cu::dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
: per_cu (per_cu),
per_objfile (per_objfile),
m_mark (false),
m_mark = true;
- for (dwarf2_per_cu_data *per_cu : m_dependencies)
+ for (dwarf2_per_cu *per_cu : m_dependencies)
{
/* cu->m_dependencies references may not yet have been ever
read if QUIT aborts reading of the chain. As such
/* Internal state when decoding a particular compilation unit. */
struct dwarf2_cu
{
- explicit dwarf2_cu (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile);
+ explicit dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile);
DISABLE_COPY_AND_ASSIGN (dwarf2_cu);
}
/* Add a dependence relationship from this cu to REF_PER_CU. */
- void add_dependence (struct dwarf2_per_cu_data *ref_per_cu)
+ void add_dependence (dwarf2_per_cu *ref_per_cu)
{ m_dependencies.emplace (ref_per_cu); }
/* The header of the compilation unit. */
symbols are being read. */
buildsym_compunit_up m_builder;
- /* A set of pointers to dwarf2_per_cu_data objects for compilation
- units referenced by this one. Only used during full symbol processing;
- partial symbol tables do not have dependencies. */
- gdb::unordered_set<dwarf2_per_cu_data *> m_dependencies;
+ /* A set of pointers to dwarf2_per_cu objects for compilation units referenced
+ by this one. Only used during full symbol processing; partial symbol
+ tables do not have dependencies. */
+ gdb::unordered_set<dwarf2_per_cu *> m_dependencies;
public:
/* The generic symbol table building routines have separate lists for
auto_obstack comp_unit_obstack;
/* Backlink to our per_cu entry. */
- struct dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
/* The dwarf2_per_objfile that owns this. */
dwarf2_per_objfile *per_objfile;
/* Ensure that a PER_CU is defined and throw an exception otherwise. */
static void
-ensure_have_per_cu (dwarf2_per_cu_data *per_cu, const char* op_name)
+ensure_have_per_cu (dwarf2_per_cu *per_cu, const char *op_name)
{
if (per_cu == nullptr)
throw_error (GENERIC_ERROR,
dwarf2_per_objfile *per_objfile = nullptr;
/* The CU from which this closure's expression came. */
- dwarf2_per_cu_data *per_cu = nullptr;
+ dwarf2_per_cu *per_cu = nullptr;
/* The pieces describing this variable. */
std::vector<dwarf_expr_piece> pieces;
PIECES. */
static piece_closure *
-allocate_piece_closure (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile,
+allocate_piece_closure (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
std::vector<dwarf_expr_piece> &&pieces,
const frame_info_ptr &frame)
{
found at SECT_OFF. */
static value *
-sect_variable_value (sect_offset sect_off,
- dwarf2_per_cu_data *per_cu,
+sect_variable_value (sect_offset sect_off, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
const char *var_name = nullptr;
ensure_have_per_cu (this->m_per_cu, "DW_OP_entry_value");
ensure_have_frame (this->m_frame, "DW_OP_entry_value");
- dwarf2_per_cu_data *caller_per_cu;
+ dwarf2_per_cu *caller_per_cu;
dwarf2_per_objfile *caller_per_objfile;
frame_info_ptr caller_frame = get_prev_frame (this->m_frame);
call_site_parameter *parameter
value *
dwarf_expr_context::evaluate (const gdb_byte *addr, size_t len, bool as_lval,
- dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame,
+ dwarf2_per_cu *per_cu,
+ const frame_info_ptr &frame,
const struct property_addr_info *addr_info,
struct type *type, struct type *subobj_type,
LONGEST subobj_offset)
The ADDR_INFO property can be specified to override the range of
memory addresses with the passed in buffer. */
value *evaluate (const gdb_byte *addr, size_t len, bool as_lval,
- dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame,
+ dwarf2_per_cu *per_cu, const frame_info_ptr &frame,
const struct property_addr_info *addr_info = nullptr,
struct type *type = nullptr,
struct type *subobj_type = nullptr,
frame_info_ptr m_frame = nullptr;
/* Compilation unit used for the evaluation. */
- dwarf2_per_cu_data *m_per_cu = nullptr;
+ dwarf2_per_cu *m_per_cu = nullptr;
/* Property address info used for the evaluation. */
const struct property_addr_info *m_addr_info = nullptr;
int
dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
- struct dwarf2_per_cu_data *data,
- int *regnum_out, LONGEST *offset_out,
- CORE_ADDR *text_offset_out,
+ dwarf2_per_cu *data, int *regnum_out,
+ LONGEST *offset_out, CORE_ADDR *text_offset_out,
const gdb_byte **cfa_start_out,
const gdb_byte **cfa_end_out)
{
struct gdbarch;
class frame_info_ptr;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct agent_expr;
struct axs_value;
in other cases. These are only used when 0 is returned. */
extern int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
- struct dwarf2_per_cu_data *data,
- int *regnum_out, LONGEST *offset_out,
+ dwarf2_per_cu *data, int *regnum_out,
+ LONGEST *offset_out,
CORE_ADDR *text_offset_out,
const gdb_byte **cfa_start_out,
const gdb_byte **cfa_end_out);
-
/* Allocate a new instance of the function unique data.
The main purpose of this custom function data object is to allow caching the
}
}
-using cu_index_map
- = gdb::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
+using cu_index_map = gdb::unordered_map<const dwarf2_per_cu *, unsigned int>;
/* Helper struct for building the address table. */
struct addrmap_index_data
int
addrmap_index_data::operator() (CORE_ADDR start_addr, const void *obj)
{
- const dwarf2_per_cu_data *per_cu
- = static_cast<const dwarf2_per_cu_data *> (obj);
+ const dwarf2_per_cu *per_cu = static_cast<const dwarf2_per_cu *> (obj);
if (previous_valid)
add_address_entry (addr_vec,
m_debugstrlookup.file_write (file_str);
}
- void add_cu (dwarf2_per_cu_data *per_cu, offset_type index)
+ void add_cu (dwarf2_per_cu *per_cu, offset_type index)
{
m_cu_index_htab.emplace (per_cu, index);
}
data_buf objfile_cu_list;
data_buf dwz_cu_list;
- /* While we're scanning CU's create a table that maps a dwarf2_per_cu_data
- (which is what addrmap records) to its index (which is what is recorded
- in the index file). This will later be needed to write the address
- table. */
+ /* While we're scanning CU's create a table that maps a dwarf2_per_cu (which
+ is what addrmap records) to its index (which is what is recorded in the
+ index file). This will later be needed to write the address table. */
cu_index_map cu_index_htab;
cu_index_htab.reserve (per_bfd->all_units.size ());
int counter = 0;
for (int i = 0; i < per_bfd->all_units.size (); ++i)
{
- dwarf2_per_cu_data *per_cu = per_bfd->all_units[i].get ();
+ dwarf2_per_cu *per_cu = per_bfd->all_units[i].get ();
const auto insertpair = cu_index_htab.emplace (per_cu, counter);
gdb_assert (insertpair.second);
int types_counter = 0;
for (int i = 0; i < per_bfd->all_units.size (); ++i)
{
- dwarf2_per_cu_data *per_cu = per_bfd->all_units[i].get ();
+ dwarf2_per_cu *per_cu = per_bfd->all_units[i].get ();
int &this_counter = per_cu->is_debug_types ? types_counter : counter;
data_buf &this_list = per_cu->is_debug_types ? types_cu_list : cu_list;
static struct value *dwarf2_evaluate_loc_desc_full
(struct type *type, const frame_info_ptr &frame, const gdb_byte *data,
- size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
+ size_t size, dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
struct type *subobj_type, LONGEST subobj_byte_offset, bool as_lval = true);
/* Until these have formal names, we define these here.
The result indicates the kind of entry found. */
static enum debug_loc_kind
-decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
+decode_debug_loclists_addresses (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
const gdb_byte *loc_ptr,
const gdb_byte *buf_end,
The result indicates the kind of entry found. */
static enum debug_loc_kind
-decode_debug_loc_dwo_addresses (dwarf2_per_cu_data *per_cu,
+decode_debug_loc_dwo_addresses (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
const gdb_byte *loc_ptr,
const gdb_byte *buf_end,
dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame,
call_site_parameter_kind kind,
call_site_parameter_u kind_u,
- dwarf2_per_cu_data **per_cu_return,
+ dwarf2_per_cu **per_cu_return,
dwarf2_per_objfile **per_objfile_return)
{
CORE_ADDR func_addr, caller_pc;
dwarf_entry_parameter_to_value (struct call_site_parameter *parameter,
CORE_ADDR deref_size, struct type *type,
const frame_info_ptr &caller_frame,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
const gdb_byte *data_src;
frame_info_ptr caller_frame = get_prev_frame (frame);
struct value *outer_val, *target_val, *val;
struct call_site_parameter *parameter;
- dwarf2_per_cu_data *caller_per_cu;
+ dwarf2_per_cu *caller_per_cu;
dwarf2_per_objfile *caller_per_objfile;
parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
static struct value *
fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
struct type *type)
{
struct value *
indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
const frame_info_ptr &frame, struct type *type,
bool resolve_abstract_p)
static struct value *
dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
const gdb_byte *data, size_t size,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
struct type *subobj_type,
LONGEST subobj_byte_offset,
struct value *
dwarf2_evaluate_loc_desc (struct type *type, const frame_info_ptr &frame,
const gdb_byte *data, size_t size,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile, bool as_lval)
{
return dwarf2_evaluate_loc_desc_full (type, frame, data, size, per_cu,
return 0;
dwarf2_per_objfile *per_objfile = dlbaton->per_objfile;
- dwarf2_per_cu_data *per_cu = dlbaton->per_cu;
+ dwarf2_per_cu *per_cu = dlbaton->per_cu;
dwarf_expr_context ctx (per_objfile, per_cu->addr_size ());
value *result;
const dwarf2_property_baton *baton = prop->baton ();
const gdb_byte *data;
size_t size;
- dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
dwarf2_per_objfile *per_objfile;
if (prop->kind () == PROP_LOCEXPR)
static enum symbol_needs_kind
dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
bfd_endian byte_order,
int addr_size,
static void
dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
unsigned int addr_size, const gdb_byte *op_ptr,
- const gdb_byte *op_end,
- dwarf2_per_cu_data *per_cu,
+ const gdb_byte *op_end, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
gdbarch *arch = expr->gdbarch;
static const gdb_byte *
locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
- CORE_ADDR addr, dwarf2_per_cu_data *per_cu,
+ CORE_ADDR addr, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
const gdb_byte *data, const gdb_byte *end,
unsigned int addr_size)
int offset_size, const gdb_byte *start,
const gdb_byte *data, const gdb_byte *end,
int indent, int all,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
while (data < end
struct ui_file *stream,
const gdb_byte *data, size_t size,
unsigned int addr_size,
- int offset_size, dwarf2_per_cu_data *per_cu,
+ int offset_size, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
const gdb_byte *end = data + size;
struct symbol_computed_ops;
struct dwarf2_per_objfile;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct dwarf2_loclist_baton;
struct agent_expr;
struct axs_value;
call_site_parameter *dwarf_expr_reg_to_entry_parameter
(const frame_info_ptr &frame, call_site_parameter_kind kind,
- call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return,
+ call_site_parameter_u kind_u, dwarf2_per_cu **per_cu_return,
dwarf2_per_objfile **per_objfile_return);
value *dwarf2_evaluate_loc_desc (type *type, const frame_info_ptr &frame,
const gdb_byte *data, size_t size,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
bool as_lval = true);
/* The compilation unit containing the symbol whose location
we're computing. */
- struct dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
};
struct dwarf2_loclist_baton
/* The compilation unit containing the symbol whose location
we're computing. */
- struct dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
/* Non-zero if the location list lives in .debug_loc.dwo.
The format of entries in this section are different. */
/* Fetch the value pointed to by a synthetic pointer. */
extern struct value *indirect_synthetic_pointer
- (sect_offset die, LONGEST byte_offset, dwarf2_per_cu_data *per_cu,
+ (sect_offset die, LONGEST byte_offset, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile, const frame_info_ptr &frame,
struct type *type, bool resolve_abstract_p = false);
/* Look up ADDR, and return either the corresponding CU, or nullptr
if the address could not be found. */
- virtual dwarf2_per_cu_data *lookup (unrelocated_addr addr)
+ virtual dwarf2_per_cu *lookup (unrelocated_addr addr)
{ return nullptr; }
};
cooked_index_flag flags = 0;
sect_offset die_offset {};
enum language lang = language_unknown;
- dwarf2_per_cu_data *per_cu = nullptr;
+ dwarf2_per_cu *per_cu = nullptr;
for (const auto &attr : indexval.attr_vec)
{
ULONGEST ull;
/* The shortcut table data. */
gdb::array_view<const gdb_byte> shortcut_table;
- /* An address map that maps from PC to dwarf2_per_cu_data. */
+ /* An address map that maps from PC to dwarf2_per_cu. */
addrmap_fixed *index_addrmap = nullptr;
/* Return the index into the constant pool of the name of the IDXth
return version >= 8;
}
- dwarf2_per_cu_data *lookup (unrelocated_addr addr) override
+ dwarf2_per_cu *lookup (unrelocated_addr addr) override
{
if (index_addrmap == nullptr)
return nullptr;
void *obj = index_addrmap->find (static_cast<CORE_ADDR> (addr));
- return static_cast<dwarf2_per_cu_data *> (obj);
+ return static_cast<dwarf2_per_cu *> (obj);
}
cooked_index *index_for_writing () override
continue;
}
- dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (cu_index);
+ dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (cu_index);
+
if (!dw2_expand_symtabs_matching_one (per_cu, per_objfile, file_matcher,
expansion_notify, lang_matcher))
return false;
gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
if (lookup_name == nullptr)
{
- for (dwarf2_per_cu_data *per_cu
- : all_units_range (per_objfile->per_bfd))
+ for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
{
QUIT;
ULONGEST length = extract_unsigned_integer (cu_list + 8, 8, BFD_ENDIAN_LITTLE);
cu_list += 2 * 8;
- dwarf2_per_cu_data_up per_cu
+ dwarf2_per_cu_up per_cu
= create_cu_from_index_list (per_bfd, section, is_dwz, sect_off,
length);
per_bfd->all_units.push_back (std::move (per_cu));
/* The section this CU/TU lives in, in the DWO file. */
struct dwarf2_section_info *section;
- /* Same as dwarf2_per_cu_data:{sect_off,length} but in the DWO section. */
+ /* Same as dwarf2_per_cu::{sect_off,length} but in the DWO section. */
sect_offset sect_off;
unsigned int length;
{
public:
- cutu_reader (dwarf2_per_cu_data *this_cu,
+ cutu_reader (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
const struct abbrev_table *abbrev_table,
dwarf2_cu *existing_cu,
enum language pretend_language,
const abbrev_table_cache *cache = nullptr);
- cutu_reader (dwarf2_per_cu_data *this_cu,
+ cutu_reader (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
enum language pretend_language,
struct dwarf2_cu *parent_cu = nullptr,
}
private:
- void init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
+ void init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
dwarf2_cu *existing_cu,
enum language pretend_language);
void prepare_one_comp_unit (struct dwarf2_cu *cu,
enum language pretend_language);
- struct dwarf2_per_cu_data *m_this_cu;
+ dwarf2_per_cu *m_this_cu;
dwarf2_cu_up m_new_cu;
/* The ordinary abbreviation table. */
const struct attribute *,
struct dwarf2_cu *);
-static void load_full_type_unit (dwarf2_per_cu_data *per_cu,
+static void load_full_type_unit (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile);
static void read_signatured_type (signatured_type *sig_type,
const struct abbrev_info *abbrev,
bool do_skip_children = true);
-static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit
+static dwarf2_per_cu *dwarf2_find_containing_comp_unit
(sect_offset sect_off, unsigned int offset_in_dwz,
dwarf2_per_bfd *per_bfd);
static struct type *set_die_type (struct die_info *, struct type *,
struct dwarf2_cu *, bool = false);
-static void load_full_comp_unit (dwarf2_per_cu_data *per_cu,
+static void load_full_comp_unit (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
dwarf2_cu *existing_cu,
bool skip_partial,
enum language pretend_language);
static struct type *get_die_type_at_offset (sect_offset,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile);
static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
-static void queue_comp_unit (dwarf2_per_cu_data *per_cu,
+static void queue_comp_unit (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
enum language pretend_language);
/* See dwarf2/read.h. */
void
-dwarf2_per_cu_data_deleter::operator() (dwarf2_per_cu_data *data)
+dwarf2_per_cu_deleter::operator() (dwarf2_per_cu *data)
{
if (data->is_debug_types)
delete static_cast<signatured_type *> (data);
/* See read.h. */
bool
-dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu_data *per_cu) const
+dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu *per_cu) const
{
if (per_cu->index < this->m_symtabs.size ())
return this->m_symtabs[per_cu->index] != nullptr;
/* See read.h. */
compunit_symtab *
-dwarf2_per_objfile::get_symtab (const dwarf2_per_cu_data *per_cu) const
+dwarf2_per_objfile::get_symtab (const dwarf2_per_cu *per_cu) const
{
if (per_cu->index < this->m_symtabs.size ())
return this->m_symtabs[per_cu->index];
/* See read.h. */
void
-dwarf2_per_objfile::set_symtab (const dwarf2_per_cu_data *per_cu,
+dwarf2_per_objfile::set_symtab (const dwarf2_per_cu *per_cu,
compunit_symtab *symtab)
{
if (per_cu->index >= this->m_symtabs.size ())
You should call age_cached_comp_units after processing the CU. */
static dwarf2_cu *
-load_cu (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
+load_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
bool skip_partial)
{
if (per_cu->is_debug_types)
/* Read in the symbols for PER_CU in the context of PER_OBJFILE. */
static void
-dw2_do_instantiate_symtab (dwarf2_per_cu_data *per_cu,
+dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile, bool skip_partial)
{
{
Returns the resulting symbol table. */
static struct compunit_symtab *
-dw2_instantiate_symtab (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile,
+dw2_instantiate_symtab (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
bool skip_partial)
{
if (!per_objfile->symtab_set_p (per_cu))
/* See read.h. */
-dwarf2_per_cu_data_up
+dwarf2_per_cu_up
dwarf2_per_bfd::allocate_per_cu (dwarf2_section_info *section,
sect_offset sect_off, unsigned int length)
{
- dwarf2_per_cu_data_up result (new dwarf2_per_cu_data (this, section,
- sect_off, length));
+ dwarf2_per_cu_up result (new dwarf2_per_cu (this, section, sect_off,
+ length));
result->index = all_units.size ();
return result;
}
/* See read.h. */
-dwarf2_per_cu_data_up
+dwarf2_per_cu_up
create_cu_from_index_list (dwarf2_per_bfd *per_bfd,
struct dwarf2_section_info *section,
int is_dwz,
sect_offset sect_off, ULONGEST length)
{
- dwarf2_per_cu_data_up the_cu = per_bfd->allocate_per_cu (section, sect_off, length);
+ dwarf2_per_cu_up the_cu
+ = per_bfd->allocate_per_cu (section, sect_off, length);
the_cu->is_dwz = is_dwz;
return the_cu;
}
struct die_info *comp_unit_die)
{
struct dwarf2_cu *cu = reader->cu;
- struct dwarf2_per_cu_data *this_cu = cu->per_cu;
+ dwarf2_per_cu *this_cu = cu->per_cu;
dwarf2_per_objfile *per_objfile = cu->per_objfile;
- struct dwarf2_per_cu_data *lh_cu;
struct attribute *attr;
void **slot;
struct quick_file_names *qfn;
if (comp_unit_die->tag == DW_TAG_partial_unit)
return;
- lh_cu = this_cu;
+ dwarf2_per_cu *lh_cu = this_cu;
slot = NULL;
line_header_up lh;
table for THIS_CU. */
static struct quick_file_names *
-dw2_get_file_names (dwarf2_per_cu_data *this_cu,
- dwarf2_per_objfile *per_objfile)
+dw2_get_file_names (dwarf2_per_cu *this_cu, dwarf2_per_objfile *per_objfile)
{
/* This should never be called for TUs. */
gdb_assert (! this_cu->is_debug_types);
dwarf2_base_index_functions::find_last_source_symtab (struct objfile *objfile)
{
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
- dwarf2_per_cu_data *dwarf_cu
- = per_objfile->per_bfd->all_units.back ().get ();
+ dwarf2_per_cu *dwarf_cu = per_objfile->per_bfd->all_units.back ().get ();
compunit_symtab *cust = dw2_instantiate_symtab (dwarf_cu, per_objfile, false);
if (cust == NULL)
/* See read.h. */
void
-dwarf2_per_cu_data::free_cached_file_names ()
+dwarf2_per_cu::free_cached_file_names ()
{
if (fnd != nullptr)
fnd->forget_fullname ();
for (int i = 0; i < total; ++i)
{
- dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (i);
+ dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (i);
if (!per_objfile->symtab_set_p (per_cu))
++count;
for (int i = 0; i < total_units; ++i)
{
- dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (i);
+ dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (i);
/* We don't want to directly expand a partial CU, because if we
read it with the wrong language, then assertion failures can
bool
dw2_expand_symtabs_matching_one
- (dwarf2_per_cu_data *per_cu,
+ (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
expand_symtabs_file_matcher file_matcher,
expand_symtabs_expansion_listener expansion_notify,
return nullptr;
CORE_ADDR baseaddr = objfile->text_section_offset ();
- struct dwarf2_per_cu_data *data
+ dwarf2_per_cu *data
= per_bfd->index_table->lookup ((unrelocated_addr) (pc - baseaddr));
if (data == nullptr)
return nullptr;
}
}
- for (dwarf2_per_cu_data *per_cu
- : all_units_range (per_objfile->per_bfd))
+ for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
{
/* We only need to look at symtabs not already expanded. */
if (per_cu->is_debug_types || per_objfile->symtab_set_p (per_cu))
THIS_CU. */
static struct dwarf2_section_info *
-get_abbrev_section_for_cu (struct dwarf2_per_cu_data *this_cu)
+get_abbrev_section_for_cu (dwarf2_per_cu *this_cu)
{
struct dwarf2_section_info *abbrev;
dwarf2_per_bfd *per_bfd = this_cu->per_bfd;
abbrev_table_up *result_dwo_abbrev_table)
{
dwarf2_per_objfile *per_objfile = cu->per_objfile;
- dwarf2_per_cu_data *per_cu = cu->per_cu;
+ dwarf2_per_cu *per_cu = cu->per_cu;
struct objfile *objfile = per_objfile->objfile;
bfd *abfd;
const gdb_byte *begin_info_ptr, *info_ptr;
std::lock_guard<std::mutex> guard (dwo_lock);
#endif
- dwarf2_per_cu_data *per_cu = cu->per_cu;
+ dwarf2_per_cu *per_cu = cu->per_cu;
struct dwo_unit *dwo_unit;
const char *comp_dir;
Read a TU directly from a DWO file, bypassing the stub. */
void
-cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
+cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
dwarf2_cu *existing_cu,
enum language pretend_language)
If EXISTING_CU is non-NULL, then use it. Otherwise, a new CU is
allocated. */
-cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
+cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
const struct abbrev_table *abbrev_table,
dwarf2_cu *existing_cu,
When parent_cu is passed, it is used to provide a default value for
str_offsets_base and addr_base from the parent. */
-cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
+cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
enum language pretend_language,
struct dwarf2_cu *parent_cu,
}
cutu_reader *
-cooked_index_storage::get_reader (dwarf2_per_cu_data *per_cu)
+cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
{
int index = per_cu->index;
return (cutu_reader *) htab_find_with_hash (m_reader_hash.get (),
class cooked_indexer
{
public:
-
- cooked_indexer (cooked_index_storage *storage,
- dwarf2_per_cu_data *per_cu,
+ cooked_indexer (cooked_index_storage *storage, dwarf2_per_cu *per_cu,
enum language language)
: m_index_storage (storage),
m_per_cu (per_cu),
/* Scan the attributes for a given DIE and update the out
parameters. Returns a pointer to the byte after the DIE. */
- const gdb_byte *scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
+ const gdb_byte *scan_attributes (dwarf2_per_cu *scanning_per_cu,
cutu_reader *reader,
const gdb_byte *watermark_ptr,
const gdb_byte *info_ptr,
asked to index one CU but to treat the results as if they come
from some including CU; in this case the including CU would be
recorded here. */
- dwarf2_per_cu_data *m_per_cu;
+ dwarf2_per_cu *m_per_cu;
/* The language that we're assuming when reading. */
enum language m_language;
Process compilation unit THIS_CU for a psymtab. */
static void
-process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
+process_psymtab_comp_unit (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
cooked_index_storage *storage)
{
cooked_index_storage *storage)
{
struct dwarf2_cu *cu = reader->cu;
- struct dwarf2_per_cu_data *per_cu = cu->per_cu;
+ dwarf2_per_cu *per_cu = cu->per_cu;
struct die_info *type_unit_die = reader->comp_unit_die;
gdb_assert (per_cu->is_debug_types);
void done_reading ();
/* An iterator for the comp units. */
- typedef std::vector<dwarf2_per_cu_data_up>::iterator unit_iterator;
+ using unit_iterator = std::vector<dwarf2_per_cu_up>::iterator;
/* Process a batch of CUs. This may be called multiple times in
separate threads. TASK_NUMBER indicates which task this is --
cooked_index_storage thread_storage;
for (auto inner = first; inner != end; ++inner)
{
- dwarf2_per_cu_data *per_cu = inner->get ();
+ dwarf2_per_cu *per_cu = inner->get ();
+
try
{
process_psymtab_comp_unit (per_cu, m_per_objfile, &thread_storage);
while (info_ptr < section->buffer + section->size)
{
- dwarf2_per_cu_data_up this_cu;
+ dwarf2_per_cu_up this_cu;
sect_offset sect_off = (sect_offset) (info_ptr - section->buffer);
{
size_t nr_tus = per_bfd->tu_stats.nr_tus;
size_t nr_cus = per_bfd->all_units.size () - nr_tus;
- gdb::array_view<dwarf2_per_cu_data_up> tmp = per_bfd->all_units;
+ gdb::array_view<dwarf2_per_cu_up> tmp = per_bfd->all_units;
per_bfd->all_comp_units = tmp.slice (0, nr_cus);
per_bfd->all_type_units = tmp.slice (nr_cus, nr_tus);
}
/* Add PER_CU to the queue. */
static void
-queue_comp_unit (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile,
+queue_comp_unit (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
enum language pretend_language)
{
per_cu->queued = 1;
that by calling `dwarf2_per_objfile::get_cu` instead. */
static bool
-maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu,
- dwarf2_per_cu_data *per_cu,
+maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
enum language pretend_language)
{
while (!per_objfile->queue->empty ())
{
dwarf2_queue_item &item = per_objfile->queue->front ();
- dwarf2_per_cu_data *per_cu = item.per_cu;
+ dwarf2_per_cu *per_cu = item.per_cu;
if (!per_objfile->symtab_set_p (per_cu))
{
rather than creating a new one. */
static void
-load_full_comp_unit (dwarf2_per_cu_data *this_cu,
+load_full_comp_unit (dwarf2_per_cu *this_cu,
dwarf2_per_objfile *per_objfile,
dwarf2_cu *existing_cu,
bool skip_partial,
static void
recursively_compute_inclusions
(std::vector<compunit_symtab *> *result,
- gdb::unordered_set<dwarf2_per_cu_data *> &all_children,
+ gdb::unordered_set<dwarf2_per_cu *> &all_children,
gdb::unordered_set<compunit_symtab *> &all_type_symtabs,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
struct compunit_symtab *immediate_parent)
{
}
}
- for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
+ for (dwarf2_per_cu *ptr : per_cu->imported_symtabs)
recursively_compute_inclusions (result, all_children,
all_type_symtabs, ptr, per_objfile,
cust);
PER_CU. */
static void
-compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
+compute_compunit_symtab_includes (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
gdb_assert (! per_cu->is_debug_types);
if (cust == NULL)
return;
- gdb::unordered_set<dwarf2_per_cu_data *> all_children;
+ gdb::unordered_set<dwarf2_per_cu *> all_children;
gdb::unordered_set<compunit_symtab *> all_type_symtabs;
- for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
+ for (dwarf2_per_cu *ptr : per_cu->imported_symtabs)
recursively_compute_inclusions (&result_symtabs, all_children,
all_type_symtabs, ptr,
per_objfile, cust);
static void
process_cu_includes (dwarf2_per_objfile *per_objfile)
{
- for (dwarf2_per_cu_data *iter : per_objfile->per_bfd->just_read_cus)
+ for (dwarf2_per_cu *iter : per_objfile->per_bfd->just_read_cus)
{
if (! iter->is_debug_types)
compute_compunit_symtab_includes (iter, per_objfile);
sect_offset sect_off = attr->get_ref_die_offset ();
bool is_dwz = (attr->form == DW_FORM_GNU_ref_alt || cu->per_cu->is_dwz);
dwarf2_per_objfile *per_objfile = cu->per_objfile;
- dwarf2_per_cu_data *per_cu
+ dwarf2_per_cu *per_cu
= dwarf2_find_containing_comp_unit (sect_off, is_dwz,
per_objfile->per_bfd);
sect_offset sect_off = (sect_offset) (info_ptr - section.buffer);
/* The length of the CU gets set by the cutu_reader just below. */
- dwarf2_per_cu_data per_cu (per_bfd, §ion, sect_off, 0);
+ dwarf2_per_cu per_cu (per_bfd, §ion, sect_off, 0);
cutu_reader reader (&per_cu, per_objfile, language_minimal,
cu, &dwo_file);
&& reader->cu->header.offset_in_cu_p (sect_off))
return reader;
- dwarf2_per_cu_data *per_cu
+ dwarf2_per_cu *per_cu
= dwarf2_find_containing_comp_unit (sect_off, is_dwz,
per_objfile->per_bfd);
}
const gdb_byte *
-cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
+cooked_indexer::scan_attributes (dwarf2_per_cu *scanning_per_cu,
cutu_reader *reader,
const gdb_byte *watermark_ptr,
const gdb_byte *info_ptr,
cooked_index *table = wait (objfile, true);
CORE_ADDR baseaddr = objfile->data_section_offset ();
- dwarf2_per_cu_data *per_cu
+ dwarf2_per_cu *per_cu
= table->lookup ((unrelocated_addr) (address - baseaddr));
if (per_cu == nullptr)
return nullptr;
gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
if (lookup_name == nullptr)
{
- for (dwarf2_per_cu_data *per_cu
- : all_units_range (per_objfile->per_bfd))
+ for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
{
QUIT;
/* See read.h. */
unrelocated_addr
-dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile,
+dwarf2_read_addr_index (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
unsigned int addr_index)
{
struct dwarf2_cu *cu = per_objfile->get_cu (per_cu);
if (attr->form == DW_FORM_GNU_ref_alt)
{
- struct dwarf2_per_cu_data *per_cu;
sect_offset sect_off = attr->get_ref_die_offset ();
+ dwarf2_per_cu *per_cu
+ = dwarf2_find_containing_comp_unit (sect_off, 1, per_objfile->per_bfd);
- per_cu = dwarf2_find_containing_comp_unit (sect_off, 1,
- per_objfile->per_bfd);
this_type = get_die_type_at_offset (sect_off, per_cu, per_objfile);
}
else if (attr->form_is_ref ())
else if (offset_in_dwz != cu->per_cu->is_dwz
|| !cu->header.offset_in_cu_p (sect_off))
{
- struct dwarf2_per_cu_data *per_cu;
-
- per_cu = dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
- per_objfile->per_bfd);
+ dwarf2_per_cu *per_cu
+ = dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
+ per_objfile->per_bfd);
dwarf_read_debug_printf_v ("target CU offset: %s, "
"target CU DIEs loaded: %d",
/* See read.h. */
struct dwarf2_locexpr_baton
-dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
- dwarf2_per_cu_data *per_cu,
+dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
gdb::function_view<CORE_ADDR ()> get_frame_pc,
bool resolve_abstract_p)
/* See read.h. */
struct dwarf2_locexpr_baton
-dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu,
- dwarf2_per_cu_data *per_cu,
+dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
gdb::function_view<CORE_ADDR ()> get_frame_pc)
{
const gdb_byte *
dwarf2_fetch_constant_bytes (sect_offset sect_off,
- dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
obstack *obstack,
LONGEST *len)
/* See read.h. */
struct type *
-dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
- dwarf2_per_cu_data *per_cu,
+dwarf2_fetch_die_type_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
const char **var_name)
{
/* See read.h. */
struct type *
-dwarf2_get_die_type (cu_offset die_offset,
- dwarf2_per_cu_data *per_cu,
+dwarf2_get_die_type (cu_offset die_offset, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
sect_offset die_offset_sect = per_cu->sect_off + to_underlying (die_offset);
/* Load the DIEs associated with type unit PER_CU into memory. */
static void
-load_full_type_unit (dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile)
+load_full_type_unit (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
{
struct signatured_type *sig_type;
/* See read.h. */
const comp_unit_head *
-dwarf2_per_cu_data::get_header () const
+dwarf2_per_cu::get_header () const
{
if (!m_header_read_in)
{
/* See read.h. */
int
-dwarf2_per_cu_data::addr_size () const
+dwarf2_per_cu::addr_size () const
{
return this->get_header ()->addr_size;
}
/* See read.h. */
int
-dwarf2_per_cu_data::offset_size () const
+dwarf2_per_cu::offset_size () const
{
return this->get_header ()->offset_size;
}
/* See read.h. */
int
-dwarf2_per_cu_data::ref_addr_size () const
+dwarf2_per_cu::ref_addr_size () const
{
const comp_unit_head *header = this->get_header ();
/* See read.h. */
void
-dwarf2_per_cu_data::set_lang (enum language lang,
- dwarf_source_language dw_lang)
+dwarf2_per_cu::set_lang (enum language lang, dwarf_source_language dw_lang)
{
if (unit_type () == DW_UT_partial)
return;
/* See read.h. */
void
-dwarf2_per_cu_data::ensure_lang (dwarf2_per_objfile *per_objfile)
+dwarf2_per_cu::ensure_lang (dwarf2_per_objfile *per_objfile)
{
if (lang (false) != language_unknown)
return;
dwarf2_find_containing_comp_unit
(sect_offset sect_off,
unsigned int offset_in_dwz,
- const std::vector<dwarf2_per_cu_data_up> &all_units)
+ const std::vector<dwarf2_per_cu_up> &all_units)
{
int low, high;
high = all_units.size () - 1;
while (high > low)
{
- struct dwarf2_per_cu_data *mid_cu;
int mid = low + (high - low) / 2;
+ dwarf2_per_cu *mid_cu = all_units[mid].get ();
- mid_cu = all_units[mid].get ();
if (mid_cu->is_dwz > offset_in_dwz
|| (mid_cu->is_dwz == offset_in_dwz
&& mid_cu->sect_off + mid_cu->length () > sect_off))
/* Locate the .debug_info compilation unit from CU's objfile which contains
the DIE at OFFSET. Raises an error on failure. */
-static struct dwarf2_per_cu_data *
+static dwarf2_per_cu *
dwarf2_find_containing_comp_unit (sect_offset sect_off,
unsigned int offset_in_dwz,
dwarf2_per_bfd *per_bfd)
{
int low = dwarf2_find_containing_comp_unit
(sect_off, offset_in_dwz, per_bfd->all_units);
- dwarf2_per_cu_data *this_cu = per_bfd->all_units[low].get ();
+ dwarf2_per_cu *this_cu = per_bfd->all_units[low].get ();
if (this_cu->is_dwz != offset_in_dwz || this_cu->sect_off > sect_off)
{
auto per_bfd = reinterpret_cast<dwarf2_per_bfd *> (&dummy_per_bfd);
auto section = reinterpret_cast<dwarf2_section_info *> (&dummy_section);
- return dwarf2_per_cu_data_up (new dwarf2_per_cu_data (per_bfd, section,
- sect_off, length));
+ return dwarf2_per_cu_up (new dwarf2_per_cu (per_bfd, section, sect_off,
+ length));
};
/* Units in the main file. */
- dwarf2_per_cu_data_up one = create_dummy_per_cu (sect_offset (0), 5);
- dwarf2_per_cu_data *one_ptr = one.get ();
- dwarf2_per_cu_data_up two
- = create_dummy_per_cu (sect_offset (one->length ()), 7);
- dwarf2_per_cu_data *two_ptr = two.get ();
+ dwarf2_per_cu_up one = create_dummy_per_cu (sect_offset (0), 5);
+ dwarf2_per_cu *one_ptr = one.get ();
+ dwarf2_per_cu_up two = create_dummy_per_cu (sect_offset (one->length ()), 7);
+ dwarf2_per_cu *two_ptr = two.get ();
/* Units in the supplementary (dwz) file. */
- dwarf2_per_cu_data_up three = create_dummy_per_cu (sect_offset (0), 5);
- dwarf2_per_cu_data *three_ptr = three.get ();
- dwarf2_per_cu_data_up four
+ dwarf2_per_cu_up three = create_dummy_per_cu (sect_offset (0), 5);
+ dwarf2_per_cu *three_ptr = three.get ();
+ dwarf2_per_cu_up four
= create_dummy_per_cu (sect_offset (three->length ()), 7);
- dwarf2_per_cu_data *four_ptr = four.get ();
+ dwarf2_per_cu *four_ptr = four.get ();
three->is_dwz = 1;
four->is_dwz = 1;
- std::vector<dwarf2_per_cu_data_up> units;
+ std::vector<dwarf2_per_cu_up> units;
units.push_back (std::move (one));
units.push_back (std::move (two));
units.push_back (std::move (three));
/* See read.h. */
dwarf2_cu *
-dwarf2_per_objfile::get_cu (dwarf2_per_cu_data *per_cu)
+dwarf2_per_objfile::get_cu (dwarf2_per_cu *per_cu)
{
auto it = m_dwarf2_cus.find (per_cu);
if (it == m_dwarf2_cus.end ())
/* See read.h. */
void
-dwarf2_per_objfile::set_cu (dwarf2_per_cu_data *per_cu,
- dwarf2_cu_up cu)
+dwarf2_per_objfile::set_cu (dwarf2_per_cu *per_cu, dwarf2_cu_up cu)
{
gdb_assert (this->get_cu (per_cu) == nullptr);
/* See read.h. */
void
-dwarf2_per_objfile::remove_cu (dwarf2_per_cu_data *per_cu)
+dwarf2_per_objfile::remove_cu (dwarf2_per_cu *per_cu)
{
auto it = m_dwarf2_cus.find (per_cu);
if (it == m_dwarf2_cus.end ())
or return NULL if the die does not have a saved type. */
static struct type *
-get_die_type_at_offset (sect_offset sect_off,
- dwarf2_per_cu_data *per_cu,
+get_die_type_at_offset (sect_offset sect_off, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile)
{
auto it = per_objfile->die_type_hash.find ({per_cu, sect_off});
struct dwarf2_cu;
struct dwarf2_debug_sections;
struct dwarf2_per_bfd;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct mapped_index;
struct mapped_debug_names;
struct signatured_type;
for. */
struct dwarf2_queue_item
{
- dwarf2_queue_item (dwarf2_per_cu_data *cu, dwarf2_per_objfile *per_objfile,
+ dwarf2_queue_item (dwarf2_per_cu *cu, dwarf2_per_objfile *per_objfile,
enum language lang)
: per_cu (cu),
per_objfile (per_objfile),
DISABLE_COPY_AND_ASSIGN (dwarf2_queue_item);
- dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
dwarf2_per_objfile *per_objfile;
enum language pretend_language;
};
-/* A deleter for dwarf2_per_cu_data that knows to downcast to
- signatured_type as appropriate. This approach lets us avoid a
- virtual destructor, which saves a bit of space. */
+/* A deleter for dwarf2_per_cu that knows to downcast to signatured_type as
+ appropriate. This approach lets us avoid a virtual destructor, which saves
+ a bit of space. */
-struct dwarf2_per_cu_data_deleter
+struct dwarf2_per_cu_deleter
{
- void operator() (dwarf2_per_cu_data *data);
+ void operator() (dwarf2_per_cu *data);
};
-/* A specialization of unique_ptr for dwarf2_per_cu_data and
- subclasses. */
-using dwarf2_per_cu_data_up
- = std::unique_ptr<dwarf2_per_cu_data, dwarf2_per_cu_data_deleter>;
+/* A specialization of unique_ptr for dwarf2_per_cu and subclasses. */
+using dwarf2_per_cu_up = std::unique_ptr<dwarf2_per_cu, dwarf2_per_cu_deleter>;
/* Persistent data held for a compilation unit, even when not
processing it. We put a pointer to this structure in the
psymtab. */
-struct dwarf2_per_cu_data
+struct dwarf2_per_cu
{
/* LENGTH is the length of the unit. If the value is 0, it means it is not
known, and may be set later using the set_length method. */
- dwarf2_per_cu_data (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
- sect_offset sect_off, unsigned int length)
+ dwarf2_per_cu (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
+ sect_offset sect_off, unsigned int length)
: sect_off (sect_off),
m_length (length),
is_debug_types (false),
public:
/* Non-zero if this CU is from .debug_types.
- Struct dwarf2_per_cu_data is contained in struct signatured_type iff
+ Struct dwarf2_per_cu is contained in struct signatured_type iff
this is non-zero. */
unsigned int is_debug_types : 1;
/* DWARF header of this CU. Note that dwarf2_cu reads its own version of the
header, which may differ from this one, since it may pass rcuh_kind::TYPE
- to read_comp_unit_head, whereas for dwarf2_per_cu_data we always pass
+ to read_comp_unit_head, whereas for dwarf2_per_cu we always pass
rcuh_kind::COMPILE.
Don't access this field directly, use the get_header method instead. It
to. Concurrently with this change gdb was modified to emit version 8
indices so we only pay a price for gold generated indices.
http://sourceware.org/bugzilla/show_bug.cgi?id=15021. */
- std::vector<dwarf2_per_cu_data *> imported_symtabs;
+ std::vector<dwarf2_per_cu *> imported_symtabs;
/* Get the header of this per_cu, reading it if necessary. */
const comp_unit_head *get_header () const;
/* Entry in the signatured_types hash table. */
-struct signatured_type : public dwarf2_per_cu_data
+struct signatured_type : public dwarf2_per_cu
{
signatured_type (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
- sect_offset sect_off, unsigned int length, ULONGEST signature)
- : dwarf2_per_cu_data (per_bfd, section, sect_off, length),
+ sect_offset sect_off, unsigned int length,
+ ULONGEST signature)
+ : dwarf2_per_cu (per_bfd, section, sect_off, length),
signature (signature)
{
this->is_debug_types = true;
{ return bfd_get_filename (this->obfd); }
/* Return the CU given its index. */
- dwarf2_per_cu_data *get_cu (int index) const
+ dwarf2_per_cu *get_cu (int index) const
{
return this->all_units[index].get ();
}
/* Return the CU given its index in the CU table in the index. */
- dwarf2_per_cu_data *get_index_cu (int index) const
+ dwarf2_per_cu *get_index_cu (int index) const
{
if (this->all_comp_units_index_cus.empty ())
return get_cu (index);
return this->all_comp_units_index_cus[index];
}
- dwarf2_per_cu_data *get_index_tu (int index) const
+ dwarf2_per_cu *get_index_tu (int index) const
{
return this->all_comp_units_index_tus[index];
}
- /* A convenience function to allocate a dwarf2_per_cu_data. The
- returned object has its "index" field set properly. The object
- is allocated on the dwarf2_per_bfd obstack. */
- dwarf2_per_cu_data_up allocate_per_cu (dwarf2_section_info *section,
- sect_offset sect_off,
- unsigned int length);
+ /* A convenience function to allocate a dwarf2_per_cu. The returned object
+ has its "index" field set properly. The object is allocated on the
+ dwarf2_per_bfd obstack. */
+ dwarf2_per_cu_up allocate_per_cu (dwarf2_section_info *section,
+ sect_offset sect_off, unsigned int length);
/* A convenience function to allocate a signatured_type. The
returned object has its "index" field set properly. The object
/* Table of all the compilation units. This is used to locate
the target compilation unit of a particular reference. */
- std::vector<dwarf2_per_cu_data_up> all_units;
+ std::vector<dwarf2_per_cu_up> all_units;
/* The all_units vector contains both CUs and TUs. Provide views on the
vector that are limited to either the CU part or the TU part. */
- gdb::array_view<dwarf2_per_cu_data_up> all_comp_units;
- gdb::array_view<dwarf2_per_cu_data_up> all_type_units;
+ gdb::array_view<dwarf2_per_cu_up> all_comp_units;
+ gdb::array_view<dwarf2_per_cu_up> all_type_units;
- std::vector<dwarf2_per_cu_data*> all_comp_units_index_cus;
- std::vector<dwarf2_per_cu_data*> all_comp_units_index_tus;
+ std::vector<dwarf2_per_cu *> all_comp_units_index_cus;
+ std::vector<dwarf2_per_cu *> all_comp_units_index_tus;
/* Table of struct type_unit_group objects.
The hash key is the DW_AT_stmt_list value. */
htab_up quick_file_names_table;
/* The CUs we recently read. */
- std::vector<dwarf2_per_cu_data *> just_read_cus;
+ std::vector<dwarf2_per_cu *> just_read_cus;
/* If we loaded the index from an external file, this contains the
resources associated to the open file, memory mapping, etc. */
return *this;
}
- dwarf2_per_cu_data *operator* () const
+ dwarf2_per_cu *operator* () const
{
return m_per_bfd->get_cu (m_index);
}
struct per_cu_and_offset
{
- dwarf2_per_cu_data *per_cu;
+ dwarf2_per_cu *per_cu;
sect_offset offset;
bool operator== (const per_cu_and_offset &other) const noexcept
{
std::uint64_t operator() (const per_cu_and_offset &key) const noexcept
{
- return (std::hash<dwarf2_per_cu_data *> () (key.per_cu)
+ return (std::hash<dwarf2_per_cu *> () (key.per_cu)
+ std::hash<sect_offset> () (key.offset));
}
};
/* Return true if the symtab corresponding to PER_CU has been set,
false otherwise. */
- bool symtab_set_p (const dwarf2_per_cu_data *per_cu) const;
+ bool symtab_set_p (const dwarf2_per_cu *per_cu) const;
/* Return the compunit_symtab associated to PER_CU, if it has been created. */
- compunit_symtab *get_symtab (const dwarf2_per_cu_data *per_cu) const;
+ compunit_symtab *get_symtab (const dwarf2_per_cu *per_cu) const;
/* Set the compunit_symtab associated to PER_CU. */
- void set_symtab (const dwarf2_per_cu_data *per_cu, compunit_symtab *symtab);
+ void set_symtab (const dwarf2_per_cu *per_cu, compunit_symtab *symtab);
/* Get the type_unit_group_unshareable corresponding to TU_GROUP. If one
does not exist, create it. */
struct type *type);
/* Get the dwarf2_cu matching PER_CU for this objfile. */
- dwarf2_cu *get_cu (dwarf2_per_cu_data *per_cu);
+ dwarf2_cu *get_cu (dwarf2_per_cu *per_cu);
/* Set the dwarf2_cu matching PER_CU for this objfile. */
- void set_cu (dwarf2_per_cu_data *per_cu, dwarf2_cu_up cu);
+ void set_cu (dwarf2_per_cu *per_cu, dwarf2_cu_up cu);
/* Remove/free the dwarf2_cu matching PER_CU for this objfile. */
- void remove_cu (dwarf2_per_cu_data *per_cu);
+ void remove_cu (dwarf2_per_cu *per_cu);
/* Free all cached compilation units. */
void remove_all_cus ();
or the type may come from a DWO file. Furthermore, while it's more logical
to use per_cu->section+offset, with Fission the section with the data is in
the DWO file but we don't know that section at the point we need it.
- We have to use something in dwarf2_per_cu_data (or the pointer to it)
+ We have to use something in dwarf2_per_cu (or the pointer to it)
because we can enter the lookup routine, get_die_type_at_offset, from
outside this file, and thus won't necessarily have PER_CU->cu.
Fortunately, PER_CU is stable for the life of the objfile. */
std::optional<std::queue<dwarf2_queue_item>> queue;
private:
- /* Hold the corresponding compunit_symtab for each CU or TU. This
- is indexed by dwarf2_per_cu_data::index. A NULL value means
- that the CU/TU has not been expanded yet. */
+ /* Hold the corresponding compunit_symtab for each CU or TU. This is indexed
+ by dwarf2_per_cu::index. A NULL value means that the CU/TU has not been
+ expanded yet. */
std::vector<compunit_symtab *> m_symtabs;
/* Map from a type unit group to the corresponding unshared
/* Map from signatured types to the corresponding struct type. */
gdb::unordered_map<signatured_type *, struct type *> m_type_map;
- /* Map from the objfile-independent dwarf2_per_cu_data instances to the
+ /* Map from the objfile-independent dwarf2_per_cu instances to the
corresponding objfile-dependent dwarf2_cu instances. */
- gdb::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
+ gdb::unordered_map<dwarf2_per_cu *, dwarf2_cu_up> m_dwarf2_cus;
};
/* Converts DWARF language names to GDB language names. */
/* Return the type of the DIE at DIE_OFFSET in the CU named by
PER_CU. */
-struct type *dwarf2_get_die_type (cu_offset die_offset,
- dwarf2_per_cu_data *per_cu,
+struct type *dwarf2_get_die_type (cu_offset die_offset, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile);
/* Given an index in .debug_addr, fetch the value.
long after the debug information has been read, and thus per_cu->cu
may no longer exist. */
-unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
+unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
unsigned int addr_index);
PER_CU->DWARF2_PER_OBJFILE->OBJFILE. */
struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
- (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
+ (sect_offset sect_off, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
gdb::function_view<CORE_ADDR ()> get_frame_pc,
bool resolve_abstract_p = false);
offset. */
struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off
- (cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu,
+ (cu_offset offset_in_cu, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
gdb::function_view<CORE_ADDR ()> get_frame_pc);
does not have a DW_AT_const_value, return NULL. */
extern const gdb_byte *dwarf2_fetch_constant_bytes
- (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
+ (sect_offset sect_off, dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile, obstack *obstack,
LONGEST *len);
the DIE in question is a variable declaration (definitions are
excluded), then *VAR_NAME is set to the variable's name. */
-struct type *dwarf2_fetch_die_type_sect_off
- (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
- dwarf2_per_objfile *per_objfile,
- const char **var_name = nullptr);
+type *dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
+ dwarf2_per_cu *per_cu,
+ dwarf2_per_objfile *per_objfile,
+ const char **var_name = nullptr);
/* When non-zero, dump line number entries as they are read in. */
extern unsigned int dwarf_line_debug;
EXPANSION_NOTIFY on it. */
extern bool dw2_expand_symtabs_matching_one
- (dwarf2_per_cu_data *per_cu,
+ (dwarf2_per_cu *per_cu,
dwarf2_per_objfile *per_objfile,
expand_symtabs_file_matcher file_matcher,
expand_symtabs_expansion_listener expansion_notify,
extern const char *read_indirect_string_at_offset
(dwarf2_per_objfile *per_objfile, LONGEST str_offset);
-/* Return a new dwarf2_per_cu_data allocated on the per-bfd
- obstack, and constructed with the specified field values. */
+/* Return a new dwarf2_per_cu allocated on the per-bfd obstack, and constructed
+ with the specified field values. */
-extern dwarf2_per_cu_data_up create_cu_from_index_list
+extern dwarf2_per_cu_up create_cu_from_index_list
(dwarf2_per_bfd *per_bfd, struct dwarf2_section_info *section,
int is_dwz, sect_offset sect_off, ULONGEST length);
struct block;
struct value_print_options;
struct language_defn;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
struct dwarf2_per_objfile;
struct dwarf2_property_baton;