text file formats

Daniel Jacobowitz drow@false.org
Thu Apr 6 04:30:00 GMT 2006


On Thu, Apr 06, 2006 at 06:47:42AM +0300, Eli Zaretskii wrote:
> > Well, usually.  In search and reverse search it sometimes uses a
> > similar but slightly simpler algorithm: ignore '\r' if followed by
> > '\n'.  I'm not sure why those are done in binary mode.
> 
> I think it's because GDB counts characters and then lseeks to the
> point it thinks it should display.  If the library's text-mode I/O
> converts \r\n to \n, this seeks will only work reliably in binary
> mode, since most DOS/Windows libraries don't seek to the correct place
> (the only exception from this rule I know of is the DJGPP library).

Oh, thanks.  That's surely it.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list