This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] top.c (set_verbose): Assert showcmd was found.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 7 Mar 2011 14:31:49 +0400
- Subject: Re: [RFA] top.c (set_verbose): Assert showcmd was found.
- References: <4D717CB8.7050606@vmware.com>
> 2011-03-04 Michael Snyder <msnyder@vmware.com>
>
> * top.c (set_verbose): Assert showcmd was found.
No objection.
> 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.
--
Joel