This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 19/23] Replace do_restore_instream_cleanup with scoped_restore
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 5 Jun 2017 14:49:12 +0100
- Subject: Re: [RFA 19/23] Replace do_restore_instream_cleanup with scoped_restore
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C02C2C0587CD
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C02C2C0587CD
- References: <20170503224626.2818-1-tom@tromey.com> <20170503224626.2818-20-tom@tromey.com>
On 05/03/2017 11:46 PM, Tom Tromey wrote:
> This changes the users of do_restore_instream_cleanup to use a
> scoped_restore instead. This patch is broken out because it warrants
> some additional attention: in particular it's unclear to me whether
> current_ui can change in the body of these functions -- but if it can,
> then the cleanup would have modified a different UI's instream member.
>
The only places that change the current UI without restoring it
back are the top level event loop code that reacts to stdin input
and signal handlers (stdin_event_handler / invoke_async_signal_handlers).
Everything else that temporarily switches UI switches back before
returning, using scoped_restore. (This includes nested even loops like
wait_sync_command_done.)
> 2017-05-02 Tom Tromey <tom@tromey.com>
>
> * top.h (do_restore_instream_cleanup): Remove.
> * top.c (do_restore_instream_cleanup): Remove.
> (read_command_file): Use scoped_restore.
> * cli/cli-script.c (execute_user_command): Use scoped_restore.
OK.
Thanks,
Pedro Alves