public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: Use passed gdbarch instead of calling current_inferior
@ 2024-04-19 14:31 Luis Machado
0 siblings, 0 replies; only message in thread
From: Luis Machado @ 2024-04-19 14:31 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a0e28bb1515572fca428b452a523f882eea16797
commit a0e28bb1515572fca428b452a523f882eea16797
Author: Gustavo Romero <gustavo.romero@linaro.org>
Date: Thu Apr 18 20:10:35 2024 +0000
gdb: Use passed gdbarch instead of calling current_inferior
In do_examine function, use passed gdbarch when checking if an address
is tagged instead of calling current_inferior()->arch() to make the code
more localized and help modularity by not calling a current_* function,
which disguises the use of a global state/variable. There is no change
in the code behavior.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Suggested-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Approved-By: Luis Machado <luis.machado@arm.com>
Tested-By: Luis Machado <luis.machado@arm.com>
Diff:
---
gdb/printcmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 5635f605314..4edbd458e4d 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1132,7 +1132,7 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
= value_from_ulongest (builtin_type (gdbarch)->builtin_data_ptr,
tag_laddr);
- if (gdbarch_tagged_address_p (current_inferior ()->arch (), v_addr))
+ if (gdbarch_tagged_address_p (gdbarch, v_addr))
{
/* Fetch the allocation tag. */
struct value *tag
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-19 14:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 14:31 [binutils-gdb] gdb: Use passed gdbarch instead of calling current_inferior Luis Machado
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).