Re: [PATCH] Make 'symbol-file' not care about the position of command line arguments

Pedro Alves
2017-11-29T22:26:42Z

On 11/29/2017 09:44 PM, Sergio Durigan Junior wrote:
> This is a bug that's been detected while doing the readnever work.
> Currently if you use the 'symbol-file' command you have to be careful
> about the position of each argument you pass on the command line.
> This is because while parsing its arguments, if the command detects a
> filename, it promptly calls 'symbol_file_add_main_1' without waiting
> to see if there are other args on the line. This only affects the
> '-readnow' argument so far, but while implementing the '-readnever'
> command it also affected it.
>

Testcase or it didn't happen? :-)

I hadn't really understood what this was about in the other thread.
(Now I do.) I wonder whether it's really desirable to make this
work. It seems to me that it's much more usual in GDB for option
processing to stop at the first argument that doesn't start
with '-'? I.e., like getopt on most platforms. (The related
add-symbol-file command stands out as quite odd to me for
explicitly wanting '-'-options after non-'-' options...)

Thanks,
Pedro Alves