Re: [PATCH] Call target_terminal_ours in quit_force

Pedro Alves
2015-07-27T18:23:37Z

On 07/27/2015 05:11 PM, Patrick Palka wrote:
> On Mon, Jul 27, 2015 at 12:08 PM, Patrick Palka <patrick@parcs.ath.cx> wrote:
>> We should make sure our terminal settings are in effect before finally
>> quitting GDB. Our terminal settings may not be in effect at this point
>> if we are e.g. quitting due to a SIGTERM.
>
> I should add, "quitting due to a SIGTERM while an inferior an inferior
> is running in the foreground."

Looks OK, though I notice that the settings are broken even if we
we're not debugging anything:

$ stty
speed 38400 baud; line = 0;
iutf8

$ ./gdb
GNU gdb (GDB) 7.10.50.20150726-cvs
(gdb)
*sent SIGTERM from another terminal, gdb exits*
$
$ stty (echo is off)
speed 38400 baud; line = 0;
lnext = <undef>; min = 1; time = 0;
-icrnl iutf8
-icanon -echo
$

Do you also see this?

Can I convince you to add a test? :-) You wouldn't have to write
it from scratch; we already have a test that checks that terminal
settings are preserved:
gdb.base/batch-preserve-term-settings.exp

Thanks,
Pedro Alves