This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [MI] Wrong error message when parsing invalid --thread-group
- From: Tom Tromey <tromey at redhat dot com>
- To: Marc Khouzam <marc dot khouzam at ericsson dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 08 Dec 2010 09:34:48 -0700
- Subject: Re: [MI] Wrong error message when parsing invalid --thread-group
- References: <F7CE05678329534C957159168FA70DEC572E0C0DEF@EUSAACMS0703.eamcs.ericsson.se>
>>>>> "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