This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: GDB doesn't show the correct line
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: otto dot wyss at orpatec dot ch, gdb at sources dot redhat dot com
- Date: Sat, 13 Nov 2004 23:40:40 +0200
- Subject: Re: GDB doesn't show the correct line
- References: <40D5E480.4A68163@orpatec.ch> <20040620202929.GA17216@nevyn.them.org> <40D7212F.E68A9D61@orpatec.ch> <20040621175928.GA13407@nevyn.them.org> <40D725AF.FC2AAF3A@orpatec.ch> <20041113201803.GA21320@nevyn.them.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.
> But it's easiest to just fix the source file to be consistent.
Indeed.