Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* text file formats
@ 2006-04-05 22:31 Bob Rossi
  2006-04-05 23:39 ` Daniel Jacobowitz
  2006-04-06  3:43 ` Eli Zaretskii
  0 siblings, 2 replies; 23+ messages in thread
From: Bob Rossi @ 2006-04-05 22:31 UTC (permalink / raw)
  To: gdb

Hi,

While trying to display to the user a source file, it has become
increasingly obvious to me how complicated such a simple task can be.

Unix formatted text files have "\n" for a newline, dos formatted text files 
have "\r\n" for a newline and mac formatted text files have "\r" for a
newline. In the 3 case's above it is obvious how to determine exactly
which line is which.

However, it is easy to mix these file formats. In this case, any particular 
file can use any combination of "\r", "\r\n" and "\n" for newlines. I'm not 
even sure how to display such a file. I'm guessing that's it's
ambiguous, and i can make a best guess as to what the newline sequence
should be. Is this correct?

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?

Thanks,
Bob Rossi


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2006-04-07  8:18 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-05 22:31 text file formats Bob Rossi
2006-04-05 23:39 ` Daniel Jacobowitz
2006-04-06  0:14   ` Bob Rossi
2006-04-06  1:17     ` Daniel Jacobowitz
2006-04-06  3:27       ` Bob Rossi
2006-04-06  3:35         ` Eli Zaretskii
2006-04-06  5:06           ` Daniel Jacobowitz
2006-04-06 13:03             ` Daniel Jacobowitz
2006-04-06 14:01           ` Bob Rossi
2006-04-06 14:41             ` Daniel Jacobowitz
2006-04-06 19:20               ` Eli Zaretskii
2006-04-06 19:32                 ` Bob Rossi
2006-04-06 23:55                   ` Daniel Jacobowitz
2006-04-07 13:33                     ` Eli Zaretskii
2006-04-06 20:55                 ` Paul Koning
2006-04-07 11:54                   ` Eli Zaretskii
2006-04-06 19:07             ` Eli Zaretskii
2006-04-06  3:47   ` Eli Zaretskii
2006-04-06  4:29     ` Daniel Jacobowitz
2006-04-06  4:30       ` Daniel Jacobowitz
2006-04-06  3:43 ` Eli Zaretskii
2006-04-06 13:35   ` Bob Rossi
2006-04-06 19:01     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox