diff options
author | Tom Tromey <tom@tromey.com> | 2018-02-05 10:59:52 +0100 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-02-08 11:46:55 -0700 |
commit | 8ce47547b34fddec16d1ccd801f025a56976af95 (patch) | |
tree | 6f44ae6381c071699678f22072431a66499ae59f /gdb/gdbserver/linux-low.c | |
parent | 45dd3607e24aaf515b5d75c666b351575410392b (diff) | |
download | gdb-8ce47547b34fddec16d1ccd801f025a56976af95.zip gdb-8ce47547b34fddec16d1ccd801f025a56976af95.tar.gz gdb-8ce47547b34fddec16d1ccd801f025a56976af95.tar.bz2 |
Remove make_cleanup_restore_current_thread from gdbserver
This removes make_cleanup_restore_current_thread from gdbserver,
replacing it with a use of scoped_restore.
2018-02-08 Tom Tromey <tom@tromey.com>
* linux-low.c (install_software_single_step_breakpoints): Use
make_scoped_restore.
* inferiors.c (make_cleanup_restore_current_thread): Remove.
(do_restore_current_thread_cleanup): Remove.
* gdbthread.h (make_cleanup_restore_current_thread): Don't
declare.
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r-- | gdb/gdbserver/linux-low.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 38142bb..b6b660e 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -50,6 +50,7 @@ #include "common-inferior.h" #include "nat/fork-inferior.h" #include "environ.h" +#include "common/scoped_restore.h" #ifndef ELFMAG0 /* Don't include <linux/elf.h> here. If it got included by gdb_proc_service.h then ELFMAG0 will have been defined. If it didn't get included by @@ -4207,15 +4208,14 @@ install_software_single_step_breakpoints (struct lwp_info *lwp) { struct thread_info *thread = get_lwp_thread (lwp); struct regcache *regcache = get_thread_regcache (thread, 1); - struct cleanup *old_chain = make_cleanup_restore_current_thread (); + + scoped_restore save_current_thread = make_scoped_restore (¤t_thread); current_thread = thread; std::vector<CORE_ADDR> next_pcs = the_low_target.get_next_pcs (regcache); for (CORE_ADDR pc : next_pcs) set_single_step_breakpoint (pc, current_ptid); - - do_cleanups (old_chain); } /* Single step via hardware or software single step. |