From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Tromey To: david@llamedos.org Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] specify arguments to debugee from commandline (second try) Date: Thu, 12 Apr 2001 17:21:00 -0000 Message-id: <87g0fd63n3.fsf@creche.redhat.com> 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> <20010412172201.A4110@llamedos.org> X-SW-Source: 2001-04/msg00130.html >>>>> "David" == David Deephanphongs writes: >> Instead you must type >> gdb foo -- '\ a\ b\ c\ ' David> I can understand that.. I generally don't like programs doing David> things like that automatically for me, though... I always run David> into cases where the program misinterprets what I want it to David> do. David> Actually, though, unless you needed to preserve the correct # David> of spaces, you could just escape the apostrophes. The whole point is to preserve the arguments as-is. I feel like we're not really communicating here. Perhaps we have different goals. My goal is to see this feature implemented in a way that works in a way I know would be useful for me. Your goal seems to be to make the implementation simple (which, btw, is not a criticism on my part. That's often an admirable goal; I just happen to disagree in this instance). Since we're also the only ones talking I'm inferring that nobody else cares about drilling down on this subject any more. My future replies, if any, will be off-list unless somebody asks otherwise. David> Wierd characters being what, precisely? I'm tempted to just David> escape everything that's not a letter or number.. >From a program I wrote a long time ago: /* These are the characters that are special to the shell. We include `^' because SunOS /bin/sh treats it as a synonym for `|'. */ return (actually_encode_string (t, "^|&#<>\"'`$*?[](); \\{}", 0)); I believe this includes sh variants and derivates plus csh. Feel free to use this. I agree this isn't completely perfect. Someone could use a shell where `Z' is a special character. However I disagree that "we can't make it perfect" means "we shouldn't do anything at all". Tom