Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: pass inferior argument to inf_child_target::maybe_unpush_target
Date: Thu, 14 May 2026 16:26:54 -0400	[thread overview]
Message-ID: <1f7b28b1-6929-47f0-b183-abaabc94e46b@simark.ca> (raw)
In-Reply-To: <4a06ca5986e36021a3ca4c47020cd3f8daee16a7.1778600715.git.aburgess@redhat.com>



On 2026-05-12 11:45, Andrew Burgess wrote:
> @@ -2594,9 +2594,9 @@ procfs_target::mourn_inferior ()
>  	destroy_procinfo (pi);
>      }
>  
> +  inferior *inf = current_inferior ();
>    generic_mourn_inferior ();
> -
> -  maybe_unpush_target ();
> +  maybe_unpush_target (inf);

You wrote it this particular way because generic_mourn_inferior could
switch inferior, as you explained in your commit message.  I think it
would deserve a comment at all these spots to explain that we capture
the current inferior before "generic_mourn_inferior", because that
function can switch the current inferior.  Otherwise, it would be very
easy for someone (like me) to "optimize out" the temporary variable
without realizing the behavior change.

Otherwise I think it's fine, one little baby steps towards using less
"current inferior" everywhere.

Simon

  parent reply	other threads:[~2026-05-14 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 15:45 Andrew Burgess
2026-05-14 20:17 ` Kevin Buettner
2026-05-14 20:26 ` Simon Marchi [this message]
2026-05-15 10:22   ` Andrew Burgess

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=1f7b28b1-6929-47f0-b183-abaabc94e46b@simark.ca \
    --to=simark@simark.ca \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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