diff options
author | Tom Tromey <tom@tromey.com> | 2019-01-23 18:58:35 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-01-23 19:14:44 +0000 |
commit | 9885e6bb5b0f6f0147f9b3a15a4bd4516faf4a26 (patch) | |
tree | c2ce9da21e4b1ad2a16802624e848eb34246ff31 | |
parent | 286526c1e5f6d54bf6ecc961d7c2d0a32b58fe45 (diff) | |
download | gdb-9885e6bb5b0f6f0147f9b3a15a4bd4516faf4a26.zip gdb-9885e6bb5b0f6f0147f9b3a15a4bd4516faf4a26.tar.gz gdb-9885e6bb5b0f6f0147f9b3a15a4bd4516faf4a26.tar.bz2 |
Remove cleanup from stop_all_threads
This removes the cleanup from stop_all_threads, replacing it with a
scope_exit.
gdb/ChangeLog:
2019-01-23 Tom Tromey <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* infrun.c (disable_thread_events): Delete.
(stop_all_threads): Use SCOPE_EXIT.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/infrun.c | 13 |
2 files changed, 7 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4f53675..1df10d4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,6 +1,12 @@ 2019-01-23 Tom Tromey <tom@tromey.com> Pedro Alves <palves@redhat.com> + * infrun.c (disable_thread_events): Delete. + (stop_all_threads): Use SCOPE_EXIT. + +2019-01-23 Tom Tromey <tom@tromey.com> + Pedro Alves <palves@redhat.com> + * symfile.c: Include forward-scope-exit.h. (clear_symtab_users_cleanup): Replace forward declaration with a FORWARD_SCOPE_EXIT. diff --git a/gdb/infrun.c b/gdb/infrun.c index 76dedd2..d954eae 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4273,14 +4273,6 @@ save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws) } } -/* A cleanup that disables thread create/exit events. */ - -static void -disable_thread_events (void *arg) -{ - target_thread_events (0); -} - /* See infrun.h. */ void @@ -4289,7 +4281,6 @@ stop_all_threads (void) /* We may need multiple passes to discover all threads. */ int pass; int iterations = 0; - struct cleanup *old_chain; gdb_assert (target_is_non_stop_p ()); @@ -4299,7 +4290,7 @@ stop_all_threads (void) scoped_restore_current_thread restore_thread; target_thread_events (1); - old_chain = make_cleanup (disable_thread_events, NULL); + SCOPE_EXIT { target_thread_events (0); }; /* Request threads to stop, and then wait for the stops. Because threads we already know about can spawn more threads while we're @@ -4484,8 +4475,6 @@ stop_all_threads (void) } } - do_cleanups (old_chain); - if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: stop_all_threads done\n"); } |