aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-30 10:21:59 -0600
committerTom Tromey <tom@tromey.com>2024-01-28 10:58:15 -0700
commit48f7f3751eac0bb5a2cf8c4d52cbf477e81bef14 (patch)
tree3ea2ef80a9bb53b4f978d190355f27ffaa69e6c2 /gdb/dwarf2/read.c
parent3dfc29463ae08a45adb6f1f7bb2a5232c1a33151 (diff)
downloadbinutils-48f7f3751eac0bb5a2cf8c4d52cbf477e81bef14.zip
binutils-48f7f3751eac0bb5a2cf8c4d52cbf477e81bef14.tar.gz
binutils-48f7f3751eac0bb5a2cf8c4d52cbf477e81bef14.tar.bz2
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.
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r--gdb/dwarf2/read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 925a5ea..55a1735 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -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;