From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24947 invoked by alias); 6 Apr 2006 03:47:39 -0000 Received: (qmail 24938 invoked by uid 22791); 6 Apr 2006 03:47:39 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Apr 2006 03:47:38 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-213-56.inter.net.il [83.130.213.56]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id DXE90384 (AUTH halo1); Thu, 6 Apr 2006 06:47:34 +0300 (IDT) Date: Thu, 06 Apr 2006 03:47:00 -0000 Message-Id: From: Eli Zaretskii To: gdb@sources.redhat.com In-reply-to: <20060405233938.GA11013@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 5 Apr 2006 19:39:38 -0400) Subject: Re: text file formats Reply-to: Eli Zaretskii References: <20060405223122.GB11610@brasko.net> <20060405233938.GA11013@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00049.txt.bz2 > Date: Wed, 5 Apr 2006 19:39:38 -0400 > From: Daniel Jacobowitz > > GDB does something much simpler. It opens the file in text mode and > lets the C library sort it out. > > 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).