This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]