Fix bug in cooked index scanner

Testing this entire series pointed out that the cooked index scanner
disagrees with new_symbol about certain symbols.  In particular,
new_symbol has this comment:

    Ada and Fortran subprograms, whether marked external or
    not, are always stored as a global symbol, because we want

This patch updates the scanner to match.

I don't know why the current code does not cause failures.

It's maybe worth noting that incremental CU expansion -- creating
symtabs directly from the index -- would eliminate this sort of bug.
This commit is contained in:
Tom Tromey
2023-03-30 10:21:59 -06:00
parent 3dfc29463a
commit 48f7f3751e

View File

@@ -16326,6 +16326,12 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
|| abbrev->tag == DW_TAG_enumeration_type
|| abbrev->tag == DW_TAG_enumerator))
*flags &= ~IS_STATIC;
/* Keep in sync with new_symbol. */
if (abbrev->tag == DW_TAG_subprogram
&& (m_language == language_ada
|| m_language == language_fortran))
*flags &= ~IS_STATIC;
}
return info_ptr;