This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [MI] Wrong error message when parsing invalid --thread-group


>>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:

Marc> (gdb) interpreter-exec mi "28-break-insert --thread-group ix"
Marc> 28^error,msg="Invalid value for the '--thread' option"
Marc> The error msg says "thread" instead of "thread-group".

Thanks for noticing this :)

Marc>         error (_("Invalid value for the '%s' option"),
Marc> -              start[2] == 't' ? "--thread" : "--frame");
Marc> +              start[2] == 'f' ? "--frame" :
Marc> +                start[8] == '-' ? "--thread-group" : "--thread");

I think it would be better to do something using %*s.
This would mean computing a little extra state in the "if" bodies, but
that doesn't seem like a big deal.
I prefer this because it is less obscure and perhaps more future-proof.

Tom


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