aboutsummaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-03-24 18:08:12 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-03-24 18:08:24 -0400
commit328d42d87e97c75d6e52800bfd4bc1bfdfb745d2 (patch)
tree4dee500fe0bf6acd7dcb8153aabebaa27936c564 /gdb/avr-tdep.c
parentd777bf0df22f1048fd24999ae563e30abcbcfbe7 (diff)
downloadgdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.zip
gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.tar.gz
gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.tar.bz2
gdb: remove current_top_target function
The current_top_target function is a hidden dependency on the current inferior. Since I'd like to slowly move towards reducing our dependency on the global current state, remove this function and make callers use current_inferior ()->top_target () There is no expected change in behavior, but this one step towards making those callers use the inferior from their context, rather than refer to the global current inferior. gdb/ChangeLog: * target.h (current_top_target): Remove, make callers use the current inferior instead. * target.c (current_top_target): Remove. Change-Id: Iccd457036f84466cdaa3865aa3f9339a24ea001d
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 815c6d4..018b18f 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1561,7 +1561,8 @@ avr_io_reg_read_command (const char *args, int from_tty)
/* Find out how many io registers the target has. */
gdb::optional<gdb::byte_vector> buf
- = target_read_alloc (current_top_target (), TARGET_OBJECT_AVR, "avr.io_reg");
+ = target_read_alloc (current_inferior ()->top_target (),
+ TARGET_OBJECT_AVR, "avr.io_reg");
if (!buf)
{
@@ -1595,7 +1596,8 @@ avr_io_reg_read_command (const char *args, int from_tty)
j = nreg - i; /* last block is less than 8 registers */
snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j);
- buf = target_read_alloc (current_top_target (), TARGET_OBJECT_AVR, query);
+ buf = target_read_alloc (current_inferior ()->top_target (),
+ TARGET_OBJECT_AVR, query);
if (!buf)
{