aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-01-18 13:27:02 -0700
committerTom Tromey <tom@tromey.com>2024-01-28 10:58:15 -0700
commit17841991c3144991e942c6cec8f21527b8cdb51f (patch)
tree3c33008b8a7e26f35224ed1c4c7fbb4d6d9b5ff1
parent9423d61e97fa10a5880719d194f326fe27da5e4f (diff)
Fix latent bug in DW_TAG_entry_point handling
A DW_TAG_entry_point symbol inherits its extern/static property from the enclosing subroutine. This is encoded in new_symbol -- but the cooked indexer does not agree.
-rw-r--r--gdb/dwarf2/read.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 4ac8f346cc9..1cc19b57ba8 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -16448,6 +16448,13 @@ cooked_indexer::index_dies (cutu_reader *reader,
info_ptr, abbrev, &name, &linkage_name,
&flags, &sibling, &this_parent_entry,
&defer, &is_enum_class, false);
+ /* A DW_TAG_entry_point inherits its static/extern property from
+ the enclosing subroutine. */
+ if (abbrev->tag == DW_TAG_entry_point)
+ {
+ flags &= ~IS_STATIC;
+ flags |= parent_entry->flags & IS_STATIC;
+ }
if (abbrev->tag == DW_TAG_namespace
&& m_language == language_cplus