aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-09-30 16:16:16 +0000
committerAndrew Cagney <cagney@redhat.com>2001-09-30 16:16:16 +0000
commitf3796e26572d9c543bde60af67a4c43311098526 (patch)
tree7614c52cf58fde9f058585b98375aaefc38a9e73 /gdb/cli
parent528a2d4a4bf4b27fe865db5c2fd19864c483b438 (diff)
downloadgdb-f3796e26572d9c543bde60af67a4c43311098526.zip
gdb-f3796e26572d9c543bde60af67a4c43311098526.tar.gz
gdb-f3796e26572d9c543bde60af67a4c43311098526.tar.bz2
* cli/cli-decode.c (add_set_boolean_cmd): Define.
* cli/cli-decode.h (add_set_boolean_cmd): Declare. * command.h (add_set_boolean_cmd): Ditto. * remote.c (_initialize_remote): Use add_set_boolean_cmd for "set remotebreak"
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-decode.c19
-rw-r--r--gdb/cli/cli-decode.h6
2 files changed, 25 insertions, 0 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index d2fea6e..bb9eb94 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -291,6 +291,25 @@ add_set_auto_boolean_cmd (char *name,
return c;
}
+/* Add element named NAME to command list LIST (the list for set
+ or some sublist thereof).
+ CLASS is as in add_cmd.
+ VAR is address of the variable which will contain the value.
+ DOC is the documentation string. */
+struct cmd_list_element *
+add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ static const char *boolean_enums[] = { "on", "off", NULL };
+ struct cmd_list_element *c;
+ c = add_set_cmd (name, class, var_boolean, var, doc, list);
+ c->enums = boolean_enums;
+ return c;
+}
+
/* Where SETCMD has already been added, add the corresponding show
command to LIST and return a pointer to the added command (not
necessarily the head of LIST). */
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index 79f39d2..d35685c 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -329,6 +329,12 @@ extern struct cmd_list_element *add_set_auto_boolean_cmd (char *name,
char *doc,
struct cmd_list_element **list);
+extern struct cmd_list_element *add_set_boolean_cmd (char *name,
+ enum command_class class,
+ int *var,
+ char *doc,
+ struct cmd_list_element **list);
+
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
**);