diff options
author | Pedro Alves <palves@redhat.com> | 2019-01-23 18:58:30 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-01-23 19:04:07 +0000 |
commit | e587ef421eb7e009c6a69da55c269e9df45093e4 (patch) | |
tree | e215a8c36b3a7dbca73b0b7ee092232758e3b863 /gdb | |
parent | 77f0e74cbe2ee7e874432776a0394a3d2a7a4342 (diff) | |
download | gdb-e587ef421eb7e009c6a69da55c269e9df45093e4.zip gdb-e587ef421eb7e009c6a69da55c269e9df45093e4.tar.gz gdb-e587ef421eb7e009c6a69da55c269e9df45093e4.tar.bz2 |
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')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/gdbarch-selftests.c | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 008208e..6395791 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,8 @@ 2019-01-23 Pedro Alves <palves@redhat.com> + + * gdbarch-selftests.c (struct on_exit): Use SCOPE_EXIT. + +2019-01-23 Pedro Alves <palves@redhat.com> Andrew Burgess <andrew.burgess@embecosm.com> * gdbthread.h: Include "common/forward-scope-exit.h". diff --git a/gdb/gdbarch-selftests.c b/gdb/gdbarch-selftests.c index 50062ab..64d1e54 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 |