Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
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 15:24:08 -0400	[thread overview]
Message-ID: <9a86131a-860e-429d-84fb-d86e2f452f5d@polymtl.ca> (raw)
In-Reply-To: <87h5l9zsr6.fsf@tromey.com>



On 2026-08-04 13:43, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> I could change it to `const std::vector<solib *> &` or
> Simon> `gdb::array_view<solib *>`.  The latter sounds better, since callers
> Simon> don't need to know they are stored in a vector (we could also return an
> Simon> even more generic "range" type, but I guess that would require more
> Simon> boilerplate (unless we already have a class to accomplish this easily
> Simon> 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.
> 
> Simon> Like a "first_solib ()" method?  I certainly can do that.
> 
> Either the array_view or the first_solib approach would be totally fine
> by me.  Thanks.

Ok, when I did the change I realized what you mean.  We only ever care
about the first solib, so if there is this first_solib() method, we can
get first of the solibs() method.  I'll do that.

Simon

  parent reply	other threads:[~2026-08-04 19:24 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
     [not found]       ` <87h5l9zsr6.fsf@tromey.com>
2026-08-04 19:24         ` Simon Marchi [this message]
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=9a86131a-860e-429d-84fb-d86e2f452f5d@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