From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>,
Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH v3 05/17] Use SCOPE_EXIT in gdbarch-selftest.c
Date: Wed, 23 Jan 2019 15:21:00 -0000 [thread overview]
Message-ID: <20190123152131.29893-6-palves@redhat.com> (raw)
In-Reply-To: <20190123152131.29893-1-palves@redhat.com>
Replace the custom local class with a SCOPE_EXIT.
gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>
* gdbarch-selftests.c (struct on_exit): Use SCOPE_EXIT.
---
gdb/gdbarch-selftests.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/gdb/gdbarch-selftests.c b/gdb/gdbarch-selftests.c
index 50062abe8a..64d1e543e4 100644
--- a/gdb/gdbarch-selftests.c
+++ b/gdb/gdbarch-selftests.c
@@ -104,13 +104,7 @@ register_to_value_test (struct gdbarch *gdbarch)
push_target (&mock_target);
/* Pop it again on exit (return/exception). */
- struct on_exit
- {
- ~on_exit ()
- {
- pop_all_targets_at_and_above (process_stratum);
- }
- } pop_targets;
+ SCOPE_EXIT { pop_all_targets_at_and_above (process_stratum); };
/* Switch to the mock thread. */
scoped_restore restore_inferior_ptid
--
2.14.4
next prev parent reply other threads:[~2019-01-23 15:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 15:21 [PATCH v3 00/17] Remove some cleanups using scope_exit Pedro Alves
2019-01-23 15:21 ` [PATCH v3 14/17] Remove remaining cleanup from fetch_inferior_event Pedro Alves
2019-01-23 15:21 ` [PATCH v3 06/17] Replace delete_longjmp_breakpoint_cleanup with a forward_scope_exit type Pedro Alves
2019-01-23 15:21 ` [PATCH v3 16/17] Update cleanup comment in ui-out.h Pedro Alves
2019-01-23 15:21 ` [PATCH v3 12/17] Remove clear_symtab_users_cleanup Pedro Alves
2019-01-23 15:21 ` [PATCH v3 15/17] Update an obsolete cleanup comment Pedro Alves
2019-01-23 15:21 ` [PATCH v3 01/17] Rename ESC -> ESC_PARENS Pedro Alves
2019-01-23 15:21 ` [PATCH v3 10/17] Remove cleanup_delete_std_terminate_breakpoint Pedro Alves
2019-01-23 15:21 ` [PATCH v3 13/17] Remove cleanup from stop_all_threads Pedro Alves
2019-01-23 15:21 ` [PATCH v3 03/17] Introduce forward_scope_exit Pedro Alves
2019-01-23 15:21 ` [PATCH v3 04/17] Use forward_scope_exit for scoped_finish_thread_state Pedro Alves
2019-01-23 17:10 ` Tom Tromey
2019-01-23 15:21 ` Pedro Alves [this message]
2019-01-23 15:21 ` [PATCH v3 02/17] Introduce scope_exit Pedro Alves
2019-01-23 15:21 ` [PATCH v3 07/17] Remove remaining cleanup from gdb/breakpoint.c Pedro Alves
2019-01-23 15:21 ` [PATCH v3 17/17] Use scope_exit in regcache.c Pedro Alves
2019-01-23 15:21 ` [PATCH v3 08/17] Remove delete_just_stopped_threads_infrun_breakpoints_cleanup Pedro Alves
2019-01-23 15:28 ` [PATCH v3 09/17] Remove make_bpstat_clear_actions_cleanup Pedro Alves
2019-01-23 17:33 ` [PATCH v3 00/17] Remove some cleanups using scope_exit Tom Tromey
2019-01-23 19:18 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190123152131.29893-6-palves@redhat.com \
--to=palves@redhat.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox