Make program_space::deleted_solibs a vector of std::string
[deliverable/binutils-gdb.git] / gdb / bsd-uthread.c
index 9769d207dda2de82566ff60b17283db1e5b165d7..fdcac41e6ab7d10a795ad0806429449be2a467d0 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -287,14 +287,14 @@ static void
 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.  */
@@ -315,22 +315,20 @@ bsd_uthread_fetch_registers (struct target_ops *ops,
       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.  */
@@ -349,8 +347,6 @@ bsd_uthread_store_registers (struct target_ops *ops,
          request to the layer beneath.  */
       beneath->to_store_registers (beneath, regcache, regnum);
     }
-
-  do_cleanups (cleanup);
 }
 
 static ptid_t
@@ -551,9 +547,6 @@ bsd_uthread_target (void)
   return t;
 }
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_bsd_uthread;
-
 void
 _initialize_bsd_uthread (void)
 {
This page took 0.038656 seconds and 4 git commands to generate.