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: [RFA] top.c (set_verbose): Assert showcmd was found.


Joel Brobecker wrote:
2011-03-04 Michael Snyder <msnyder@vmware.com>

* top.c (set_verbose): Assert showcmd was found.

No objection.

Thanks - committing this change.



   showcmd = lookup_cmd_1 (&cmdname, showlist, NULL, 1);
+  gdb_assert (showcmd != NULL
+	      && showcmd != (struct cmd_list_element *) -1);

I wonder if we shouldn't be defining a constant for this, such as AMBIGUOUS_COMMAND_NAME, or somesuch. It would allow us to avoid the ugly cast everytime we check the return value from this routine.


I'll submit that change in a moment.




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