[PATCH v3 2/8] Skip partial units in process_psymtab_comp_unit

Tom Tromey
2026-02-20T20:43:44Z

process_psymtab_comp_unit passes 'false' for the 'skip_partial'
argument to the cutu_reader constructor, but then proceeds to skip
partial units. This patch simplifies the code by passing 'true'
instead.
---
gdb/dwarf2/read.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 5f18d5f2e9a..f545a3158e9 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -3369,7 +3369,7 @@ cooked_index_worker_debug_info::process_unit
{
auto new_reader
= std::make_unique<cutu_reader> (*this_cu, *per_objfile, nullptr,
- false, std::nullopt,
+ true, std::nullopt,
storage->get_abbrev_table_cache ());

if (new_reader->is_dummy ())
@@ -3383,7 +3383,7 @@ cooked_index_worker_debug_info::process_unit

if (this_cu->is_debug_types ())
process_type_unit (reader, storage);
- else if (reader->top_level_die ()->tag != DW_TAG_partial_unit)
+ else
{
bool nope = false;
if (this_cu->scanned.compare_exchange_strong (nope, true))

--
2.49.0