gdb: rename dwarf2_per_objfile variables/fields to per_objfile
While doing the psymtab-sharing patchset, I avoided renaming variables unnecessarily to avoid adding noise to patches, but I'd like to do it now. Basically, we have these dwarf2 per-something structures: - dwarf2_per_objfile - dwarf2_per_bfd - dwarf2_per_cu_data I named the instances of dwarf2_per_bfd `per_bfd` and most of instances of dwarf2_per_cu_data are called `per_cu`. Most pre-existing instances of dwarf2_per_objfile are named `dwarf2_per_objfile`. For consistency with the other type, I'd like to rename them to just `per_objfile`. The `dwarf2_` prefix is superfluous, since it's already clear we are in dwarf2 code. It also helps reducing the line wrapping by saving 7 precious columns. gdb/ChangeLog: * dwarf2/comp-unit.c, dwarf2/comp-unit.h, dwarf2/index-cache.c, dwarf2/index-cache.h, dwarf2/index-write.c, dwarf2/index-write.h, dwarf2/line-header.c, dwarf2/line-header.h, dwarf2/macro.c, dwarf2/macro.h, dwarf2/read.c, dwarf2/read.h: Rename struct dwarf2_per_objfile variables and fields from `dwarf2_per_objfile` to just `per_objfile` throughout. Change-Id: I3c45cdcc561265e90df82cbd36b4b4ef2fa73aef
This commit is contained in:
parent
678048e807
commit
976ca31673
|
@ -1,3 +1,13 @@
|
|||
2020-05-29 Simon Marchi <simon.marchi@efficios.com>
|
||||
|
||||
* dwarf2/comp-unit.c, dwarf2/comp-unit.h, dwarf2/index-cache.c,
|
||||
dwarf2/index-cache.h, dwarf2/index-write.c,
|
||||
dwarf2/index-write.h, dwarf2/line-header.c,
|
||||
dwarf2/line-header.h, dwarf2/macro.c, dwarf2/macro.h,
|
||||
dwarf2/read.c, dwarf2/read.h: Rename struct dwarf2_per_objfile
|
||||
variables and fields from `dwarf2_per_objfile` to just
|
||||
`per_objfile` throughout.
|
||||
|
||||
2020-05-28 Simon Marchi <simon.marchi@polymtl.ca>
|
||||
|
||||
* dwarf2/loc.c (class dwarf_evaluate_loc_desc)
|
||||
|
|
|
@ -173,7 +173,7 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
|
|||
Perform various error checking on the header. */
|
||||
|
||||
static void
|
||||
error_check_comp_unit_head (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
error_check_comp_unit_head (dwarf2_per_objfile *per_objfile,
|
||||
struct comp_unit_head *header,
|
||||
struct dwarf2_section_info *section,
|
||||
struct dwarf2_section_info *abbrev_section)
|
||||
|
@ -181,7 +181,7 @@ error_check_comp_unit_head (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
const char *filename = section->get_file_name ();
|
||||
|
||||
if (to_underlying (header->abbrev_sect_off)
|
||||
>= abbrev_section->get_size (dwarf2_per_objfile->objfile))
|
||||
>= abbrev_section->get_size (per_objfile->objfile))
|
||||
error (_("Dwarf Error: bad offset (%s) in compilation unit header "
|
||||
"(offset %s + 6) [in module %s]"),
|
||||
sect_offset_str (header->abbrev_sect_off),
|
||||
|
@ -201,7 +201,7 @@ error_check_comp_unit_head (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
/* See comp-unit.h. */
|
||||
|
||||
const gdb_byte *
|
||||
read_and_check_comp_unit_head (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
read_and_check_comp_unit_head (dwarf2_per_objfile *per_objfile,
|
||||
struct comp_unit_head *header,
|
||||
struct dwarf2_section_info *section,
|
||||
struct dwarf2_section_info *abbrev_section,
|
||||
|
@ -216,8 +216,7 @@ read_and_check_comp_unit_head (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|
||||
header->first_die_cu_offset = (cu_offset) (info_ptr - beg_of_comp_unit);
|
||||
|
||||
error_check_comp_unit_head (dwarf2_per_objfile, header, section,
|
||||
abbrev_section);
|
||||
error_check_comp_unit_head (per_objfile, header, section, abbrev_section);
|
||||
|
||||
return info_ptr;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ extern const gdb_byte *read_comp_unit_head
|
|||
The contents of the header are stored in HEADER.
|
||||
The result is a pointer to the start of the first DIE. */
|
||||
extern const gdb_byte *read_and_check_comp_unit_head
|
||||
(struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
(dwarf2_per_objfile *per_objfile,
|
||||
struct comp_unit_head *header,
|
||||
struct dwarf2_section_info *section,
|
||||
struct dwarf2_section_info *abbrev_section,
|
||||
|
|
|
@ -87,9 +87,9 @@ index_cache::disable ()
|
|||
/* See dwarf-index-cache.h. */
|
||||
|
||||
void
|
||||
index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
index_cache::store (dwarf2_per_objfile *per_objfile)
|
||||
{
|
||||
objfile *obj = dwarf2_per_objfile->objfile;
|
||||
objfile *obj = per_objfile->objfile;
|
||||
|
||||
if (!enabled ())
|
||||
return;
|
||||
|
@ -108,7 +108,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
|||
|
||||
/* Get build id of dwz file, if present. */
|
||||
gdb::optional<std::string> dwz_build_id_str;
|
||||
const dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd);
|
||||
const dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
|
||||
const char *dwz_build_id_ptr = NULL;
|
||||
|
||||
if (dwz != nullptr)
|
||||
|
@ -149,7 +149,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
|||
|
||||
/* Write the index itself to the directory, using the build id as the
|
||||
filename. */
|
||||
write_psymtabs_to_index (dwarf2_per_objfile, m_dir.c_str (),
|
||||
write_psymtabs_to_index (per_objfile, m_dir.c_str (),
|
||||
build_id_str.c_str (), dwz_build_id_ptr,
|
||||
dw_index_kind::GDB_INDEX);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
void disable ();
|
||||
|
||||
/* Store an index for the specified object file in the cache. */
|
||||
void store (struct dwarf2_per_objfile *dwarf2_per_objfile);
|
||||
void store (dwarf2_per_objfile *per_objfile);
|
||||
|
||||
/* Look for an index file matching BUILD_ID. If found, return the contents
|
||||
as an array_view and store the underlying resources (allocated memory,
|
||||
|
|
|
@ -661,7 +661,7 @@ recursively_write_psymbols (struct objfile *objfile,
|
|||
class debug_names
|
||||
{
|
||||
public:
|
||||
debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile, bool is_dwarf64,
|
||||
debug_names (dwarf2_per_objfile *per_objfile, bool is_dwarf64,
|
||||
bfd_endian dwarf5_byte_order)
|
||||
: m_dwarf5_byte_order (dwarf5_byte_order),
|
||||
m_dwarf32 (dwarf5_byte_order),
|
||||
|
@ -671,7 +671,7 @@ public:
|
|||
: static_cast<dwarf &> (m_dwarf32)),
|
||||
m_name_table_string_offs (m_dwarf.name_table_string_offs),
|
||||
m_name_table_entry_offs (m_dwarf.name_table_entry_offs),
|
||||
m_debugstrlookup (dwarf2_per_objfile)
|
||||
m_debugstrlookup (per_objfile)
|
||||
{}
|
||||
|
||||
int dwarf5_offset_size () const
|
||||
|
@ -957,21 +957,21 @@ private:
|
|||
|
||||
/* Object constructor to be called for current DWARF2_PER_OBJFILE.
|
||||
All .debug_str section strings are automatically stored. */
|
||||
debug_str_lookup (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
: m_abfd (dwarf2_per_objfile->objfile->obfd),
|
||||
m_dwarf2_per_objfile (dwarf2_per_objfile)
|
||||
debug_str_lookup (dwarf2_per_objfile *per_objfile)
|
||||
: m_abfd (per_objfile->objfile->obfd),
|
||||
m_per_objfile (per_objfile)
|
||||
{
|
||||
dwarf2_per_objfile->per_bfd->str.read (dwarf2_per_objfile->objfile);
|
||||
if (dwarf2_per_objfile->per_bfd->str.buffer == NULL)
|
||||
per_objfile->per_bfd->str.read (per_objfile->objfile);
|
||||
if (per_objfile->per_bfd->str.buffer == NULL)
|
||||
return;
|
||||
for (const gdb_byte *data = dwarf2_per_objfile->per_bfd->str.buffer;
|
||||
data < (dwarf2_per_objfile->per_bfd->str.buffer
|
||||
+ dwarf2_per_objfile->per_bfd->str.size);)
|
||||
for (const gdb_byte *data = per_objfile->per_bfd->str.buffer;
|
||||
data < (per_objfile->per_bfd->str.buffer
|
||||
+ per_objfile->per_bfd->str.size);)
|
||||
{
|
||||
const char *const s = reinterpret_cast<const char *> (data);
|
||||
const auto insertpair
|
||||
= m_str_table.emplace (c_str_view (s),
|
||||
data - dwarf2_per_objfile->per_bfd->str.buffer);
|
||||
data - per_objfile->per_bfd->str.buffer);
|
||||
if (!insertpair.second)
|
||||
complaint (_("Duplicate string \"%s\" in "
|
||||
".debug_str section [in module %s]"),
|
||||
|
@ -988,7 +988,7 @@ private:
|
|||
const auto it = m_str_table.find (c_str_view (s));
|
||||
if (it != m_str_table.end ())
|
||||
return it->second;
|
||||
const size_t offset = (m_dwarf2_per_objfile->per_bfd->str.size
|
||||
const size_t offset = (m_per_objfile->per_bfd->str.size
|
||||
+ m_str_add_buf.size ());
|
||||
m_str_table.emplace (c_str_view (s), offset);
|
||||
m_str_add_buf.append_cstr0 (s);
|
||||
|
@ -1004,7 +1004,7 @@ private:
|
|||
private:
|
||||
std::unordered_map<c_str_view, size_t, c_str_view_hasher> m_str_table;
|
||||
bfd *const m_abfd;
|
||||
struct dwarf2_per_objfile *m_dwarf2_per_objfile;
|
||||
dwarf2_per_objfile *m_per_objfile;
|
||||
|
||||
/* Data to add at the end of .debug_str for new needed symbol names. */
|
||||
data_buf m_str_add_buf;
|
||||
|
@ -1294,14 +1294,14 @@ private:
|
|||
.debug_names section. */
|
||||
|
||||
static bool
|
||||
check_dwarf64_offsets (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
check_dwarf64_offsets (dwarf2_per_objfile *per_objfile)
|
||||
{
|
||||
for (dwarf2_per_cu_data *per_cu : dwarf2_per_objfile->per_bfd->all_comp_units)
|
||||
for (dwarf2_per_cu_data *per_cu : per_objfile->per_bfd->all_comp_units)
|
||||
{
|
||||
if (to_underlying (per_cu->sect_off) >= (static_cast<uint64_t> (1) << 32))
|
||||
return true;
|
||||
}
|
||||
for (const signatured_type *sigtype : dwarf2_per_objfile->per_bfd->all_type_units)
|
||||
for (const signatured_type *sigtype : per_objfile->per_bfd->all_type_units)
|
||||
{
|
||||
const dwarf2_per_cu_data &per_cu = sigtype->per_cu;
|
||||
|
||||
|
@ -1318,10 +1318,10 @@ check_dwarf64_offsets (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
|||
malloc/free. */
|
||||
|
||||
static size_t
|
||||
psyms_seen_size (struct dwarf2_per_objfile *dwarf2_per_objfile)
|
||||
psyms_seen_size (dwarf2_per_objfile *per_objfile)
|
||||
{
|
||||
size_t psyms_count = 0;
|
||||
for (dwarf2_per_cu_data *per_cu : dwarf2_per_objfile->per_bfd->all_comp_units)
|
||||
for (dwarf2_per_cu_data *per_cu : per_objfile->per_bfd->all_comp_units)
|
||||
{
|
||||
partial_symtab *psymtab = per_cu->v.psymtab;
|
||||
|
||||
|
@ -1401,10 +1401,10 @@ write_gdbindex_1 (FILE *out_file,
|
|||
associated dwz file, DWZ_OUT_FILE must be NULL. */
|
||||
|
||||
static void
|
||||
write_gdbindex (struct dwarf2_per_objfile *dwarf2_per_objfile, FILE *out_file,
|
||||
write_gdbindex (dwarf2_per_objfile *per_objfile, FILE *out_file,
|
||||
FILE *dwz_out_file)
|
||||
{
|
||||
struct objfile *objfile = dwarf2_per_objfile->objfile;
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
mapped_symtab symtab;
|
||||
data_buf objfile_cu_list;
|
||||
data_buf dwz_cu_list;
|
||||
|
@ -1414,18 +1414,17 @@ write_gdbindex (struct dwarf2_per_objfile *dwarf2_per_objfile, FILE *out_file,
|
|||
in the index file). This will later be needed to write the address
|
||||
table. */
|
||||
psym_index_map cu_index_htab;
|
||||
cu_index_htab.reserve (dwarf2_per_objfile->per_bfd->all_comp_units.size ());
|
||||
cu_index_htab.reserve (per_objfile->per_bfd->all_comp_units.size ());
|
||||
|
||||
/* The CU list is already sorted, so we don't need to do additional
|
||||
work here. Also, the debug_types entries do not appear in
|
||||
all_comp_units, but only in their own hash table. */
|
||||
|
||||
std::unordered_set<partial_symbol *> psyms_seen
|
||||
(psyms_seen_size (dwarf2_per_objfile));
|
||||
for (int i = 0; i < dwarf2_per_objfile->per_bfd->all_comp_units.size (); ++i)
|
||||
(psyms_seen_size (per_objfile));
|
||||
for (int i = 0; i < per_objfile->per_bfd->all_comp_units.size (); ++i)
|
||||
{
|
||||
struct dwarf2_per_cu_data *per_cu
|
||||
= dwarf2_per_objfile->per_bfd->all_comp_units[i];
|
||||
dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->all_comp_units[i];
|
||||
partial_symtab *psymtab = per_cu->v.psymtab;
|
||||
|
||||
if (psymtab != NULL)
|
||||
|
@ -1453,15 +1452,15 @@ write_gdbindex (struct dwarf2_per_objfile *dwarf2_per_objfile, FILE *out_file,
|
|||
|
||||
/* Write out the .debug_type entries, if any. */
|
||||
data_buf types_cu_list;
|
||||
if (dwarf2_per_objfile->per_bfd->signatured_types)
|
||||
if (per_objfile->per_bfd->signatured_types)
|
||||
{
|
||||
signatured_type_index_data sig_data (types_cu_list,
|
||||
psyms_seen);
|
||||
|
||||
sig_data.objfile = objfile;
|
||||
sig_data.symtab = &symtab;
|
||||
sig_data.cu_index = dwarf2_per_objfile->per_bfd->all_comp_units.size ();
|
||||
htab_traverse_noresize (dwarf2_per_objfile->per_bfd->signatured_types.get (),
|
||||
sig_data.cu_index = per_objfile->per_bfd->all_comp_units.size ();
|
||||
htab_traverse_noresize (per_objfile->per_bfd->signatured_types.get (),
|
||||
write_one_signatured_type, &sig_data);
|
||||
}
|
||||
|
||||
|
@ -1489,11 +1488,11 @@ static const gdb_byte dwarf5_gdb_augmentation[] = { 'G', 'D', 'B', 0 };
|
|||
many bytes were expected to be written into OUT_FILE. */
|
||||
|
||||
static void
|
||||
write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
write_debug_names (dwarf2_per_objfile *per_objfile,
|
||||
FILE *out_file, FILE *out_file_str)
|
||||
{
|
||||
const bool dwarf5_is_dwarf64 = check_dwarf64_offsets (dwarf2_per_objfile);
|
||||
struct objfile *objfile = dwarf2_per_objfile->objfile;
|
||||
const bool dwarf5_is_dwarf64 = check_dwarf64_offsets (per_objfile);
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
const enum bfd_endian dwarf5_byte_order
|
||||
= gdbarch_byte_order (objfile->arch ());
|
||||
|
||||
|
@ -1501,13 +1500,12 @@ write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
work here. Also, the debug_types entries do not appear in
|
||||
all_comp_units, but only in their own hash table. */
|
||||
data_buf cu_list;
|
||||
debug_names nametable (dwarf2_per_objfile, dwarf5_is_dwarf64,
|
||||
dwarf5_byte_order);
|
||||
debug_names nametable (per_objfile, dwarf5_is_dwarf64, dwarf5_byte_order);
|
||||
std::unordered_set<partial_symbol *>
|
||||
psyms_seen (psyms_seen_size (dwarf2_per_objfile));
|
||||
for (int i = 0; i < dwarf2_per_objfile->per_bfd->all_comp_units.size (); ++i)
|
||||
psyms_seen (psyms_seen_size (per_objfile));
|
||||
for (int i = 0; i < per_objfile->per_bfd->all_comp_units.size (); ++i)
|
||||
{
|
||||
const dwarf2_per_cu_data *per_cu = dwarf2_per_objfile->per_bfd->all_comp_units[i];
|
||||
const dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->all_comp_units[i];
|
||||
partial_symtab *psymtab = per_cu->v.psymtab;
|
||||
|
||||
/* CU of a shared file from 'dwz -m' may be unused by this main
|
||||
|
@ -1525,7 +1523,7 @@ write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|
||||
/* Write out the .debug_type entries, if any. */
|
||||
data_buf types_cu_list;
|
||||
if (dwarf2_per_objfile->per_bfd->signatured_types)
|
||||
if (per_objfile->per_bfd->signatured_types)
|
||||
{
|
||||
debug_names::write_one_signatured_type_data sig_data (nametable,
|
||||
signatured_type_index_data (types_cu_list, psyms_seen));
|
||||
|
@ -1534,7 +1532,7 @@ write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
/* It is used only for gdb_index. */
|
||||
sig_data.info.symtab = nullptr;
|
||||
sig_data.info.cu_index = 0;
|
||||
htab_traverse_noresize (dwarf2_per_objfile->per_bfd->signatured_types.get (),
|
||||
htab_traverse_noresize (per_objfile->per_bfd->signatured_types.get (),
|
||||
debug_names::write_one_signatured_type,
|
||||
&sig_data);
|
||||
}
|
||||
|
@ -1574,12 +1572,12 @@ write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|
||||
/* comp_unit_count - The number of CUs in the CU list. */
|
||||
header.append_uint (4, dwarf5_byte_order,
|
||||
dwarf2_per_objfile->per_bfd->all_comp_units.size ());
|
||||
per_objfile->per_bfd->all_comp_units.size ());
|
||||
|
||||
/* local_type_unit_count - The number of TUs in the local TU
|
||||
list. */
|
||||
header.append_uint (4, dwarf5_byte_order,
|
||||
dwarf2_per_objfile->per_bfd->all_type_units.size ());
|
||||
per_objfile->per_bfd->all_type_units.size ());
|
||||
|
||||
/* foreign_type_unit_count - The number of TUs in the foreign TU
|
||||
list. */
|
||||
|
@ -1669,17 +1667,16 @@ struct index_wip_file
|
|||
/* See dwarf-index-write.h. */
|
||||
|
||||
void
|
||||
write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
const char *dir, const char *basename,
|
||||
const char *dwz_basename,
|
||||
write_psymtabs_to_index (dwarf2_per_objfile *per_objfile, const char *dir,
|
||||
const char *basename, const char *dwz_basename,
|
||||
dw_index_kind index_kind)
|
||||
{
|
||||
struct objfile *objfile = dwarf2_per_objfile->objfile;
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
|
||||
if (dwarf2_per_objfile->per_bfd->using_index)
|
||||
if (per_objfile->per_bfd->using_index)
|
||||
error (_("Cannot use an index to create the index"));
|
||||
|
||||
if (dwarf2_per_objfile->per_bfd->types.size () > 1)
|
||||
if (per_objfile->per_bfd->types.size () > 1)
|
||||
error (_("Cannot make an index when the file has multiple .debug_types sections"));
|
||||
|
||||
if (!objfile->partial_symtabs->psymtabs
|
||||
|
@ -1703,13 +1700,13 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
{
|
||||
index_wip_file str_wip_file (dir, basename, DEBUG_STR_SUFFIX);
|
||||
|
||||
write_debug_names (dwarf2_per_objfile, objfile_index_wip.out_file.get (),
|
||||
write_debug_names (per_objfile, objfile_index_wip.out_file.get (),
|
||||
str_wip_file.out_file.get ());
|
||||
|
||||
str_wip_file.finalize ();
|
||||
}
|
||||
else
|
||||
write_gdbindex (dwarf2_per_objfile, objfile_index_wip.out_file.get (),
|
||||
write_gdbindex (per_objfile, objfile_index_wip.out_file.get (),
|
||||
(dwz_index_wip.has_value ()
|
||||
? dwz_index_wip->out_file.get () : NULL));
|
||||
|
||||
|
@ -1753,23 +1750,21 @@ save_gdb_index_command (const char *arg, int from_tty)
|
|||
if (stat (objfile_name (objfile), &st) < 0)
|
||||
continue;
|
||||
|
||||
struct dwarf2_per_objfile *dwarf2_per_objfile
|
||||
= get_dwarf2_per_objfile (objfile);
|
||||
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
|
||||
|
||||
if (dwarf2_per_objfile != NULL)
|
||||
if (per_objfile != NULL)
|
||||
{
|
||||
try
|
||||
{
|
||||
const char *basename = lbasename (objfile_name (objfile));
|
||||
const dwz_file *dwz
|
||||
= dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd);
|
||||
const dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
|
||||
const char *dwz_basename = NULL;
|
||||
|
||||
if (dwz != NULL)
|
||||
dwz_basename = lbasename (dwz->filename ());
|
||||
|
||||
write_psymtabs_to_index (dwarf2_per_objfile, arg, basename,
|
||||
dwz_basename, index_kind);
|
||||
write_psymtabs_to_index (per_objfile, arg, basename, dwz_basename,
|
||||
index_kind);
|
||||
}
|
||||
catch (const gdb_exception_error &except)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
same, but for the dwz file's index. */
|
||||
|
||||
extern void write_psymtabs_to_index
|
||||
(struct dwarf2_per_objfile *dwarf2_per_objfile, const char *dir,
|
||||
const char *basename, const char *dwz_basename, dw_index_kind index_kind);
|
||||
(dwarf2_per_objfile *per_objfile, const char *dir, const char *basename,
|
||||
const char *dwz_basename, dw_index_kind index_kind);
|
||||
|
||||
#endif /* DWARF_INDEX_WRITE_H */
|
||||
|
|
|
@ -154,9 +154,8 @@ read_checked_initial_length_and_offset (bfd *abfd, const gdb_byte *buf,
|
|||
format. */
|
||||
|
||||
static void
|
||||
read_formatted_entries (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
bfd *abfd, const gdb_byte **bufp,
|
||||
struct line_header *lh,
|
||||
read_formatted_entries (dwarf2_per_objfile *per_objfile, bfd *abfd,
|
||||
const gdb_byte **bufp, struct line_header *lh,
|
||||
const struct comp_unit_head *cu_header,
|
||||
void (*callback) (struct line_header *lh,
|
||||
const char *name,
|
||||
|
@ -208,9 +207,7 @@ read_formatted_entries (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|
||||
case DW_FORM_line_strp:
|
||||
string.emplace
|
||||
(dwarf2_per_objfile->read_line_string (buf,
|
||||
cu_header,
|
||||
&bytes_read));
|
||||
(per_objfile->read_line_string (buf, cu_header, &bytes_read));
|
||||
buf += bytes_read;
|
||||
break;
|
||||
|
||||
|
@ -286,7 +283,7 @@ read_formatted_entries (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|
||||
line_header_up
|
||||
dwarf_decode_line_header (sect_offset sect_off, bool is_dwz,
|
||||
struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
dwarf2_per_objfile *per_objfile,
|
||||
struct dwarf2_section_info *section,
|
||||
const struct comp_unit_head *cu_header)
|
||||
{
|
||||
|
@ -393,7 +390,7 @@ dwarf_decode_line_header (sect_offset sect_off, bool is_dwz,
|
|||
if (lh->version >= 5)
|
||||
{
|
||||
/* Read directory table. */
|
||||
read_formatted_entries (dwarf2_per_objfile, abfd, &line_ptr, lh.get (),
|
||||
read_formatted_entries (per_objfile, abfd, &line_ptr, lh.get (),
|
||||
cu_header,
|
||||
[] (struct line_header *header, const char *name,
|
||||
dir_index d_index, unsigned int mod_time,
|
||||
|
@ -403,7 +400,7 @@ dwarf_decode_line_header (sect_offset sect_off, bool is_dwz,
|
|||
});
|
||||
|
||||
/* Read file name table. */
|
||||
read_formatted_entries (dwarf2_per_objfile, abfd, &line_ptr, lh.get (),
|
||||
read_formatted_entries (per_objfile, abfd, &line_ptr, lh.get (),
|
||||
cu_header,
|
||||
[] (struct line_header *header, const char *name,
|
||||
dir_index d_index, unsigned int mod_time,
|
||||
|
|
|
@ -204,9 +204,7 @@ file_entry::include_dir (const line_header *lh) const
|
|||
and must not be freed. */
|
||||
|
||||
extern line_header_up dwarf_decode_line_header
|
||||
(sect_offset sect_off, bool is_dwz,
|
||||
struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
struct dwarf2_section_info *section,
|
||||
const struct comp_unit_head *cu_header);
|
||||
(sect_offset sect_off, bool is_dwz, dwarf2_per_objfile *per_objfile,
|
||||
struct dwarf2_section_info *section, const struct comp_unit_head *cu_header);
|
||||
|
||||
#endif /* DWARF2_LINE_HEADER_H */
|
||||
|
|
|
@ -418,7 +418,7 @@ dwarf_parse_macro_header (const gdb_byte **opcode_definitions,
|
|||
including DW_MACRO_import. */
|
||||
|
||||
static void
|
||||
dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
dwarf_decode_macro_bytes (dwarf2_per_objfile *per_objfile,
|
||||
buildsym_compunit *builder,
|
||||
bfd *abfd,
|
||||
const gdb_byte *mac_ptr, const gdb_byte *mac_end,
|
||||
|
@ -429,7 +429,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
unsigned int offset_size,
|
||||
htab_t include_hash)
|
||||
{
|
||||
struct objfile *objfile = dwarf2_per_objfile->objfile;
|
||||
struct objfile *objfile = per_objfile->objfile;
|
||||
enum dwarf_macro_record_type macinfo_type;
|
||||
int at_commandline;
|
||||
const gdb_byte *opcode_definitions[256];
|
||||
|
@ -506,15 +506,14 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|| macinfo_type == DW_MACRO_undef_sup
|
||||
|| section_is_dwz)
|
||||
{
|
||||
struct dwz_file *dwz
|
||||
= dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd);
|
||||
dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
|
||||
|
||||
body = dwz->read_string (objfile, str_offset);
|
||||
}
|
||||
else
|
||||
body = dwarf2_per_objfile->per_bfd->str.read_string (objfile,
|
||||
str_offset,
|
||||
"DW_FORM_strp");
|
||||
body = per_objfile->per_bfd->str.read_string (objfile,
|
||||
str_offset,
|
||||
"DW_FORM_strp");
|
||||
}
|
||||
|
||||
is_define = (macinfo_type == DW_MACRO_define
|
||||
|
@ -644,8 +643,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
|
||||
if (macinfo_type == DW_MACRO_import_sup)
|
||||
{
|
||||
struct dwz_file *dwz
|
||||
= dwarf2_get_dwz_file (dwarf2_per_objfile->per_bfd);
|
||||
dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
|
||||
|
||||
dwz->macro.read (objfile);
|
||||
|
||||
|
@ -669,11 +667,11 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
{
|
||||
*slot = (void *) new_mac_ptr;
|
||||
|
||||
dwarf_decode_macro_bytes (dwarf2_per_objfile, builder,
|
||||
include_bfd, new_mac_ptr,
|
||||
include_mac_end, current_file, lh,
|
||||
section, section_is_gnu, is_dwz,
|
||||
offset_size, include_hash);
|
||||
dwarf_decode_macro_bytes (per_objfile, builder, include_bfd,
|
||||
new_mac_ptr, include_mac_end,
|
||||
current_file, lh, section,
|
||||
section_is_gnu, is_dwz, offset_size,
|
||||
include_hash);
|
||||
|
||||
htab_remove_elt (include_hash, (void *) new_mac_ptr);
|
||||
}
|
||||
|
@ -710,7 +708,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
}
|
||||
|
||||
void
|
||||
dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
dwarf_decode_macros (dwarf2_per_objfile *per_objfile,
|
||||
buildsym_compunit *builder,
|
||||
const dwarf2_section_info *section,
|
||||
const struct line_header *lh, unsigned int offset_size,
|
||||
|
@ -861,9 +859,7 @@ dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
|||
mac_ptr = section->buffer + offset;
|
||||
slot = htab_find_slot (include_hash.get (), mac_ptr, INSERT);
|
||||
*slot = (void *) mac_ptr;
|
||||
dwarf_decode_macro_bytes (dwarf2_per_objfile, builder,
|
||||
abfd, mac_ptr, mac_end,
|
||||
current_file, lh, section,
|
||||
section_is_gnu, 0, offset_size,
|
||||
include_hash.get ());
|
||||
dwarf_decode_macro_bytes (per_objfile, builder, abfd, mac_ptr, mac_end,
|
||||
current_file, lh, section, section_is_gnu, 0,
|
||||
offset_size, include_hash.get ());
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
struct buildsym_compunit;
|
||||
|
||||
extern void dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
extern void dwarf_decode_macros (dwarf2_per_objfile *per_objfile,
|
||||
buildsym_compunit *builder,
|
||||
const dwarf2_section_info *section,
|
||||
const struct line_header *lh,
|
||||
|
|
1311
gdb/dwarf2/read.c
1311
gdb/dwarf2/read.c
File diff suppressed because it is too large
Load Diff
|
@ -651,7 +651,7 @@ struct type *dwarf2_get_die_type (cu_offset die_offset,
|
|||
may no longer exist. */
|
||||
|
||||
CORE_ADDR dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
|
||||
dwarf2_per_objfile *dwarf2_per_objfile,
|
||||
dwarf2_per_objfile *per_objfile,
|
||||
unsigned int addr_index);
|
||||
|
||||
/* Return DWARF block referenced by DW_AT_location of DIE at SECT_OFF at PER_CU.
|
||||
|
|
Loading…
Reference in New Issue