aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-04-03 14:52:04 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-04-17 13:47:13 -0400
commit2b214d3e3b51b9a6544ffbcf0a1554376c3ce9c5 (patch)
tree8c6bea126421d58443f9f75dfe0d97d6b1518b1b
parentf56944000c014116905d4fffe27da05ef8896cfd (diff)
downloadfsf-binutils-gdb-2b214d3e3b51b9a6544ffbcf0a1554376c3ce9c5.zip
fsf-binutils-gdb-2b214d3e3b51b9a6544ffbcf0a1554376c3ce9c5.tar.gz
fsf-binutils-gdb-2b214d3e3b51b9a6544ffbcf0a1554376c3ce9c5.tar.bz2
gdb: remove regcache::target
The regcache class takes a process_stratum_target and then exposes it through regcache::target. But it doesn't use it itself, suggesting it doesn't really make sense to put it there. The only user of regcache::target is record_btrace_target::fetch_registers, but it might as well just get it from the current target stack. This simplifies a little bit a patch later in this series. Change-Id: I8878d875805681c77f469ac1a2bf3a508559a62d Reviewed-By: Pedro Alves <pedro@palves.net>
-rw-r--r--gdb/record-btrace.c3
-rw-r--r--gdb/regcache.c1
-rw-r--r--gdb/regcache.h5
3 files changed, 2 insertions, 7 deletions
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 25ae663..9dd8474 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1548,7 +1548,8 @@ record_btrace_target::fetch_registers (struct regcache *regcache, int regno)
/* Thread-db may ask for a thread's registers before GDB knows about the
thread. We forward the request to the target beneath in this
case. */
- thread_info *tp = regcache->target ()->find_thread (regcache->ptid ());
+ thread_info *tp
+ = current_inferior ()->process_target ()->find_thread (regcache->ptid ());
if (tp != nullptr)
replay = tp->btrace.replay;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index af76fab..cfa8a3d 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1622,7 +1622,6 @@ get_thread_arch_aspace_regcache_and_check (process_stratum_target *target,
= get_thread_arch_aspace_regcache (target, ptid, arch, aspace);
SELF_CHECK (regcache != NULL);
- SELF_CHECK (regcache->target () == target);
SELF_CHECK (regcache->ptid () == ptid);
SELF_CHECK (regcache->arch () == arch);
SELF_CHECK (regcache->aspace () == aspace);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index b9ffab9..2bd2f57 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -416,11 +416,6 @@ public:
this->m_ptid = ptid;
}
- process_stratum_target *target () const
- {
- return m_target;
- }
-
/* Dump the contents of a register from the register cache to the target
debug. */
void debug_print_register (const char *func, int regno);