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 09:50:00PM +0100, Otto Wyss wrote:
> Daniel Jacobowitz wrote:
> > 
> > On Mon, Jun 21, 2004 at 08:15:10PM +0200, Otto Wyss wrote:
> > > Daniel Jacobowitz wrote:
> > > >
> > > Can't this line number problem somehow detected within GDB? Sorry if I
> > > ask this as someone without knowing any internals but IMO this would be
> > > the best solution. My app is now working so I'm not in a hurry but a
> > > good debugger is _essential_  for any development.
> > 
> > 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.  But it's easiest to just fix the source
> > file to be consistent.
> > 
> Of course I check all my sources but I fear it's in some header file
> (most probably wxWidgets). I've never edited any of my sources on the Mac.

No, it's in app.cpp.  Any decent text viewer will show you where -
"less" for instance.  Look for the two #include lines which it doesn't
wrap correctly.

> IMO it would be best if GDB would handle line separators equally as GCC.
> So the behaviour would be consistent an easier understandable by the user.

I think this behavior should be removed from GCC, personally.  But GCC
isn't the only compiler used by GDB; if you play this sort of game with
line endings, you're going to lose on some combination anyway.

-- 
Daniel Jacobowitz


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