/* BSD user-level threads support.
- Copyright (C) 2005-2017 Free Software Foundation, Inc.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
This file is part of GDB.
bsd_uthread_fetch_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
struct bsd_uthread_ops *uthread_ops
= (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
ptid_t ptid = regcache_get_ptid (regcache);
CORE_ADDR addr = ptid_get_tid (ptid);
struct target_ops *beneath = find_target_beneath (ops);
CORE_ADDR active_addr;
- struct cleanup *cleanup = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
/* We are doing operations (e.g. reading memory) that rely on
inferior_ptid. */
uthread_ops->supply_uthread (regcache, regnum,
addr + bsd_uthread_thread_ctx_offset);
}
-
- do_cleanups (cleanup);
}
static void
bsd_uthread_store_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ 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 (ops);
ptid_t ptid = regcache_get_ptid (regcache);
CORE_ADDR addr = ptid_get_tid (ptid);
CORE_ADDR active_addr;
- struct cleanup *cleanup = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
/* We are doing operations (e.g. reading memory) that rely on
inferior_ptid. */
request to the layer beneath. */
beneath->to_store_registers (beneath, regcache, regnum);
}
-
- do_cleanups (cleanup);
}
static ptid_t
return t;
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_bsd_uthread;
-
void
_initialize_bsd_uthread (void)
{