From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11119 invoked by alias); 5 Apr 2006 23:39:42 -0000 Received: (qmail 11110 invoked by uid 22791); 5 Apr 2006 23:39:41 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 05 Apr 2006 23:39:40 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FRHb8-0002tN-4e for gdb@sources.redhat.com; Wed, 05 Apr 2006 19:39:38 -0400 Date: Wed, 05 Apr 2006 23:39:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: text file formats Message-ID: <20060405233938.GA11013@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <20060405223122.GB11610@brasko.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060405223122.GB11610@brasko.net> User-Agent: Mutt/1.5.8i 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/msg00041.txt.bz2 On Wed, Apr 05, 2006 at 06:31:22PM -0400, Bob Rossi wrote: > One thing I have determined, is that in order to know what the file > format is, the entire text file needs to be parsed. After that, either > the file format is defined (unix/dos/mac) or it is undefined (mix of > them). > > I would like to make sure that the algorithm CGDB uses to determine > the line number from a file is the same algorithm that GDB uses. Can > anyone point me in the correct direction? 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. -- Daniel Jacobowitz CodeSourcery