This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: How should we handle filenames containing spaces
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: How should we handle filenames containing spaces
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Thu, 08 Nov 2001 09:47:30 -0500
- CC: Joel Brobecker <brobecker at ACT-Europe dot FR>, fnasser at cygnus dot com, gdb at sources dot redhat dot com, Eli Zaretskii <eliz at is dot elta dot co dot il>
- Organization: Red Hat Canada
- References: <20011102151127.A19674@act-europe.fr> <3BEA3721.1020706@cygnus.com>
Andrew Cagney wrote:
>
> > Hi,
> >
> > I have a modified version of the gdb 4.17 debugger built for VxWorks
> > PPC, and found a flaw in the "load" command. The syntax of this command
> > is
> >
> > load <filename> <server filename>
> >
> > The problem appears when one of the filenames contain some spaces.
> > I am about to go and fix the code, but I am wondering how GDB handles
> > this sort of problem from the user's point of view.
> >
> > I checked a few other commands that are also taking a filename as an
> > argument, but all of them worked because they take only one argument,
> > and therefore do not parse it.
> >
Yes, people created the commands with that limitation in mind.
> > My proposal would be to allow the use of double-quotes. Would that be
> > in line with GDB's way of handling these sorts of issues?
>
I am in favor of double-quotes for handling these cases as it is an
accepted practice on Unix-like systems.
As Andrew mentions below, this may interfere with completion
(although I think completion can be easily fixed to handle file names
that start with double quotes if it is not doing it already).
Eli?
> BTW, Eli's recently being tweeking commands so that some of them know
> that they take a file as an argument (I don't remember the details).
> That way <tab> would file name expand and add in quotes automatically.
>
> As to your question, I suspect GDB is going to have to bite the bullet
> and, for cases like this, drop the hack where GDB could just pick up the
> rest of the line.
>
> Fernando?
>
> Andrew
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9