Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
gdb.32331
gdb-symtab-factor-out-m_deferred_entries-usage....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gdb-symtab-factor-out-m_deferred_entries-usage.patch of Package gdb.32331
From dac6c3b27a77589078add7e4e4586515ac85610d Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevries@suse.de> Date: Fri, 15 Sep 2023 08:38:00 +0200 Subject: [PATCH 04/11] [gdb/symtab] Factor out m_deferred_entries usage Factor out usage of cooked_indexer::m_deferred_entries in new member functions defer_entry, handle_deferred_entries and resolve_deferred_entry. Tested on x86_64-linux. --- gdb/dwarf2/read.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 1092cb1dca9..ff5be8e7dc5 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -6822,6 +6822,32 @@ class cooked_indexer we'll know the containing context of all the DIEs that we might have scanned. This vector stores these deferred entries. */ std::vector<deferred_entry> m_deferred_entries; + + /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ + void defer_entry (const deferred_entry &de) + { + m_deferred_entries.push_back (de); + } + + /* Create a cooked_index_entry corresponding to deferred_entry DE with + parent PARENT_ENTRY. */ + const cooked_index_entry *resolve_deferred_entry + (const deferred_entry &de, const cooked_index_entry *parent_entry) + { + return m_index_storage->add (de.die_offset, de.tag, de.flags, de.name, + parent_entry, m_per_cu); + } + + /* Create cooked_index_entries for the deferred entries. */ + void handle_deferred_entries () + { + for (const auto &entry : m_deferred_entries) + { + const cooked_index_entry *parent_entry + = find_parent (entry.spec_offset); + resolve_deferred_entry (entry, parent_entry); + } + } }; /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. @@ -18519,7 +18545,7 @@ cooked_indexer::index_dies (cutu_reader *reader, if (name != nullptr) { if (defer != 0) - m_deferred_entries.push_back ({ + defer_entry ({ this_die, name, defer, abbrev->tag, flags }); else @@ -18624,12 +18650,7 @@ cooked_indexer::make_index (cutu_reader *reader) return; index_dies (reader, reader->info_ptr, nullptr, false); - for (const auto &entry : m_deferred_entries) - { - const cooked_index_entry *parent = find_parent (entry.spec_offset); - m_index_storage->add (entry.die_offset, entry.tag, entry.flags, - entry.name, parent, m_per_cu); - } + handle_deferred_entries (); } /* An implementation of quick_symbol_functions for the cooked DWARF -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor