This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 11/11] Change captured_mi_execute_command to use 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: Thu, 28 Sep 2017 11:35:15 +0100
- Subject: Re: [RFA 11/11] Change captured_mi_execute_command to use scoped_restore
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BDC9EC5935
- References: <20170912185736.20436-1-tom@tromey.com> <20170912185736.20436-12-tom@tromey.com>
On 09/12/2017 07:57 PM, Tom Tromey wrote:
> Change captured_mi_execute_command to use a scoped_restore, removing a
> cleanup. The old code copied the current token, but I don't believe
> that is necessary.
>
I tried to see if it was safe, and I think it is. I wondered whether
the command to be executed could itself run an MI command with a token,
and whether that'd clobber the original token. Like, e.g. (contrived):
321-interpreter-exec mi "123-thread-info"
we currently get:
123^done,threads=[]
321^done
(gdb)
Looks like that's OK because we create a separate parse object for each
of the commands.
> ChangeLog
> 2017-09-12 Tom Tromey <tom@tromey.com>
>
> * mi/mi-main.c (captured_mi_execute_command): Use scope_restore.
OK.
Thanks,
Pedro Alves