Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:Update
gdb
gdb-symtab-resolve-deferred-entries-intra-shard...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gdb-symtab-resolve-deferred-entries-intra-shard-case.patch of Package gdb
From a4bf216accd43b25ea9b9b7507c93eb973872a82 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevries@suse.de> Date: Sun, 24 Sep 2023 11:43:24 +0200 Subject: [PATCH 07/11] [gdb/symtab] Resolve deferred entries, intra-shard case In patch "[gdb/symtab] Resolve deferred entries, inter-shard case" we've solved the generic case of handling deferred entries. Now add an optimization that handles deferred entries with an intra-shard dependency in the parallel for. Tested on x86_64-linux. --- gdb/dwarf2/cooked-index.c | 35 +++++++++++++++++++++++++++++++++++ gdb/dwarf2/cooked-index.h | 7 +++++++ gdb/dwarf2/read.c | 10 ++++++++++ 3 files changed, 52 insertions(+) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index cef57a96384..d8a12bee265 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -408,6 +408,7 @@ cooked_index::find (const std::string &name, bool completing) cooked_index_vector::cooked_index_vector (vec_type &&vec) : m_vector (std::move (vec)) { + /* Handle deferred entries, inter-cu case. */ handle_deferred_entries (); for (auto &idx : m_vector) @@ -477,6 +478,40 @@ cooked_index_vector::get_main () const /* See cooked-index.h. */ +const cooked_index_entry * +cooked_index::find_parent_deferred_entry + (const cooked_index::deferred_entry &entry) const +{ + return find_parent (entry.spec_offset); +} + +/* See cooked-index.h. */ + +void +cooked_index::handle_deferred_entries () +{ + for (auto it = m_deferred_entries->begin (); it != m_deferred_entries->end (); ) + { + const deferred_entry & deferred_entry = *it; + if (!parent_valid (deferred_entry.spec_offset)) + { + it++; + continue; + } + const cooked_index_entry *parent_entry + = find_parent_deferred_entry (deferred_entry); + if (parent_entry == &parent_map::deferred) + { + it++; + continue; + } + resolve_deferred_entry (deferred_entry, parent_entry); + it = m_deferred_entries->erase (it); + } +} + +/* See cooked-index.h. */ + const cooked_index_entry * cooked_index::resolve_deferred_entry (const deferred_entry &de, const cooked_index_entry *parent_entry) diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 9d836379666..bda1ed1e155 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -404,6 +404,13 @@ class cooked_index const cooked_index_entry *resolve_deferred_entry (const deferred_entry &entry, const cooked_index_entry *parent_entry); + /* Find the parent entry for deferred_entry ENTRY. */ + const cooked_index_entry *find_parent_deferred_entry + (const cooked_index::deferred_entry &entry) const; + + /* Create cooked_index_entries for the deferred entries. */ + void handle_deferred_entries (); + /* Mark parents in range [START, END] as valid . */ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) { diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index ba21b6a14c9..0ab3e1a1500 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -6697,6 +6697,12 @@ class cooked_index_storage m_index->defer_entry (de); } + /* Handle deferred entries, intra-cu case. */ + void handle_deferred_entries () + { + m_index->handle_deferred_entries (); + } + /* Mark parents in range [START, END] as valid . */ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) { @@ -7183,6 +7189,10 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_objfile) errors.push_back (std::move (except)); } } + + /* Handle deferred entries, intra-cu case. */ + thread_storage.handle_deferred_entries (); + return result_type (thread_storage.release (), std::move (errors)); }, task_size); -- 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