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]
Other format: [Raw text]

report valid values for all errors for enum variables...


Hi, all...

The set command for "var_enum" type gdb variables will give you a helpful error message if you say something like:

(gdb) set osabi
Requires an argument. Valid arguments are auto, default, none, Darwin, Darwin64.


But not if you do:

(gdb) set osabi Blubby
Undefined item: "Blubby"

It would be nice if folks didn't have to remember that osabi is an enum type variable, and they should go back and type "set osabi" with no arguments, etc. The following patch makes it symmetrical, so you get:

(top-gdb) set osabi
Requires an argument. Valid values are auto, default, none, Darwin, Darwin64.
(top-gdb) set osabi foobar
Undefined item: "foobar". Valid values are auto, default, none, Darwin, Darwin64.
(top-gdb) set osabi Darw
Ambiguous item "Darw". Valid values are auto, default, none, Darwin, Darwin64.


Does this seem good?

2003-10-27 Jim Ingham <jingham@apple.com>

* cli/cli-setshow.c (do_setshow_command): For var_enum type variables,
return the list of valid values for all errors, not just no argument.


Attachment: var_enum.patch
Description: Binary data



Jim
--
Jim Ingham                                   jingham@apple.com
Developer Tools
Apple Computer

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