From: Lancelot SIX Date: Fri, 10 Mar 2023 15:34:26 +0000 (+0000) Subject: gdb/amd-dbgapi-target: Use inf param in detach X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81dd93c85623960bf4b1f7c2e2d297a333e2ec52;p=binutils-gdb.git gdb/amd-dbgapi-target: Use inf param in detach 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 Approved-By: Pedro Alves --- 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);