Re: [RFA 11/11] Change captured_mi_execute_command to use scoped_restore

Pedro Alves
2017-09-28T10:35:20Z

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