This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: text file formats
On Wed, Apr 05, 2006 at 08:14:55PM -0400, Bob Rossi wrote:
> OK, so now I'm confused. If the user looks at the text file through my
> viewer, and set's a breakpoint at line 100, how can I be sure it's the
> same 100 that GDB will actually set a breakpoint at? Obviously this
> works for unix and dos file formats. But from the algorithm you stated
> above, it doesn't look like GDB will work with mac file formats.
>
> I mean, the C library on unix won't be able to read a file that was
> created on a mac (at least with the mac file format).
The manual algorithm is only used while searching. It will work on any
file format recognized by the C library.
The C library is generally used. If you want to handle a text file,
including a source file, it had better be in the native format. Full
stop.
I don't think any recent version of MacOS uses the old \r format,
anyway? I thought OSX had switched to the Unix convention.
> Is GDB responsible for mapping the file line numbers to the actual lines?
> or is this the responsibility of GCC via the debug info? For instance,
> if foo () is defined at line 100 according to gcc and 101 according to
> GDB, does CGDB have to think foo () is at line 100 or 101?
I have no idea what you mean. GDB gets line numbers from debug info,
of course; where else would it get them?
--
Daniel Jacobowitz
CodeSourcery