From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: <tromey@redhat.com>, <gdb-patches@sourceware.org>
Subject: RE: [RFC] Fix problems related to Mingw/DJGPP file names containing colons
Date: Sat, 13 Aug 2011 20:42:00 -0000 [thread overview]
Message-ID: <005101cc59f9$7e87a790$7b96f6b0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <83ei0pwpol.fsf@gnu.org>
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé : samedi 13 août 2011 12:51
> À : Pierre Muller
> Cc : tromey@redhat.com; gdb-patches@sourceware.org
> Objet : Re: [RFC] Fix problems related to Mingw/DJGPP file names
containing
> colons
>
> > From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
> > Cc: <gdb-patches@sourceware.org>
> > Date: Sat, 13 Aug 2011 12:10:53 +0200
> >
> > > It's ugly and fragile, because the original name could be quoted.
> >
> > + /* Quote filenames containing ':' characters to avoid problems.
*/
> > + if (strchr (filename, ':') != NULL && filename[0] != '"')
> > + sprintf (canonical_name, "\"%s\":%d", filename, sal->line);
> >
> > The second condition already takes care of not
> > quoting already quoted file names.
>
> What if the original name already includes quote characters? That can
> happen on Posix platforms.
You are right, but we are saved by the fact
that colons are not allow on those platforms, isn't it?
(otherwise all lists of directories like in the PATH
environment variable would have a problem...)
But there might be some 'exotic' file systems that allow
both double-quotes and colons as valid characters in their
filenames. In those cases, we would be in trouble...
The main reason for now is that the code is acting directly on
addr_string pchar and should not modify it, otherwise,
we could simply call a more complete quoting function that
would escape internal colons (but of course we should then also
look for and handle those escaped colons...)
I am wondering how spaces within filenames are handled
inside GDB on mingw32...
I just tested... No very well :(
If you have "test space with name.exe" and "test.exe"
executables within the same directory,
GDB seems to load the correct file but runs the false one because
no quoting is added to CreateProcess call....
Pierre
next prev parent reply other threads:[~2011-08-13 20:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <004901cc5907$85006320$8f012960$%muller@ics-cnrs.unistra.fr>
2011-08-12 17:17 ` Eli Zaretskii
2011-08-12 17:25 ` Tom Tromey
2011-08-12 17:47 ` Eli Zaretskii
2011-08-13 10:11 ` Pierre Muller
[not found] ` <003c01cc59a1$49cc1520$dd643f60$%muller@ics-cnrs.unistra.fr>
2011-08-13 10:50 ` Eli Zaretskii
2011-08-13 20:42 ` Pierre Muller [this message]
2011-08-13 20:51 ` DJ Delorie
2011-08-13 21:26 ` Mark Kettenis
2011-08-15 19:29 ` Tom Tromey
[not found] ` <28604.9419818029$1313268187@news.gmane.org>
2011-08-15 19:21 ` Tom Tromey
[not found] <7973.24406817115$1313164244@news.gmane.org>
2011-08-13 1:20 ` asmwarrior
2011-08-12 15:50 Pierre Muller
2011-08-12 17:00 ` Keith Seitz
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='005101cc59f9$7e87a790$7b96f6b0$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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