This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix help.exp / help set/show complaint
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 30 Jul 2004 13:56:58 -0400
- Subject: [commit] Fix help.exp / help set/show complaint
Hello,
This fixes the help.exp failure; and changes add_setshow so that the
more detailed help message is optional.
committed,
Andrew
2004-07-30 Andrew Cagney <cagney@gnu.org>
* complaints.c (_initialize_complaints): Pass NULL to
add_setshow_zinteger_cmd for help_doc.
* cli/cli-decode.c (add_setshow_cmd_full): Handle a NULL help_doc.
Index: complaints.c
===================================================================
RCS file: /cvs/src/src/gdb/complaints.c,v
retrieving revision 1.16
diff -p -u -r1.16 complaints.c
--- complaints.c 28 Jul 2004 19:42:00 -0000 1.16
+++ complaints.c 30 Jul 2004 17:54:50 -0000
@@ -313,8 +313,7 @@ _initialize_complaints (void)
{
add_setshow_zinteger_cmd ("complaints", class_support, &stop_whining, "\
Set max number of complaints about incorrect symbols.", "\
-Show max number of complaints about incorrect symbols.", "\
-Set to zero to disable incorrect symbol complaints.", "\
+Show max number of complaints about incorrect symbols.", NULL, "\
Max number of complaints about incorrect symbols is %s.",
NULL, NULL,
&setlist, &showlist);
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.40
diff -p -u -r1.40 cli-decode.c
--- cli/cli-decode.c 28 Jul 2004 19:42:01 -0000 1.40
+++ cli/cli-decode.c 30 Jul 2004 17:54:50 -0000
@@ -340,8 +340,19 @@ add_setshow_cmd_full (char *name,
{
struct cmd_list_element *set;
struct cmd_list_element *show;
- char *full_set_doc = xstrprintf ("%s\n%s", set_doc, help_doc);
- char *full_show_doc = xstrprintf ("%s\n%s", show_doc, help_doc);
+ char *full_set_doc;
+ char *full_show_doc;
+
+ if (help_doc != NULL)
+ {
+ full_set_doc = xstrprintf ("%s\n%s", set_doc, help_doc);
+ full_show_doc = xstrprintf ("%s\n%s", show_doc, help_doc);
+ }
+ else
+ {
+ full_set_doc = xstrdup (set_doc);
+ full_show_doc = xstrdup (show_doc);
+ }
set = add_set_or_show_cmd (name, set_cmd, class, var_type, var,
full_set_doc, set_list);
if (set_func != NULL)