From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D407B3857026 for ; Wed, 19 Jul 2023 14:33:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D407B3857026 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689777198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aFGnxzRgMQgk/9sJSvnQrhulzmylV+OjH1zHDLgbwVg=; b=aZhRqEEIAC6TNqgPcO5law9U/t7DgVg5yFoV+DgnpA6Yy8y6nWANzvwRu9t/HDtSm3w/1F ev37IZGLdyRueh+if8kumhs5XORADCXBGratT+D01ogewy2ff5u7+5xeOyS3ZIJ1xbkvma 5Wq79pczwtSIV/IMZ/WWM1J3K6ShWTs= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-355-Tun5hudCMQuWFfvtKpn-Ww-1; Wed, 19 Jul 2023 10:33:14 -0400 X-MC-Unique: Tun5hudCMQuWFfvtKpn-Ww-1 Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-56345c42e75so506299a12.0 for ; Wed, 19 Jul 2023 07:33:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689777179; x=1690381979; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aFGnxzRgMQgk/9sJSvnQrhulzmylV+OjH1zHDLgbwVg=; b=f8fgyM9tAiMqwfScx+1BwFuFGGcX1w+CNU9v0BV3+9EqBrW2mjIciy/vGkO2qJZvr6 FXq40U4gHwk5auaiYmQ2B45nnPDcPB4Nb/S8ah3CW20iiZTD+UJ6Owxu9IniTBgWdPrt scTevoQIS3XKrOr34dIPu5ufAhroznL9AY7fdGzAIzshzzcQBHiLB0YCmh4oytmSHqpS xIl1sLP+6HS1uAbDNxZhZlSJ5PTUEg9PpxsJyftCUKXm+/ihXu5CF1YER0/1TdObliub syY/Zs+9aApAnBZkvOunjLualzCILG07GWHme+m/OD0CD08BvN5cUuQg+lZ39lcH0qDB 2wTA== X-Gm-Message-State: ABy/qLYBEspqxOakQZp47hFopwjfYGgpdXo7M8Cmg7a8oYf0pJyNV1jE stMMq0DaAAwaE7zUnsNtVOeDFt0keaS/ZuslZe2F1C4OSl4H3maWPAWVexaQ7PZJ3llfIL5XDLN t2OSqumlGiqT5SYWqVUImE6kZFGGtWJT321b92MHfob+H X-Received: by 2002:a17:90a:c401:b0:264:7a:6a84 with SMTP id i1-20020a17090ac40100b00264007a6a84mr3300383pjt.0.1689777179337; Wed, 19 Jul 2023 07:32:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFh0NTQSebyXBM0QObFIkFqXyI+huS+cIdDhOFUnYAQTZud2a4s/TJHxnelyyAawuamMCmG1pS7KoL2xPVQDWo= X-Received: by 2002:a17:90a:c401:b0:264:7a:6a84 with SMTP id i1-20020a17090ac40100b00264007a6a84mr3300357pjt.0.1689777178766; Wed, 19 Jul 2023 07:32:58 -0700 (PDT) MIME-Version: 1.0 References: <20230601014347.3367489-1-amerey@redhat.com> <20230601014347.3367489-5-amerey@redhat.com> In-Reply-To: From: Aaron Merey Date: Wed, 19 Jul 2023 10:32:48 -0400 Message-ID: Subject: [PING*3][PATCH 4/6] gdb/progspace: Add reverse safe iterator and template for unwrapping iterator To: gdb-patches@sourceware.org Cc: Andrew Burgess X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-16.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ping Thanks, Aaron On Mon, Jul 3, 2023 at 1:39=E2=80=AFPM Aaron Merey wrot= e: > > Ping > > Thanks, > Aaron > > On Thu, Jun 15, 2023 at 9:44=E2=80=AFAM Aaron Merey w= rote: > > > > Ping > > > > Thanks, > > Aaron > > > > On Wed, May 31, 2023 at 9:44=E2=80=AFPM Aaron Merey = wrote: > > > > > > To facilitate the deletion of objfiles, progspace objects use a safe > > > iterator that holds a reference to the next objfile in the progspace'= s > > > objfile_list. This allows objfiles to be deleted in a loop without > > > invalidating the loop's iterator. progspace also uses an unwrapping > > > iterator over std::unique_ptr that automatically deferences > > > the unique_ptr. > > > > > > This patch changes the objfile safe iterator to be a reverse safe > > > iterator. It changes the unwrapping iterator into a template. It > > > also modifies objfile_list insertion so that separate debug objfiles > > > are placed into the list after the parent objfile, instead of before. > > > > > > These changes are intended to prepare gdb for on-demand debuginfo > > > downloading and the downloading of .gdb_index sections. > > > > > > With on-demand downloading enabled, gdb might download a debuginfo > > > file during symtab expansion. In this case an objfile could be added > > > to an objfiles_list during iteration over the list (for example, in > > > iterate_over_symtabs). We want these loops to also iterate over newl= y > > > downloaded objfiles. So objfiles need to be inserted into objfiles_li= st > > > after their parent since it is during the search of the parent > > > objfile for some symbol or filename that the separate debug objfile > > > might be downloaded. > > > > > > The unwrapping iterator is changed into a template in order to > > > use it with objfile qf_require_partial_symbols, which is now also > > > uses with a safe iterator. This is because after a separate debug > > > objfile is downloaded on-demand, we want to remove any .gdb_index > > > quick_symbol_functions from the parent objfile during iteration over > > > the parent's quick_symbol_functions. The newly downloaded separate > > > debug objfile contains the index and all of the related symbols > > > so the .gdb_index should not be associated with the parent objfile > > > any longer. > > > > > > Finally a safe reverse iterator is now used during progspace objfile > > > deletion in order to prevent iterator invalidation during the loop > > > in which objfiles are deleted. This could happen during forward > > > iteration over objfiles_list when a separate debug objfile immediatel= y > > > follows it's parent objfile in the list (which is now possible since > > > objfiles are inserted into the list after their parent). Deletion > > > of the parent would cause deletion of the separate debug objfile, > > > which would invalidate the safe forward iterator's reference to the > > > next objfile in the list. A safe reverse iterator deletes separate > > > debug objfiles before their parent, so the iterator's reference to > > > the next objfile always stays valid. > > > > > > A small change was also made to a testcase in py-objfile.exp to > > > account for the new placement of separate debug objfiles in > > > objfiles_list. > > > --- > > > gdb/objfiles.h | 22 +++- > > > gdb/progspace.c | 8 +- > > > gdb/progspace.h | 159 +++++++++++++++++++---= -- > > > gdb/symfile-debug.c | 136 ++++++++++---------- > > > gdb/testsuite/gdb.python/py-objfile.exp | 2 +- > > > 5 files changed, 218 insertions(+), 109 deletions(-) > > > > > > diff --git a/gdb/objfiles.h b/gdb/objfiles.h > > > index 189856f0a51..bb7b0a4579d 100644 > > > --- a/gdb/objfiles.h > > > +++ b/gdb/objfiles.h > > > @@ -613,6 +613,17 @@ struct objfile > > > /* See quick_symbol_functions. */ > > > void require_partial_symbols (bool verbose); > > > > > > + /* Remove TARGET from this objfile's collection of quick_symbol_fu= nctions. */ > > > + void remove_partial_symbol (quick_symbol_functions *target) > > > + { > > > + for (quick_symbol_functions_up &qf_up : qf) > > > + if (qf_up.get () =3D=3D target) > > > + { > > > + qf.remove (qf_up); > > > + return; > > > + } > > > + } > > > + > > > /* Return the relocation offset applied to SECTION. */ > > > CORE_ADDR section_offset (bfd_section *section) const > > > { > > > @@ -699,13 +710,20 @@ struct objfile > > > > > > private: > > > > > > + using qf_list =3D std::forward_list; > > > + using unwrapping_qf_range =3D iterator_range>; > > > + using qf_safe_range =3D basic_safe_range; > > > + > > > /* Ensure that partial symbols have been read and return the "quic= k" (aka > > > partial) symbol functions for this symbol reader. */ > > > - const std::forward_list & > > > + qf_safe_range > > > qf_require_partial_symbols () > > > { > > > this->require_partial_symbols (true); > > > - return qf; > > > + return qf_safe_range > > > + (unwrapping_qf_range > > > + (unwrapping_iterator (qf.begin ()), > > > + unwrapping_iterator (qf.end ()))); > > > } > > > > > > public: > > > diff --git a/gdb/progspace.c b/gdb/progspace.c > > > index 32bdfebcf7c..1ed75eef2f9 100644 > > > --- a/gdb/progspace.c > > > +++ b/gdb/progspace.c > > > @@ -139,19 +139,19 @@ program_space::free_all_objfiles () > > > > > > void > > > program_space::add_objfile (std::unique_ptr &&objfile, > > > - struct objfile *before) > > > + struct objfile *after) > > > { > > > - if (before =3D=3D nullptr) > > > + if (after =3D=3D nullptr) > > > objfiles_list.push_back (std::move (objfile)); > > > else > > > { > > > auto iter =3D std::find_if (objfiles_list.begin (), objfiles_l= ist.end (), > > > [=3D] (const std::unique_ptr<::objfil= e> &objf) > > > { > > > - return objf.get () =3D=3D before; > > > + return objf.get () =3D=3D after; > > > }); > > > gdb_assert (iter !=3D objfiles_list.end ()); > > > - objfiles_list.insert (iter, std::move (objfile)); > > > + objfiles_list.insert (++iter, std::move (objfile)); > > > } > > > } > > > > > > diff --git a/gdb/progspace.h b/gdb/progspace.h > > > index 85215f0e2f1..6e33e48c88e 100644 > > > --- a/gdb/progspace.h > > > +++ b/gdb/progspace.h > > > @@ -40,56 +40,141 @@ struct address_space; > > > struct program_space; > > > struct so_list; > > > > > > +/* An iterator that wraps an iterator over std::unique_ptr, and dere= ferences > > > + the returned object. This is useful for iterating over a list of= shared > > > + pointers and returning raw pointers -- which helped avoid touchin= g a lot > > > + of code when changing how objfiles are managed. */ > > > + > > > +template > > > +class unwrapping_iterator > > > +{ > > > +public: > > > + typedef unwrapping_iterator self_type; > > > + typedef typename UniquePtrIter::value_type::pointer value_type; > > > + typedef typename UniquePtrIter::reference reference; > > > + typedef typename UniquePtrIter::pointer pointer; > > > + typedef typename UniquePtrIter::iterator_category iterator_categor= y; > > > + typedef typename UniquePtrIter::difference_type difference_type; > > > + > > > + unwrapping_iterator (UniquePtrIter iter) > > > + : m_iter (std::move (iter)) > > > + { > > > + } > > > + > > > + value_type operator* () const > > > + { > > > + return m_iter->get (); > > > + } > > > + > > > + unwrapping_iterator operator++ () > > > + { > > > + ++m_iter; > > > + return *this; > > > + } > > > + > > > + bool operator!=3D (const unwrapping_iterator &other) const > > > + { > > > + return m_iter !=3D other.m_iter; > > > + } > > > + > > > +private: > > > + /* The underlying iterator. */ > > > + UniquePtrIter m_iter; > > > +}; > > > + > > > typedef std::list> objfile_list; > > > > > > -/* An iterator that wraps an iterator over std::unique_ptr, > > > - and dereferences the returned object. This is useful for iterati= ng > > > - over a list of shared pointers and returning raw pointers -- whic= h > > > - helped avoid touching a lot of code when changing how objfiles ar= e > > > - managed. */ > > > +/* An reverse iterator that wraps an iterator over objfile_list, and > > > + dereferences the returned object. This is useful for reverse ite= rating > > > + over a list of shared pointers and returning raw pointers -- whic= h helped > > > + avoid touching a lot of code when changing how objfiles are manag= ed. */ > > > > > > -class unwrapping_objfile_iterator > > > +class unwrapping_reverse_objfile_iterator > > > { > > > public: > > > - > > > - typedef unwrapping_objfile_iterator self_type; > > > + typedef unwrapping_reverse_objfile_iterator self_type; > > > typedef typename ::objfile *value_type; > > > typedef typename ::objfile &reference; > > > typedef typename ::objfile **pointer; > > > typedef typename objfile_list::iterator::iterator_category iterato= r_category; > > > typedef typename objfile_list::iterator::difference_type differenc= e_type; > > > > > > - unwrapping_objfile_iterator (objfile_list::iterator iter) > > > - : m_iter (std::move (iter)) > > > - { > > > - } > > > - > > > - objfile *operator* () const > > > + value_type operator* () const > > > { > > > return m_iter->get (); > > > } > > > > > > - unwrapping_objfile_iterator operator++ () > > > + unwrapping_reverse_objfile_iterator operator++ () > > > { > > > - ++m_iter; > > > + if (m_iter !=3D m_begin) > > > + --m_iter; > > > + else > > > + { > > > + /* We can't decrement M_ITER since it is the begin iterator o= f the > > > + objfile list. Set M_ITER to the list's end iterator to in= dicate > > > + this is now one-past-the-end. */ > > > + m_iter =3D m_end; > > > + > > > + /* Overwrite M_BEGIN to avoid possibly copying an invalid ite= rator. */ > > > + m_begin =3D m_end; > > > + } > > > + > > > return *this; > > > } > > > > > > - bool operator!=3D (const unwrapping_objfile_iterator &other) const > > > + bool operator!=3D (const unwrapping_reverse_objfile_iterator &othe= r) const > > > { > > > return m_iter !=3D other.m_iter; > > > } > > > > > > + /* Return an unwrapping reverse iterator starting at the last elem= ent of > > > + OBJF_LIST. */ > > > + static unwrapping_reverse_objfile_iterator begin (objfile_list &ob= jf_list) > > > + { > > > + auto begin =3D objf_list.begin (); > > > + auto end =3D objf_list.end (); > > > + auto rev_begin =3D objf_list.end (); > > > + > > > + /* Start REV_BEGIN on the last objfile in OBJF_LIST. */ > > > + if (begin !=3D end) > > > + --rev_begin; > > > + > > > + return unwrapping_reverse_objfile_iterator (rev_begin, begin, en= d); > > > + } > > > + > > > + /* Return a one-past-the-end unwrapping reverse iterator. */ > > > + static unwrapping_reverse_objfile_iterator end (objfile_list &objf= _list) > > > + { > > > + return unwrapping_reverse_objfile_iterator (objf_list.end (), > > > + objf_list.end (), > > > + objf_list.end ()); > > > + } > > > + > > > private: > > > + /* begin and end methods should be used to create these objects. = */ > > > + unwrapping_reverse_objfile_iterator (objfile_list::iterator iter, > > > + objfile_list::iterator begin, > > > + objfile_list::iterator end) > > > + : m_iter (std::move (iter)), m_begin (std::move (begin)), > > > + m_end (std::move (end)) > > > + { > > > + } > > > > > > - /* The underlying iterator. */ > > > - objfile_list::iterator m_iter; > > > -}; > > > + /* The underlying iterator. */ > > > + objfile_list::iterator m_iter; > > > > > > + /* The underlying iterator pointing to the first objfile in the seq= uence. Used > > > + to track when to stop decrementing M_ITER. */ > > > + objfile_list::iterator m_begin; > > > > > > -/* A range that returns unwrapping_objfile_iterators. */ > > > + /* The underlying iterator's one-past-the-end. */ > > > + objfile_list::iterator m_end; > > > +}; > > > > > > -using unwrapping_objfile_range =3D iterator_range; > > > +/* A range that returns unwrapping_iterators. */ > > > + > > > +using unwrapping_objfile_range > > > + =3D iterator_range>; > > > > > > /* A program space represents a symbolic view of an address space. > > > Roughly speaking, it holds all the data associated with a > > > @@ -209,11 +294,12 @@ struct program_space > > > objfiles_range objfiles () > > > { > > > return objfiles_range > > > - (unwrapping_objfile_iterator (objfiles_list.begin ()), > > > - unwrapping_objfile_iterator (objfiles_list.end ())); > > > + (unwrapping_iterator (objfiles_list.be= gin ()), > > > + unwrapping_iterator (objfiles_list.en= d ())); > > > } > > > > > > - using objfiles_safe_range =3D basic_safe_range; > > > + using objfiles_reverse_range =3D iterator_range; > > > + using objfiles_safe_reverse_range =3D basic_safe_range; > > > > > > /* An iterable object that can be used to iterate over all objfile= s. > > > The basic use is in a foreach, like: > > > @@ -221,20 +307,25 @@ struct program_space > > > for (objfile *objf : pspace->objfiles_safe ()) { ... } > > > > > > This variant uses a basic_safe_iterator so that objfiles can be > > > - deleted during iteration. */ > > > - objfiles_safe_range objfiles_safe () > > > + deleted during iteration. > > > + > > > + The use of a reverse iterator helps ensure that separate debug > > > + objfiles are deleted before their parent objfile. This prevent= s > > > + the invalidation of an iterator due to the deletion of a parent > > > + objfile. */ > > > + objfiles_safe_reverse_range objfiles_safe () > > > { > > > - return objfiles_safe_range > > > - (objfiles_range > > > - (unwrapping_objfile_iterator (objfiles_list.begin ()), > > > - unwrapping_objfile_iterator (objfiles_list.end ()))); > > > + return objfiles_safe_reverse_range > > > + (objfiles_reverse_range > > > + (unwrapping_reverse_objfile_iterator::begin (objfiles_list), > > > + unwrapping_reverse_objfile_iterator::end (objfiles_list))); > > > } > > > > > > - /* Add OBJFILE to the list of objfiles, putting it just before > > > - BEFORE. If BEFORE is nullptr, it will go at the end of the > > > + /* Add OBJFILE to the list of objfiles, putting it just after > > > + AFTER. If AFTER is nullptr, it will go at the end of the > > > list. */ > > > void add_objfile (std::unique_ptr &&objfile, > > > - struct objfile *before); > > > + struct objfile *after); > > > > > > /* Remove OBJFILE from the list of objfiles. */ > > > void remove_objfile (struct objfile *objfile); > > > diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c > > > index 9db5c47a8ce..784b81b5ca6 100644 > > > --- a/gdb/symfile-debug.c > > > +++ b/gdb/symfile-debug.c > > > @@ -109,9 +109,9 @@ objfile::has_unexpanded_symtabs () > > > objfile_debug_name (this)); > > > > > > bool result =3D false; > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - if (iter->has_unexpanded_symtabs (this)) > > > + if (qf->has_unexpanded_symtabs (this)) > > > { > > > result =3D true; > > > break; > > > @@ -134,9 +134,9 @@ objfile::find_last_source_symtab () > > > gdb_printf (gdb_stdlog, "qf->find_last_source_symtab (%s)\n", > > > objfile_debug_name (this)); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - retval =3D iter->find_last_source_symtab (this); > > > + retval =3D qf->find_last_source_symtab (this); > > > if (retval !=3D nullptr) > > > break; > > > } > > > @@ -167,8 +167,8 @@ objfile::forget_cached_source_info () > > > } > > > } > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->forget_cached_source_info (this); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->forget_cached_source_info (this); > > > } > > > > > > bool > > > @@ -214,17 +214,17 @@ objfile::map_symtabs_matching_filename > > > return result; > > > }; > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - if (!iter->expand_symtabs_matching (this, > > > - match_one_filename, > > > - nullptr, > > > - nullptr, > > > - on_expansion, > > > - (SEARCH_GLOBAL_BLOCK > > > - | SEARCH_STATIC_BLOCK), > > > - UNDEF_DOMAIN, > > > - ALL_DOMAIN)) > > > + if (!qf->expand_symtabs_matching (this, > > > + match_one_filename, > > > + nullptr, > > > + nullptr, > > > + on_expansion, > > > + (SEARCH_GLOBAL_BLOCK > > > + | SEARCH_STATIC_BLOCK), > > > + UNDEF_DOMAIN, > > > + ALL_DOMAIN)) > > > { > > > retval =3D false; > > > break; > > > @@ -283,18 +283,18 @@ objfile::lookup_symbol (block_enum kind, const = char *name, domain_enum domain) > > > return true; > > > }; > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - if (!iter->expand_symtabs_matching (this, > > > - nullptr, > > > - &lookup_name, > > > - nullptr, > > > - search_one_symtab, > > > - kind =3D=3D GLOBAL_BLOCK > > > - ? SEARCH_GLOBAL_BLOCK > > > - : SEARCH_STATIC_BLOCK, > > > - domain, > > > - ALL_DOMAIN)) > > > + if (!qf->expand_symtabs_matching (this, > > > + nullptr, > > > + &lookup_name, > > > + nullptr, > > > + search_one_symtab, > > > + kind =3D=3D GLOBAL_BLOCK > > > + ? SEARCH_GLOBAL_BLOCK > > > + : SEARCH_STATIC_BLOCK, > > > + domain, > > > + ALL_DOMAIN)) > > > break; > > > } > > > > > > @@ -314,8 +314,8 @@ objfile::print_stats (bool print_bcache) > > > gdb_printf (gdb_stdlog, "qf->print_stats (%s, %d)\n", > > > objfile_debug_name (this), print_bcache); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->print_stats (this, print_bcache); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->print_stats (this, print_bcache); > > > } > > > > > > void > > > @@ -340,16 +340,16 @@ objfile::expand_symtabs_for_function (const cha= r *func_name) > > > lookup_name_info base_lookup (func_name, symbol_name_match_type::F= ULL); > > > lookup_name_info lookup_name =3D base_lookup.make_ignore_params ()= ; > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->expand_symtabs_matching (this, > > > - nullptr, > > > - &lookup_name, > > > - nullptr, > > > - nullptr, > > > - (SEARCH_GLOBAL_BLOCK > > > - | SEARCH_STATIC_BLOCK), > > > - VAR_DOMAIN, > > > - ALL_DOMAIN); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->expand_symtabs_matching (this, > > > + nullptr, > > > + &lookup_name, > > > + nullptr, > > > + nullptr, > > > + (SEARCH_GLOBAL_BLOCK > > > + | SEARCH_STATIC_BLOCK), > > > + VAR_DOMAIN, > > > + ALL_DOMAIN); > > > } > > > > > > void > > > @@ -359,8 +359,8 @@ objfile::expand_all_symtabs () > > > gdb_printf (gdb_stdlog, "qf->expand_all_symtabs (%s)\n", > > > objfile_debug_name (this)); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->expand_all_symtabs (this); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->expand_all_symtabs (this); > > > } > > > > > > void > > > @@ -377,16 +377,16 @@ objfile::expand_symtabs_with_fullname (const ch= ar *fullname) > > > return filename_cmp (basenames ? basename : fullname, filename) = =3D=3D 0; > > > }; > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->expand_symtabs_matching (this, > > > - file_matcher, > > > - nullptr, > > > - nullptr, > > > - nullptr, > > > - (SEARCH_GLOBAL_BLOCK > > > - | SEARCH_STATIC_BLOCK), > > > - UNDEF_DOMAIN, > > > - ALL_DOMAIN); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->expand_symtabs_matching (this, > > > + file_matcher, > > > + nullptr, > > > + nullptr, > > > + nullptr, > > > + (SEARCH_GLOBAL_BLOCK > > > + | SEARCH_STATIC_BLOCK), > > > + UNDEF_DOMAIN, > > > + ALL_DOMAIN); > > > } > > > > > > void > > > @@ -402,9 +402,9 @@ objfile::expand_matching_symbols > > > domain_name (domain), global, > > > host_address_to_string (ordered_compare)); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->expand_matching_symbols (this, name, domain, global, > > > - ordered_compare); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->expand_matching_symbols (this, name, domain, global, > > > + ordered_compare); > > > } > > > > > > bool > > > @@ -429,10 +429,10 @@ objfile::expand_symtabs_matching > > > host_address_to_string (&expansion_notify), > > > search_domain_name (kind)); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - if (!iter->expand_symtabs_matching (this, file_matcher, lookup_n= ame, > > > - symbol_matcher, expansion_not= ify, > > > - search_flags, domain, kind)) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + if (!qf->expand_symtabs_matching (this, file_matcher, lookup_nam= e, > > > + symbol_matcher, expansion_notif= y, > > > + search_flags, domain, kind)) > > > return false; > > > return true; > > > } > > > @@ -454,10 +454,10 @@ objfile::find_pc_sect_compunit_symtab (struct b= ound_minimal_symbol msymbol, > > > host_address_to_string (section), > > > warn_if_readin); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - retval =3D iter->find_pc_sect_compunit_symtab (this, msymbol, = pc, section, > > > - warn_if_readin); > > > + retval =3D qf->find_pc_sect_compunit_symtab (this, msymbol, pc= , section, > > > + warn_if_readin); > > > if (retval !=3D nullptr) > > > break; > > > } > > > @@ -482,8 +482,8 @@ objfile::map_symbol_filenames (gdb::function_view= fun, > > > objfile_debug_name (this), > > > need_fullname); > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > - iter->map_symbol_filenames (this, fun, need_fullname); > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > + qf->map_symbol_filenames (this, fun, need_fullname); > > > } > > > > > > struct compunit_symtab * > > > @@ -496,9 +496,9 @@ objfile::find_compunit_symtab_by_address (CORE_AD= DR address) > > > hex_string (address)); > > > > > > struct compunit_symtab *result =3D NULL; > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - result =3D iter->find_compunit_symtab_by_address (this, addres= s); > > > + result =3D qf->find_compunit_symtab_by_address (this, address)= ; > > > if (result !=3D nullptr) > > > break; > > > } > > > @@ -521,10 +521,10 @@ objfile::lookup_global_symbol_language (const c= har *name, > > > enum language result =3D language_unknown; > > > *symbol_found_p =3D false; > > > > > > - for (const auto &iter : qf_require_partial_symbols ()) > > > + for (quick_symbol_functions *qf : qf_require_partial_symbols ()) > > > { > > > - result =3D iter->lookup_global_symbol_language (this, name, do= main, > > > - symbol_found_p); > > > + result =3D qf->lookup_global_symbol_language (this, name, doma= in, > > > + symbol_found_p); > > > if (*symbol_found_p) > > > break; > > > } > > > diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/= gdb.python/py-objfile.exp > > > index 61b9942de79..0bf49976b73 100644 > > > --- a/gdb/testsuite/gdb.python/py-objfile.exp > > > +++ b/gdb/testsuite/gdb.python/py-objfile.exp > > > @@ -135,7 +135,7 @@ gdb_test "p main" "=3D {} $hex
" \ > > > gdb_py_test_silent_cmd "python objfile.add_separate_debug_file(\"${b= infile}\")" \ > > > "Add separate debug file file" 1 > > > > > > -gdb_py_test_silent_cmd "python sep_objfile =3D gdb.objfiles()\[0\]" = \ > > > +gdb_py_test_silent_cmd "python sep_objfile =3D gdb.objfiles()\[1\]" = \ > > > "Get separate debug info objfile" 1 > > > > > > gdb_test "python print (sep_objfile.owner.filename)" "${testfile}2" = \ > > > -- > > > 2.40.1 > > >