================ @@ -2990,18 +2992,34 @@ void ObjectFileELF::ParseSymtab(Symtab &lldb_symtab) { // section, nomatter if .symtab was already parsed or not. This is because // minidebuginfo normally removes the .symtab symbols which have their // matching .dynsym counterparts. + bool found_dynsym = false; if (!symtab || GetSectionList()->FindSectionByName(ConstString(".gnu_debugdata"))) { Section *dynsym = section_list->FindSectionByType(eSectionTypeELFDynamicSymbols, true) .get(); if (dynsym) { + found_dynsym = true; auto [num_symbols, address_class_map] = ParseSymbolTable(&lldb_symtab, symbol_id, dynsym); symbol_id += num_symbols; m_address_class_map.merge(address_class_map); } } + if (!found_dynsym) { ---------------- Jlalond wrote:
We added this bool, but why can't this be the else to `if (dynsym)`? We have two very similar sounding variables here. I think we can simplify this to `Section *dynsym = !symtab || GetSection()->... ? section_list->FindSection(..) : nullptr;` and then we have a simple if else https://github.com/llvm/llvm-project/pull/112596 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits