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] Make sure terminal settings are restored before exiting


On Tue, Jul 28, 2015 at 7:53 PM, Pedro Alves <palves@redhat.com> wrote:
> (Small request: I find it helpful when the proposed commit
> log is always present in patch resubmissions, making patches
> self-contained.)

Sure, no problem.

>
>> diff --git a/gdb/top.c b/gdb/top.c
>> index 1e30b1c..6df987a 100644
>> --- a/gdb/top.c
>> +++ b/gdb/top.c
>> @@ -66,6 +66,7 @@
>>  #include "cli-out.h"
>>  #include "tracepoint.h"
>>  #include "inf-loop.h"
>> +#include "tui/tui.h"
>>
>>  extern void initialize_all_files (void);
>>
>> @@ -1494,6 +1495,14 @@ quit_force (char *args, int from_tty)
>>    int exit_code = 0;
>>    struct qt_args qt;
>>
>> +  /* Make sure that the terminal is left in the state we acquired it.  */
>> +  target_terminal_ours ();
>> +#if defined(TUI)
>> +  tui_disable ();
>> +#endif
>> +  if (async_command_editing_p)
>> +    gdb_disable_readline ();
>> +
>
> Can you put these new bits in a separate function, and call it here?
> That'll make it easier to reuse, or play with moving the call elsewhere,
> if needed.  As bonus, if we do the latter, git blame on the function's contents
> will still blame you.  :-)
>
> OK with that change.

Will do.


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