Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: Guinevere Larsen <guinevere@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/4] gdb/progspace: add solib_ops pointer in program_space
Date: Wed, 11 Jun 2025 14:43:30 -0400	[thread overview]
Message-ID: <c7ec9fc4-bba0-40d6-ad55-48e7c93a251d@efficios.com> (raw)
In-Reply-To: <f3a6effa-9e35-4698-a13a-de3e49228396@redhat.com>

On 6/11/25 2:14 PM, Guinevere Larsen wrote:
>> @@ -1273,9 +1277,9 @@ solib_name_from_address (struct program_space *pspace, CORE_ADDR address)
>>   bool
>>   solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
>>   {
>> -  const solib_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
>> +  const solib_ops *ops = current_program_space->solib_ops ();
>>   -  if (ops->keep_data_in_core)
>> +  if (ops != nullptr && ops->keep_data_in_core != nullptr)
>
> Can this function be called before the program space is fully setup?
> 
> Otherwise I think we should either assume that it was set correctly,
> or assert it. Better to be loud and easy to find the bug than
> accidentally adding a regression in a hard-to-spot place.
> 
> This goes to all other similar places where you check for ops !=
> nullptr.

I don't really know for sure for all the methods.
program_space::m_solib_ops is nullptr before you run the program, and I
don't know off-hand which methods are reachable with an inferior that's
not running yet.  I'll try to see if I can figure it out.

Simon

  reply	other threads:[~2025-06-11 18:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 19:40 [PATCH v2 1/4] gdb/solib: add solib -> solib_ops backlink Simon Marchi
2025-06-09 19:40 ` [PATCH v2 2/4] gdb/solib: use solib::ops for operations that concern a single solib Simon Marchi
2025-06-09 19:40 ` [PATCH v2 3/4] gdb/progspace: add solib_ops pointer in program_space Simon Marchi
2025-06-11 18:14   ` Guinevere Larsen
2025-06-11 18:43     ` Simon Marchi [this message]
2025-06-16 18:41       ` Simon Marchi
2025-06-16 18:53         ` Simon Marchi
2025-06-16 19:38         ` Guinevere Larsen
2025-06-16 19:41           ` Simon Marchi
2025-06-09 19:40 ` [PATCH v2 4/4] gdb/solib: C++ify solib_ops Simon Marchi
2025-06-12 12:56   ` Guinevere Larsen
2025-06-12 15:02     ` 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=c7ec9fc4-bba0-40d6-ad55-48e7c93a251d@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.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