aboutsummaryrefslogtreecommitdiff
path: root/gdb/bsd-uthread.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-06-07 17:27:47 +0100
committerPedro Alves <palves@redhat.com>2018-06-07 18:57:37 +0100
commitd6ca69cddc3fc6ef61fdfe3c3803d13b0b4e13e9 (patch)
treeed4b826fa773038c603131579fac9ffdfb734053 /gdb/bsd-uthread.c
parentb6a8c27bb8fb383be6f57724eb9aafa9f2f83aa5 (diff)
downloadfsf-binutils-gdb-d6ca69cddc3fc6ef61fdfe3c3803d13b0b4e13e9.zip
fsf-binutils-gdb-d6ca69cddc3fc6ef61fdfe3c3803d13b0b4e13e9.tar.gz
fsf-binutils-gdb-d6ca69cddc3fc6ef61fdfe3c3803d13b0b4e13e9.tar.bz2
Eliminate find_target_beneath
Call target_ops::beneath() throughout instead. gdb/ChangeLog: 2018-06-07 Pedro Alves <palves@redhat.com> * target.h (find_target_beneath): Delete declaration. * target.c (find_target_beneath): Delete definition. * aix-thread.c: All callers of find_target_beneath adjusted to call target_ops::beneath instead. * bsd-uthread.c: Likewise. * linux-thread-db.c: Likewise. * ravenscar-thread.c: Likewise. * sol-thread.c: Likewise. * spu-multiarch.c: Likewise.
Diffstat (limited to 'gdb/bsd-uthread.c')
-rw-r--r--gdb/bsd-uthread.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 9ead7c2..ee2e5ad 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -310,8 +310,7 @@ bsd_uthread_solib_unloaded (struct so_list *so)
void
bsd_uthread_target::mourn_inferior ()
{
- struct target_ops *beneath = find_target_beneath (this);
- beneath->mourn_inferior ();
+ beneath ()->mourn_inferior ();
bsd_uthread_deactivate ();
}
@@ -323,7 +322,6 @@ bsd_uthread_target::fetch_registers (struct regcache *regcache, int regnum)
= (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
ptid_t ptid = regcache->ptid ();
CORE_ADDR addr = ptid_get_tid (ptid);
- struct target_ops *beneath = find_target_beneath (this);
CORE_ADDR active_addr;
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
@@ -332,7 +330,7 @@ bsd_uthread_target::fetch_registers (struct regcache *regcache, int regnum)
inferior_ptid = ptid;
/* Always fetch the appropriate registers from the layer beneath. */
- beneath->fetch_registers (regcache, regnum);
+ beneath ()->fetch_registers (regcache, regnum);
/* FIXME: That might have gotten us more than we asked for. Make
sure we overwrite all relevant registers with values from the
@@ -354,7 +352,6 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum)
struct gdbarch *gdbarch = regcache->arch ();
struct bsd_uthread_ops *uthread_ops
= (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
- struct target_ops *beneath = find_target_beneath (this);
ptid_t ptid = regcache->ptid ();
CORE_ADDR addr = ptid_get_tid (ptid);
CORE_ADDR active_addr;
@@ -375,7 +372,7 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum)
{
/* Updating the thread that is currently running; pass the
request to the layer beneath. */
- beneath->store_registers (regcache, regnum);
+ beneath ()->store_registers (regcache, regnum);
}
}
@@ -385,10 +382,9 @@ bsd_uthread_target::wait (ptid_t ptid, struct target_waitstatus *status,
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR addr;
- struct target_ops *beneath = find_target_beneath (this);
/* Pass the request to the layer beneath. */
- ptid = beneath->wait (ptid, status, options);
+ ptid = beneath ()->wait (ptid, status, options);
/* If the process is no longer alive, there's no point in figuring
out the thread ID. It will fail anyway. */
@@ -433,15 +429,13 @@ void
bsd_uthread_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
{
/* Pass the request to the layer beneath. */
- struct target_ops *beneath = find_target_beneath (this);
- beneath->resume (ptid, step, sig);
+ beneath ()->resume (ptid, step, sig);
}
bool
bsd_uthread_target::thread_alive (ptid_t ptid)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- struct target_ops *beneath = find_target_beneath (this);
CORE_ADDR addr = ptid_get_tid (ptid);
if (addr != 0)
@@ -456,7 +450,7 @@ bsd_uthread_target::thread_alive (ptid_t ptid)
return false;
}
- return beneath->thread_alive (ptid);
+ return beneath ()->thread_alive (ptid);
}
void