diff options
author | Tom Tromey <tom@tromey.com> | 2024-01-18 13:27:02 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-01-28 10:58:15 -0700 |
commit | 17841991c3144991e942c6cec8f21527b8cdb51f (patch) | |
tree | 3c33008b8a7e26f35224ed1c4c7fbb4d6d9b5ff1 | |
parent | 9423d61e97fa10a5880719d194f326fe27da5e4f (diff) | |
download | gdb-17841991c3144991e942c6cec8f21527b8cdb51f.zip gdb-17841991c3144991e942c6cec8f21527b8cdb51f.tar.gz gdb-17841991c3144991e942c6cec8f21527b8cdb51f.tar.bz2 |
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.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4ac8f34..1cc19b5 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 |