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:

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


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