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: [PATCH] Don't send queries to the MI interpreter


On 02/10/2017 04:52 PM, Simon Marchi wrote:
> On 2017-02-10 11:48, Pedro Alves wrote:
>> On 02/10/2017 04:36 PM, Simon Marchi wrote:
>>> We have a little problem in Eclipse CDT related to queries being sent on
>>> the MI channel.  GDB sends queries on the MI stream and waits for an
>>> answer (y or n), but since CDT will never answer, it causes a deadlock.
>>>
>>> Note that this is only a problem when using MI as a side-channel
>>> (new-ui) on a dedicated tty.  It doesn't happen if GDB's input/output
>>> streams are pipes, for example.  In that case, the queries are
>>> auto-answered as they should.
>>
>> I think we could have a testsuite test for this, as the 'new-ui'-related
>> testcases create a pty for the secondary MI channel ("separate-mi-tty")?
> 
> Right, I didn't think of making a test, I'll work on it.  I'll try to
> find a query that's easier to trigger than the
> modify-memory-while-replaying one though.

I've run into these queries deep down in the record layer
in the past, and wondered about getting rid of them.

Particularly this one:

	  if (!yquery (_("Do you want to auto delete previous execution "
			"log entries when record/replay buffer becomes "
			"full (record full stop-at-limit)?")))
	    error (_("Process record: stopped by user."));

In order to query, the inferior is already temporarily stopped.
So why not just unconditionally error, and lets user tweak
"set record stop-at-limit" and continue if they want.

In this case, instead of:

	      query (_("Because GDB is in replay mode, changing the "
		       "value of a register will make the execution "
		       "log unusable from this point onward.  "
		       "Change all registers?"));

we'd error here with something like:

 Cannot change the value of a register in replay mode, it would
 make the execution log unusable from this point onward.  See whatnot.

and then if users really want to change memory, they would use
something like a "record discard" or "record commit" or some such
command that discards history leaving the inferior state as it
is right now (not sure there's a command that does that already.)
In scripts and maybe frontends, you'd use the existing
"set record memory-query off", renamed to
"set record allow-memory-write on" or some such.

Thanks,
Pedro Alves


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