From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Lancelot SIX <Lancelot.Six@amd.com>
Subject: Re: [PATCH v3 08/10] gdb: add objfile -> solib backlink
Date: Tue, 4 Aug 2026 11:47:16 -0400 [thread overview]
Message-ID: <abf4faea-705a-4e51-b552-47f94f645584@polymtl.ca> (raw)
In-Reply-To: <87ldb4uu4b.fsf@tromey.com>
On 7/21/26 1:31 PM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> + /* Return the list of struct solib associated to this objfile. */
> Simon> + std::vector<solib *> &solibs () { return m_solibs; }
>
> It's kind of bad to expose this as a non-const vector, since it means
> that unscrupulous code can just modify it.
I could change it to `const std::vector<solib *> &` or
`gdb::array_view<solib *>`. The latter sounds better, since callers
don't need to know they are stored in a vector (we could also return an
even more generic "range" type, but I guess that would require more
boilerplate (unless we already have a class to accomplish this easily
that I forgot about?).
> Simon> + if (const auto &solibs = objfile->solibs ();
> Simon> + !solibs.empty ())
> Simon> + return solibs.front ();
>
> I wonder if instead you would consider exposing something like this as a
> method on objfile.
Like a "first_solib ()" method? I certainly can do that.
Simon
next prev parent reply other threads:[~2026-08-04 15:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 21:51 [PATCH v3 00/10] Multiple solib_ops in a program_space simon.marchi
2026-07-08 21:51 ` [PATCH v3 01/10] gdb/solib-rocm: assert that host ops isn't rocm_solib_ops simon.marchi
2026-07-08 21:51 ` [PATCH v3 02/10] gdb/solib-rocm: pass reference to cache to rocm_code_object_stream_file simon.marchi
2026-07-08 21:51 ` [PATCH v3 03/10] gdb/solib-rocm: add cached_target_fd to manage cached fd lifetime simon.marchi
2026-07-08 21:51 ` [PATCH v3 04/10] gdb: de-constify some methods of solib_ops simon.marchi
2026-07-08 21:51 ` [PATCH v3 05/10] gdb/solib: add remove_solib function simon.marchi
2026-07-08 21:51 ` [PATCH v3 06/10] gdb/solib-rocm: move per-inferior data to rocm_solib_ops simon.marchi
2026-07-08 21:51 ` [PATCH v3 07/10] gdb/solib-rocm: save inferior in rocm_solib_ops simon.marchi
2026-07-08 21:51 ` [PATCH v3 08/10] gdb: add objfile -> solib backlink simon.marchi
2026-07-21 17:31 ` Tom Tromey
2026-08-04 15:47 ` Simon Marchi [this message]
[not found] ` <87h5l9zsr6.fsf@tromey.com>
2026-08-04 19:24 ` Simon Marchi
2026-07-08 21:51 ` [PATCH v3 09/10] gdb: change default objfile iteration order to start with current objfile simon.marchi
2026-07-08 21:51 ` [PATCH v3 10/10] gdb: multiple solib_ops per program space simon.marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abf4faea-705a-4e51-b552-47f94f645584@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=Lancelot.Six@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox