This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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 doesn't show the correct line


On Sat, Nov 13, 2004 at 11:40:40PM +0200, Eli Zaretskii wrote:
> > Date: Sat, 13 Nov 2004 15:18:03 -0500
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb@sources.redhat.com
> > 
> > It's no one's fault, I think.  I tracked down the problem.  You have
> > mixed newline conventions in the file: mostly "\n" as a line separator,
> > but in some places just "\r".  GCC treats this as a line break for
> > legacy reasons (MacOS).  'less' doesn't, which really confused me while
> > trying to debug the problem.  GDB doesn't, either.
> > 
> > Should GDB?  I have no idea.
> 
> As of today, GDB should treat \r\n (a.k.a. CR-LF) line endings
> correctly, but not sole \r.  Perhaps we should amend that code to
> treat sole CRs as well.

I'm not inclined to do this.  If we're already in the presence of mixed
line endings, who's to say we aren't mixing \r, \n, and \r\n?

Hmm.  Eli, how would you feel about complaining about this situation? 
If we read in a file and discover more than one kind of line ending,
we're likely to get confused.

> > But it's easiest to just fix the source file to be consistent.
> 
> Indeed.

Which is why I prefer this solution :-)

-- 
Daniel Jacobowitz


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