public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/amd-dbgapi-target: Use inf param in detach
@ 2023-06-16  9:25 Lancelot SIX
  2023-07-14 18:35 ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Lancelot SIX @ 2023-06-16  9:25 UTC (permalink / raw)
  To: gdb-patches; +Cc: lsix, Lancelot SIX

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-19  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16  9:25 [PATCH] gdb/amd-dbgapi-target: Use inf param in detach Lancelot SIX
2023-07-14 18:35 ` Pedro Alves
2023-07-14 18:54   ` Lancelot SIX
2023-07-14 19:18     ` Pedro Alves
2023-07-15  2:00       ` Simon Marchi
2023-07-19  8:56       ` Lancelot SIX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).