From 328d42d87e97c75d6e52800bfd4bc1bfdfb745d2 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 24 Mar 2021 18:08:12 -0400 Subject: 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 --- gdb/valprint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/valprint.c') diff --git a/gdb/valprint.c b/gdb/valprint.c index c089ee2..baf50f7 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -42,6 +42,7 @@ #include "count-one-bits.h" #include "c-lang.h" #include "cp-abi.h" +#include "inferior.h" /* Maximum number of wchars returned from wchar_iterate. */ #define MAX_WCHARS 4 @@ -1848,9 +1849,8 @@ print_function_pointer_address (const struct value_print_options *options, CORE_ADDR address, struct ui_file *stream) { - CORE_ADDR func_addr - = gdbarch_convert_from_func_ptr_addr (gdbarch, address, - current_top_target ()); + CORE_ADDR func_addr = gdbarch_convert_from_func_ptr_addr + (gdbarch, address, current_inferior ()->top_target ()); /* If the function pointer is represented by a description, print the address of the description. */ -- cgit v1.1