This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] specify arguments to debugee from commandline (second try)

>>>>> "David" == David Deephanphongs <> writes:

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..

I won't claim that what I want is best.  I can only claim that my
suggestions support my goals.  I do think my goals are reasonable.

First, my primary use for a feature like this is in scripts and other
places where a program gets launched.  While it might be useful
interactively, I don't think that is the most important use.  This is
why I'm for putting the executable name after the `--': I think it is
more important to design for the script case than for the interactive

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.

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.

Sure, you can use the wrapper program interactively too.  But that
seems weird: if you want to use this feature, you always have to use a
wrapper program.  Why not just build it the convenient way the first

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 `\'.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]