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>, Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 11/11] gdb: multiple solib_ops per program space
Date: Thu, 7 May 2026 22:52:12 -0400	[thread overview]
Message-ID: <5b5fc6b8-a0b4-4346-88e1-4974a9eed31c@polymtl.ca> (raw)
In-Reply-To: <87fr4fknaz.fsf@tromey.com>

On 4/28/26 1:27 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> This patch adds the possibility for a program space to have multiple
> Simon> solib_ops.  The motivation for this is to support ROCm (GPU) debugging
> Simon> more cleanly.
> 
> Simon> Currently, when debugging a ROCm program, in order to be able to list
> Simon> device code objects (the equivalent of shared libraries but for the
> Simon> GPU), we install an instance of rocm_solib_ops as the program space's
> Simon> sole solib_ops.  But in order to still be able to list host shared
> Simon> libraries, the rocm_solib_ops wraps the previously installed solib_ops
> Simon> (currently always an svr4_solib_ops instance) and forwards method calls
> Simon> to it.
> 
> From this description and the comment in progspace.h, I wonder if this
> is a case where an inferior should have multiple program spaces.

I never thought about that.

The host and device do share a single virtual address space.  This
doesn't mean that both host and device can necessarily access each
other's memory transparently, but the host stuff and the device stuff
won't overlap.  So perhaps that could indeed be modeled by one struct
address_space bound to two struct program_space.  I'll discuss that with
my team.

> However I don't really want to block the work that's already been done.

Going to multiple solib ops is a big design change, so it if turns out
that it's not the right one, it's better to know now.

> Simon>  struct solib_ops
> Simon>  {
> Simon> -  explicit solib_ops (program_space *pspace)
> Simon> -    : m_pspace (pspace)
> Simon> +  explicit solib_ops (program_space *pspace, bool handle_main_objfile)
> Simon> +    : m_pspace (pspace), m_handle_main_objfile (handle_main_objfile)
> 
> No need for 'explicit' any more.

Ack.

Simon

  reply	other threads:[~2026-05-08  2:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 19:32 [PATCH 00/11] Multiple solib_ops in a program_space Simon Marchi
2025-12-09 19:32 ` [PATCH 01/11] gdb/solib-rocm: assert that host ops isn't rocm_solib_ops Simon Marchi
2026-05-07 17:56   ` [PATCH 1/11] " Lancelot SIX
2026-05-08  1:37     ` Simon Marchi
2026-05-08 10:36       ` Lancelot SIX
2026-06-08 18:36         ` Simon Marchi
2025-12-09 19:32 ` [PATCH 02/11] gdb/solib: use early return in solib_read_symbols Simon Marchi
2026-04-28 16:16   ` Tom Tromey
2026-05-08  1:44     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 03/11] gdb/solib-rocm: pass reference to cache to rocm_code_object_stream_file Simon Marchi
2026-05-07 18:20   ` [PATCH 3/11] " Lancelot SIX
2026-05-08  1:48     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 04/11] gdb/solib-rocm: add cached_fd to manage cached fd lifetime Simon Marchi
2026-05-07 20:17   ` [PATCH 4/11] " Lancelot SIX
2026-05-08  1:52     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 05/11] gdb: de-constify some methods of solib_ops Simon Marchi
2025-12-09 19:32 ` [PATCH 06/11] gdb/solib-rocm: move per-inferior data to rocm_solib_ops Simon Marchi
2026-04-28 16:19   ` Tom Tromey
2026-05-08  2:02     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 07/11] gdb/solib-rocm: save inferior in rocm_solib_ops Simon Marchi
     [not found]   ` <87a4unm59w.fsf@tromey.com>
2026-05-08  2:10     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 08/11] gdb/solib: add remove_solib function Simon Marchi
2026-04-28 16:23   ` Tom Tromey
2025-12-09 19:32 ` [PATCH 09/11] gdb: add objfile -> solib backlink Simon Marchi
2026-04-28 16:28   ` Tom Tromey
2026-05-08  2:25     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 10/11] gdb: change default objfile iteration order to start with current objfile Simon Marchi
2026-04-28 16:42   ` Tom Tromey
2026-05-08  2:40     ` Simon Marchi
2025-12-09 19:32 ` [PATCH 11/11] gdb: multiple solib_ops per program space Simon Marchi
2026-04-28 17:27   ` Tom Tromey
2026-05-08  2:52     ` Simon Marchi [this message]
2026-04-28 16:00 ` [PATCH 00/11] Multiple solib_ops in a program_space Simon Marchi
2026-04-28 17:28   ` Tom Tromey
2026-05-08  2:40     ` 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=5b5fc6b8-a0b4-4346-88e1-4974a9eed31c@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --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