This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] specify arguments to debugee from commandline (second try)
Thus spake Tom Tromey (tromey@redhat.com):
> David> I'm still not convinced that it's appropriate for /gdb/ to do
> David> the escaping - if it's being put into a script, it's much
> David> easier to do it in perl than C..
>
<snip>
>
> Requiring the caller to do the quoting means that scripts will never
> invoke gdb directly. Instead I'll have to write another program to
> wrap gdb and quote the command line for me.
>
I suppose that depends on what you are using to automate GDB...
Frankly, if you are going to automate it, you might as well use a command
file - it's just as easy.
> That seems needless, especially given that requiring interactive users
> to quote the command line will suck.
>
> For instance, you can't type
>
> gdb foo -- ' a b c '
>
> Instead you must type
>
> gdb foo -- '\ a\ b\ c\ '
>
> I can't really call this intuitive or friendly.
I can understand that.. I generally don't like programs doing things
like that automatically for me, though... I always run into cases where
the program misinterprets what I want it to do.
Actually, though, unless you needed to preserve the correct # of spaces,
you could just escape the apostrophes.
<snip>
>
> David> What characters need to be escaped, anyway? It seems like it
> David> much differ from shell to shell.
>
> On Unix it doesn't really differ very much. For most common shells
> you can simply quote all the weird characters with `\'.
>
> Tom
Wierd characters being what, precisely? I'm tempted to just escape
everything that's not a letter or number..
Dave
--
"Why's it called Ming?" said the Archchancellor, on cue.
The Bursar tapped the pot. It went *ming*.
-- Discworld archeology revealed
(Terry Pratchett, Moving Pictures)