This is the mail archive of the gdb-patches@sources.redhat.com 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: RFC: Fix to double parsing of filenames in GDB command line


"Frank Ch. Eigler" wrote:
> 
> Fernando Nasser <fnasser@redhat.com> writes:
> 
> : For those who asked, this is the CLI fix to the double parsing of
> : filenames when supplied as command line arguments to gdb.  [...]
> 
> Wow, that's a big patch.  Did you consider a simpler approach, where
> main.c's getopt parsing loop escapes each string that's intended to be
> used as a file / directory name?  It could replace cdarg, dirarg[],
> execarg, symarg with double-size versions that backslash-escape every
> character, in anticipation of the existing catch_command_errors()
> parsing.
> 

That would be a hack.  I would be escaping the escaping characters just
to
remove them again in a code that should not be in there.

The real problem was that gdb core code was using CLI code intended 
to handle commands typed by the user.  The CLI can call libgdb code,
not otherwise.

FYI, we are trying to extricate the CLI from libgdb so it can be used as
such.
It is a long process by we are getting an inch closer every week :-).


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

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