Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: simon.marchi@polymtl.ca
Cc: gdb-patches@sourceware.org,  Tom Tromey <tom@tromey.com>,
	 Lancelot SIX <Lancelot.Six@amd.com>
Subject: Re: [PATCH v3 08/10] gdb: add objfile -> solib backlink
Date: Tue, 21 Jul 2026 11:31:48 -0600	[thread overview]
Message-ID: <87ldb4uu4b.fsf@tromey.com> (raw)
In-Reply-To: <20260708215145.93134-9-simon.marchi@polymtl.ca> (simon marchi's message of "Wed, 8 Jul 2026 17:51:40 -0400")

>>>>> "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.

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.

Tom

  reply	other threads:[~2026-07-21 17:32 UTC|newest]

Thread overview: 12+ 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 [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=87ldb4uu4b.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=Lancelot.Six@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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