Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
To: <gdb-patches@sourceware.org>
Cc: <lsix@lancelotsix.com>, Lancelot SIX <lancelot.six@amd.com>
Subject: [PATCH] gdb/amd-dbgapi-target: Use inf param in detach
Date: Fri, 16 Jun 2023 10:25:28 +0100	[thread overview]
Message-ID: <20230616092528.69358-1-lancelot.six@amd.com> (raw)

Current implementation of amd_dbgapi_target::detach (inferior *, int)
does the following:

  remove_breakpoints_inf (current_inferior ());
  detach_amd_dbgapi (inf);
  beneath ()->detach (inf, from_tty);

I find that using a mix of `current_inferior ()` and `inf` disturbing.
At this point, we know that both are the same (target_detach does assert
that `inf == current_inferior ()` before calling target_ops::detach).

To improve consistency, this patch replaces `current_inferior ()` with
`inf` in amd_dbgapi_target::detach.

Change-Id: I01b7ba2e661c25839438354b509d7abbddb7c5ed
---
 gdb/amd-dbgapi-target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c
index 5565cf907fa..40f24b5fc2f 100644
--- a/gdb/amd-dbgapi-target.c
+++ b/gdb/amd-dbgapi-target.c
@@ -1463,7 +1463,7 @@ amd_dbgapi_target::detach (inferior *inf, int from_tty)
      Breakpoints may still be inserted because the inferior may be running in
      non-stop mode, or because GDB changed the default setting to leave all
      breakpoints inserted in all-stop mode when all threads are stopped.  */
-  remove_breakpoints_inf (current_inferior ());
+  remove_breakpoints_inf (inf);
 
   detach_amd_dbgapi (inf);
   beneath ()->detach (inf, from_tty);

base-commit: b1c792568662d7e00158d19e0439b64f98b78e47
-- 
2.34.1


             reply	other threads:[~2023-06-16  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  9:25 Lancelot SIX via Gdb-patches [this message]
2023-07-14 18:35 ` Pedro Alves
2023-07-14 18:54   ` Lancelot SIX via Gdb-patches
2023-07-14 19:18     ` Pedro Alves
2023-07-15  2:00       ` Simon Marchi via Gdb-patches
2023-07-19  8:56       ` Lancelot SIX via Gdb-patches

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=20230616092528.69358-1-lancelot.six@amd.com \
    --to=gdb-patches@sourceware.org \
    --cc=lancelot.six@amd.com \
    --cc=lsix@lancelotsix.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