From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] Assume termios is available, remove support for termio and sgtty
Date: Thu, 02 Nov 2017 19:32:00 -0000 [thread overview]
Message-ID: <87tvyc8oiz.fsf@redhat.com> (raw)
In-Reply-To: <a397b8dc-eaa9-3c90-5119-2d6c08273012@redhat.com> (Pedro Alves's message of "Thu, 2 Nov 2017 19:27:18 +0000")
On Thursday, November 02 2017, Pedro Alves wrote:
> On 11/02/2017 06:54 PM, Sergio Durigan Junior wrote:
>> On Thursday, November 02 2017, Pedro Alves wrote:
>>
>>> This commit garbage collects the termio and sgtty support.
>>>
>>> GDB's terminal handling code still has support for the old termio and
>>> sgtty interfaces in addition to termios. However, I think it's pretty
>>> safe to assume that for a long, long time, Unix-like systems provide
>>> termios. GNU/Linux, Solaris, Cygwin, AIX, DJGPP, macOS and the BSDs
>>> all have had termios.h for many years. Looking around the web, I
>>> found discussions about FreeBSD folks trying to get rid of old sgtty.h
>>> a decade ago:
>>>
>>> https://lists.freebsd.org/pipermail/freebsd-hackers/2007-March/019983.html
>>>
>>> So I think support for termio and sgtty in GDB is just dead code that
>>> is never compiled anywhere and is just getting in the way. For
>>> example, serial_noflush_set_tty_state and the raw<->cooked concerns
>>> mentioned in inflow.c only exist because of sgtty (see
>>> hardwire_noflush_set_tty_state).
>>>
>>> Regtested on GNU/Linux.
>>>
>>> Confirmed that I can still build Solaris, DJGPP and AIX GDB and that
>>> that GDB still includes the termios.h-guarded code. Confirmed
>>
>> "that that"
>
> Eh, that was actually on purpose. It's "I confirmed that $something",
> with "$something == that GDB (the one I built) still includes".
> The first 'that' is the subordinating that, and the second 'that' is
> a demonstrative pronoun. It's not unlike:
> "I think that this thing is blue, and
> I think that that other thing is white".
Ah, OK, it took me a while to understand what you were trying to say
there :-). Sorry about the noise.
>>
>>> mingw-w64 GDB still builds and skips the termios.h-guarded code.
>>
>> Thanks for doing that.
>>
>> You may remember that I also stumbled upon this while doing the
>> startup-with-shell, but I didn't have the necessary background knowledge
>> to do a deep cleanup. It's always nice to see old code being removed.
>
> Well, it was only after banging my head against the terminal
> handling for a couple weeks that I realized that this is
> all dead code. :-P
:-)
>>> --- a/gdb/gdbserver/remote-utils.c
>>> +++ b/gdb/gdbserver/remote-utils.c
>>> @@ -17,7 +17,9 @@
>>> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>>>
>>> #include "server.h"
>>> -#include "gdb_termios.h"
>>> +#if HAVE_TERMIOS_H
>>> +#include <termios.h>
>>> +#endif
>>> #include "target.h"
>>> #include "gdbthread.h"
>>> #include "tdesc.h"
>>> @@ -325,7 +327,7 @@ remote_open (const char *name)
>>> if (remote_desc < 0)
>>> perror_with_name ("Could not open remote device");
>>>
>>> -#ifdef HAVE_TERMIOS
>>> +#if HAVE_TERMIOS_H
>>
>> Why s/#ifdef/#if/? I prefer #ifdef BTW.
>
> Yeah, I used #if here because it's what the file is already
> using for the other headers:
>
> #if HAVE_SYS_IOCTL_H
> #include <sys/ioctl.h>
> #endif
> #if HAVE_SYS_FILE_H
> #include <sys/file.h>
> #endif
>
> etc.
I see. Up to you, but I'd use #ifdef everywhere.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
next prev parent reply other threads:[~2017-11-02 19:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 15:12 [PATCH 0/3] Some terminal handling TCL Pedro Alves
2017-11-02 15:12 ` [PATCH 3/3] Eliminate STOP_SIGNAL, use SIGTSTP directly Pedro Alves
2017-11-02 15:12 ` [PATCH 2/3] Don't set terminal flags twice in a row Pedro Alves
2017-11-02 18:34 ` Sergio Durigan Junior
2017-11-02 15:12 ` [PATCH 1/3] Assume termios is available, remove support for termio and sgtty Pedro Alves
2017-11-02 18:54 ` Sergio Durigan Junior
2017-11-02 19:27 ` Pedro Alves
2017-11-02 19:32 ` Sergio Durigan Junior [this message]
2017-11-06 16:11 ` Pedro Alves
2017-11-06 16:31 ` [pushed] Don't check termio.h and sgtty.h in common/common.m4 either (Re: [PATCH 1/3] Assume termios is available, remove support for termio and sgtty) Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tvyc8oiz.fsf@redhat.com \
--to=sergiodj@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).