This is the mail archive of the cygwin mailing list for the Cygwin 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: gdb pty problem [Was: emacs gud-interface is not updated after gdb command execution (maybe because of incomplete output from gdb)]

On Jun  6 19:12, Takashi Yano wrote:
> Hi Corinna,
> I had looked into this problem, and found the cause.
> 'man termios' says:
> "A read(2) returns at most one line of input" in canonical mode.
> On cygwin 2.5.1, read(2) returns all data in buffer if the buffer
> size specified is large enough. This behaviour is correct in
> noncanonical mode, but is not correct in canonical mode.
> So, I would like to propose a following patch.
> [...]
> While checking this problem, I found a bug of tcflush().
> tcflush() flushes only partial data in the buffer.
> The patch above also fixes this bug.
> A test case attached (pty_readlen.c) is for confirming
> the behaviour of read() and tcflush(). 
> [...]
> Of course, Ken's gdbstc works fine without sleep with this patch,
> as well as original emacs case.

Thanks a lot.  Patch applied.

I uploaded a new snapshot with this patch to
for quick testing.

Just one question:  In future, would you mind terribly to provide
patches in `git format-patch' format (and ideally on the cygwin-patches
mailing list)?  It's easier to handle by lazy maintainers... :)


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature

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