From: Daniel Jacobowitz <drow@false.org>
To: Denis PILAT <denis.pilat@st.com>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
Subject: Re: '\r' only end-of-line
Date: Wed, 11 Oct 2006 13:33:00 -0000 [thread overview]
Message-ID: <20061011133254.GA25164@nevyn.them.org> (raw)
In-Reply-To: <452CC287.4050401@st.com>
On Wed, Oct 11, 2006 at 12:08:07PM +0200, Denis PILAT wrote:
> >I think part of your patch is not needed: the Windows port of GDB
> >should use the LSEEK_NOT_LINEAR branch of the code in
> >find_source_lines, so the code you are patching doesn't need to
> >consider the \r\n case.
> >
> Yes but when you use a linux hosted compiler for reading windows source
> file
> (sorry for that weirdness but we sometime have common source file for
> both OS),
> then this case may happen.
I was just thinking about this the other day...
As a general position, are we willing to support things written /
compiled on other hosts? This includes both line endings and
pathnames. I hope the answer is yes, but I don't know.
At CodeSourcery, as we've said before, we ship a native Windows GDB
and GCC. But for a lot of things we have no way to test the native
Windows GDB - can't use Cygwin's expect to drive it. So I found myself
testing a Cygwin GDB using a customer's Windows-only SDK. And the
debugger got very, very unhappy because there's a filename comparison
in the dwarf reader; one of the arguments came from the compiler as
"\foo\bar.h" and the other came in two pieces "\foo" and "bar.h". GDB
assembled that as "\foo/bar.h" and FILENAME_CMP returned false.
For my local testing I wrote a filename comparison function that
allowed windows slashes. I didn't need to worry about case sensitivity
here, because Windows tools are generally case-preserving unless you
feed them input with strange casing. This was sort of unpleasant, but
useful. And in thinking about it, I think I'd rather have this return
true than false:
FILENAME_CMP ("a\\b", "a/b")
Since almost no one puts backslashes in Unix filenames (they're a
mental health hazard), and having a\\b and a/b is a truly improbable
case.
What do y'all think? Would a gdb_filename_cmp with this behavior be
OK?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-10-11 13:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-09 15:25 [TUI] correctly display windows source files Denis PILAT
2006-10-09 18:01 ` Mark Kettenis
2006-10-09 19:28 ` Eli Zaretskii
2006-10-10 13:23 ` Denis PILAT
2006-10-10 15:08 ` '\r' only end-of-line Denis PILAT
2006-10-10 21:34 ` Eli Zaretskii
2006-10-11 10:08 ` Denis PILAT
2006-10-11 13:33 ` Daniel Jacobowitz [this message]
2006-10-11 13:57 ` Andrew STUBBS
2006-10-11 14:01 ` Daniel Jacobowitz
2006-10-11 14:44 ` Andrew STUBBS
2006-10-11 15:05 ` Daniel Jacobowitz
2006-10-11 17:47 ` Eli Zaretskii
2006-10-11 17:36 ` Eli Zaretskii
2006-10-16 8:51 ` Denis PILAT
2006-10-10 21:24 ` [TUI] correctly display windows source files Eli Zaretskii
2006-10-11 8:02 ` Denis PILAT
2006-10-11 8:39 ` Eli Zaretskii
2006-10-11 11:23 ` Frederic RISS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061011133254.GA25164@nevyn.them.org \
--to=drow@false.org \
--cc=denis.pilat@st.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox