summaryrefslogtreecommitdiff
path: root/gdb/gdbarch-selftests.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2019-01-23 18:58:30 +0000
committerPedro Alves <palves@redhat.com>2019-01-23 19:04:07 +0000
commite587ef421eb7e009c6a69da55c269e9df45093e4 (patch)
treee215a8c36b3a7dbca73b0b7ee092232758e3b863 /gdb/gdbarch-selftests.c
parent77f0e74cbe2ee7e874432776a0394a3d2a7a4342 (diff)
downloadbinutils-gdb-e587ef421eb7e009c6a69da55c269e9df45093e4.tar.gz
Use SCOPE_EXIT in gdbarch-selftest.c
Replace the custom local class with a SCOPE_EXIT. gdb/ChangeLog: 2019-01-23 Pedro Alves <palves@redhat.com> * gdbarch-selftests.c (struct on_exit): Use SCOPE_EXIT.
Diffstat (limited to 'gdb/gdbarch-selftests.c')
-rw-r--r--gdb/gdbarch-selftests.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/gdb/gdbarch-selftests.c b/gdb/gdbarch-selftests.c
index 50062abe8ae..64d1e543e45 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