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 00/17] Remove some cleanups using scope_exit
Date: Wed, 23 Jan 2019 15:21:00 -0000 [thread overview]
Message-ID: <20190123152131.29893-1-palves@redhat.com> (raw)
Here's the new version of Tromey's "cleanup function" series, updated
to use the new scope_exit instead.
v1 was here:
https://sourceware.org/ml/gdb-patches/2019-01/msg00159.html
I'm calling Andrew's patches the "v2":
https://sourceware.org/ml/gdb-patches/2019-01/msg00273.html
The discussion around "v2" led to this version.
New in v3:
- cleanup_function is replaced with a new scope_exit template
class. scope_exit is a general-purpose scope guard that calls
its exit function at the end of the current scope. Unlike the
original cleanup_function, scope_exit is a template, and saves
the callable internaly (function pointer, function object,
lambda) instead of using gdb::function_view. This leads to a bit
more natural syntax, since there's no need to worry about
lifetime of the callable. Also, being a template, there's no
heap involved, unlike if we used std::function.
- forward_scope_exit is new. The idea is based on Andrew's here:
https://sourceware.org/ml/gdb-patches/2019-01/msg00273.html
though the implementation is different, and this version ends up
with a simpler user interface.
- Patches #1 and #5 are new.
- Patches #8 and #9 and swapped compared to the original series,
and a cleanup conversion was moved between the patches.
- Patch #7 removes a bit more comment than the previous version.
- Series updated throughout to use
scope_exit/SCOPE_EXIT/make_scope_exit/forward_scope_exit as
appropriate.
Pedro Alves (6):
Rename ESC -> ESC_PARENS
Introduce scope_exit
Introduce forward_scope_exit
Use forward_scope_exit for scoped_finish_thread_state
Use SCOPE_EXIT in gdbarch-selftest.c
Remove clear_symtab_users_cleanup
Tom Tromey (11):
Replace delete_longjmp_breakpoint_cleanup with a forward_scope_exit
type
Remove remaining cleanup from gdb/breakpoint.c
Remove delete_just_stopped_threads_infrun_breakpoints_cleanup
Remove make_bpstat_clear_actions_cleanup
Remove cleanup_delete_std_terminate_breakpoint
Remove cleanup from linux-nat.c
Remove cleanup from stop_all_threads
Remove remaining cleanup from fetch_inferior_event
Update an obsolete cleanup comment
Update cleanup comment in ui-out.h
Use scope_exit in regcache.c
gdb/breakpoint.c | 27 ++---
gdb/common/forward-scope-exit.h | 123 +++++++++++++++++++++
gdb/common/preprocessor.h | 2 +-
gdb/common/scope-exit.h | 186 ++++++++++++++++++++++++++++++++
gdb/common/valid-expr.h | 18 ++--
gdb/gdbarch-selftests.c | 8 +-
gdb/gdbthread.h | 28 +----
gdb/infcall.c | 13 +--
gdb/infcmd.c | 12 +--
gdb/inferior.h | 4 +-
gdb/infrun.c | 230 ++++++++++++++++++----------------------
gdb/linux-nat.c | 18 +---
gdb/regcache.c | 34 +-----
gdb/symfile.c | 24 ++---
gdb/top.c | 8 +-
gdb/ui-out.h | 8 +-
gdb/utils.c | 17 ---
gdb/utils.h | 1 -
18 files changed, 465 insertions(+), 296 deletions(-)
create mode 100644 gdb/common/forward-scope-exit.h
create mode 100644 gdb/common/scope-exit.h
--
2.14.4
next 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 Pedro Alves [this message]
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 02/17] Introduce scope_exit Pedro Alves
2019-01-23 15:21 ` [PATCH v3 05/17] Use SCOPE_EXIT in gdbarch-selftest.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:21 ` [PATCH v3 15/17] Update an obsolete cleanup comment 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 16/17] Update cleanup comment in ui-out.h 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 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 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 ` [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: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-1-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