diff options
author | Tom Tromey <tom@tromey.com> | 2020-02-08 13:40:54 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-02-08 13:43:24 -0700 |
commit | 135f543748f651938774666649bb0365018d62da (patch) | |
tree | 578df1b5141f7b987be1ae8ae6c52dead59690df /gdb/dwarf2 | |
parent | 9f66ff1c8cd8f5512d49813abe48ddb9141474bf (diff) | |
download | gdb-135f543748f651938774666649bb0365018d62da.zip gdb-135f543748f651938774666649bb0365018d62da.tar.gz gdb-135f543748f651938774666649bb0365018d62da.tar.bz2 |
Simplify "want_partial_unit" handling
This changes the "want_partial_unit" parameters to have type bool, and
also removes the parameter from process_psymtab_comp_unit_reader.
This latter change seemed like an improvement, because it avoids a
pointless function call in the case where we are not planning to read
a partial unit.
2020-02-08 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (process_psymtab_comp_unit_reader): Remove
"want_partial_unit" parameter.
(process_psymtab_comp_unit): Change want_partial_unit to bool.
Inline check for DW_TAG_partial_unit.
(dwarf2_build_psymtabs_hard, scan_partial_symbols): Update.
Change-Id: I99e647f0c4faa3346e90a6e7bacc82af57eccff1
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/read.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 88be8d6..4a9f160 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7240,7 +7240,6 @@ static void process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, const gdb_byte *info_ptr, struct die_info *comp_unit_die, - int want_partial_unit, enum language pretend_language) { struct dwarf2_cu *cu = reader->cu; @@ -7253,9 +7252,6 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, enum pc_bounds_kind cu_bounds_kind; const char *filename; - if (comp_unit_die->tag == DW_TAG_partial_unit && !want_partial_unit) - return; - gdb_assert (! per_cu->is_debug_types); prepare_one_comp_unit (cu, comp_unit_die, pretend_language); @@ -7369,7 +7365,7 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader, static void process_psymtab_comp_unit (struct dwarf2_per_cu_data *this_cu, - int want_partial_unit, + bool want_partial_unit, enum language pretend_language) { /* If this compilation unit was already read in, free the @@ -7389,10 +7385,10 @@ process_psymtab_comp_unit (struct dwarf2_per_cu_data *this_cu, else if (this_cu->is_debug_types) build_type_psymtabs_reader (&reader, reader.info_ptr, reader.comp_unit_die); - else + else if (want_partial_unit + || reader.comp_unit_die->tag != DW_TAG_partial_unit) process_psymtab_comp_unit_reader (&reader, reader.info_ptr, reader.comp_unit_die, - want_partial_unit, pretend_language); /* Age out any secondary CUs. */ @@ -7752,7 +7748,7 @@ dwarf2_build_psymtabs_hard (struct dwarf2_per_objfile *dwarf2_per_objfile) addrmap_create_mutable (&temp_obstack)); for (dwarf2_per_cu_data *per_cu : dwarf2_per_objfile->all_comp_units) - process_psymtab_comp_unit (per_cu, 0, language_minimal); + process_psymtab_comp_unit (per_cu, false, language_minimal); /* This has to wait until we read the CUs, we need the list of DWOs. */ process_skeletonless_type_units (dwarf2_per_objfile); @@ -7969,7 +7965,7 @@ scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc, /* Go read the partial unit, if needed. */ if (per_cu->v.psymtab == NULL) - process_psymtab_comp_unit (per_cu, 1, cu->language); + process_psymtab_comp_unit (per_cu, true, cu->language); cu->per_cu->imported_symtabs_push (per_cu); } |