From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Deephanphongs To: gdb-patches@sources.redhat.com Subject: Re: [PATCH] specify arguments to debugee from commandline (second try) Date: Thu, 12 Apr 2001 14:13:00 -0000 Message-id: <20010412172201.A4110@llamedos.org> References: <87n19uirbk.fsf@creche.redhat.com> <200104060832.EAA17613@indy.delorie.com> <87vgoi58lr.fsf@creche.redhat.com> <200104061626.MAA01438@indy.delorie.com> <87ofu96gop.fsf@creche.redhat.com> <200104062013.QAA11798@indy.delorie.com> <20010411013553.B2397@llamedos.org> <200104110855.EAA32225@delorie.com> <20010411221401.A3294@llamedos.org> <87g0feyvt5.fsf@creche.redhat.com> X-SW-Source: 2001-04/msg00123.html 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.. > > > 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. > > 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)