aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.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/linespec.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/linespec.c')
-rw-r--r--gdb/linespec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index c7dbd3e..4034bba 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -47,6 +47,7 @@
#include "gdbsupport/function-view.h"
#include "gdbsupport/def-vector.h"
#include <algorithm>
+#include "inferior.h"
/* An enumeration of the various things a user might attempt to
complete for a linespec location. */
@@ -2314,7 +2315,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
= (gdbarch_convert_from_func_ptr_addr
(gdbarch,
msym_addr,
- current_top_target ()));
+ current_inferior ()->top_target ()));
}
if (msym_addr == addr)