From: Simon Marchi Date: Sat, 21 Feb 2026 20:07:26 +0000 (-0500) Subject: gdb/dwarf: remove unnecessary compunit_symtab_set_p check in dw2_do_instantiate_symtab X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68d04211c87fa2015d5d3f8df7feb2168943d173;p=thirdparty%2Fbinutils-gdb.git gdb/dwarf: remove unnecessary compunit_symtab_set_p check in dw2_do_instantiate_symtab dw2_do_instantiate_symtab is called by dw2_instantiate_symtab, only if per_cu does not have a matching compunit_symtab yet. dw2_do_instantiate_symtab therefore does not need this compunit_symtab_set_p itself. Change-Id: Ie665980bb65016b56206c4aac36f4c2fc13c61de Approved-By: Tom Tromey --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 79464269c1b..f478f0d2cce 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -1599,26 +1599,23 @@ dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu, with the dwarf queue empty. */ dwarf2_queue_guard q_guard (per_objfile); - if (!per_objfile->compunit_symtab_set_p (per_cu)) - { - queue_comp_unit (per_cu, per_objfile); - dwarf2_cu *cu = per_objfile->get_cu (per_cu); - - if (cu == nullptr) - cu = load_cu (per_cu, per_objfile, skip_partial); - - /* If we just loaded a CU from a DWO, and we're working with an index - that may badly handle TUs, load all the TUs in that DWO as well. - http://sourceware.org/bugzilla/show_bug.cgi?id=15021 */ - if (!per_cu->is_debug_types () - && cu != NULL - && cu->dwo_unit != NULL - && per_objfile->per_bfd->index_table != NULL - && !per_objfile->per_bfd->index_table->version_check () - /* DWP files aren't supported yet. */ - && per_objfile->per_bfd->dwp_file == nullptr) - queue_and_load_all_dwo_tus (cu); - } + queue_comp_unit (per_cu, per_objfile); + dwarf2_cu *cu = per_objfile->get_cu (per_cu); + + if (cu == nullptr) + cu = load_cu (per_cu, per_objfile, skip_partial); + + /* If we just loaded a CU from a DWO, and we're working with an index + that may badly handle TUs, load all the TUs in that DWO as well. + http://sourceware.org/bugzilla/show_bug.cgi?id=15021 */ + if (!per_cu->is_debug_types () + && cu != nullptr + && cu->dwo_unit != nullptr + && per_objfile->per_bfd->index_table != nullptr + && !per_objfile->per_bfd->index_table->version_check () + /* DWP files aren't supported yet. */ + && per_objfile->per_bfd->dwp_file == nullptr) + queue_and_load_all_dwo_tus (cu); process_queue (per_objfile); }