Daniel Jacobowitz wrote: > On Wed, Dec 10, 2008 at 04:31:48PM +0100, Denis PILAT wrote: > >> I made some experiments with parse_to_comma_and_eval, but I think I must >> be sure to understand what you need before going further in my >> implementation, and summarize the situation >> > > parse_to_comma_and_eval is only required for functions that take more > than one expression. This doesn't, so it doesn't apply. > > I see that buildargv is going to be a problem if the last argument is > a free-form expression. I'm not entirely sure what to do about that. > Maybe a GDB-local version that extracts one argument string at a time > and returns that, plus a pointer to the next unparsed bit of the > command line. > > The important thing, in my opinion, is to use the same handling of > quotes and spaces that buildargv does for consistency with other > commands, like "file". > > Maybe we can solve this later and just use buildargv. Compare with > add_symbol_file_command which takes an address. > > Hi Daniel, I'm fine with what you said. I read your comments and produce a new patch that uses gdb_buildargv (as Pedro suggested), inspired from add_symbol_file_command as well. That fixes the problem of last argument that could be a free form. Now all the last arguments, are concatenate into a single one. It avoids as well any possible regression since it behaves exactly the same as the previous gdb, except that it accepts arguments with spaces like file command does. And it consistent with most of commands that accept spaces in their arguments. I also removed lot of dead code in cli/cli-dump.c and fopen_with_cleanup is now used only locally, so removed from cli-dump.h. Dump restore and append commands are impacted by this patch. As the "binary" option was missing from the help message, I add it as well into help.exp in a separate patch. Patch are attached. Ok for commit ? Denis