From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: [commit] Add add_setshow_enum_cmd, use in mips
Date: Sat, 30 Oct 2004 17:11:00 -0000 [thread overview]
Message-ID: <4183BD22.3090905@gnu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 36 bytes --]
Another cleanup.
committed,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 5148 bytes --]
2004-10-30 Andrew Cagney <cagney@gnu.org>
* cli/cli-decode.c (add_setshow_enum_cmd): New function.
* command.h (add_setshow_enum_cmd): Declare.
* mips-tdep.c (_initialize_mips_tdep): Use add_setshow_enum_cmd.
Index: command.h
===================================================================
RCS file: /cvs/src/src/gdb/command.h,v
retrieving revision 1.41
diff -p -u -r1.41 command.h
--- command.h 28 Jul 2004 19:42:00 -0000 1.41
+++ command.h 30 Oct 2004 17:09:25 -0000
@@ -223,6 +223,18 @@ extern struct cmd_list_element *add_set_
const char **var,
char *doc,
struct cmd_list_element **list);
+extern void add_setshow_enum_cmd (char *name,
+ enum command_class class,
+ const char *enumlist[],
+ const char **var,
+ const char *set_doc,
+ const char *show_doc,
+ const char *help_doc,
+ const char *print,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
extern void add_setshow_auto_boolean_cmd (char *name,
enum command_class class,
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.342
diff -p -u -r1.342 mips-tdep.c
--- mips-tdep.c 30 Oct 2004 16:53:22 -0000 1.342
+++ mips-tdep.c 30 Oct 2004 17:09:26 -0000
@@ -6029,31 +6029,31 @@ _initialize_mips_tdep (void)
&showmipscmdlist, "show mips ", 0, &showlist);
/* Allow the user to override the saved register size. */
- deprecated_add_show_from_set (add_set_enum_cmd ("saved-gpreg-size",
- class_obscure,
- size_enums,
- &mips_abi_regsize_string, "\
-Set size of general purpose registers saved on the stack.\n\
+ add_setshow_enum_cmd ("saved-gpreg-size", class_obscure,
+ size_enums, &mips_abi_regsize_string, "\
+Set size of general purpose registers saved on the stack.\n", "\
+Show size of general purpose registers saved on the stack.\n", "\
This option can be set to one of:\n\
32 - Force GDB to treat saved GP registers as 32-bit\n\
64 - Force GDB to treat saved GP registers as 64-bit\n\
auto - Allow GDB to use the target's default setting or autodetect the\n\
saved GP register size from information contained in the executable.\n\
- (default: auto)", &setmipscmdlist), &showmipscmdlist);
+ (default: auto)", "\
+Size of general purpose registers saved on the stack is %s.\n",
+ NULL, NULL, &setmipscmdlist, &showmipscmdlist);
/* Allow the user to override the argument stack size. */
- deprecated_add_show_from_set
- (add_set_enum_cmd ("stack-arg-size",
- class_obscure,
- size_enums,
- &mips_stack_argsize_string, "\
-Set the amount of stack space reserved for each argument.\n\
+ add_setshow_enum_cmd ("stack-arg-size", class_obscure,
+ size_enums, &mips_stack_argsize_string, "\
+Set the amount of stack space reserved for each argument.\n", "\
+Show the amount of stack space reserved for each argument.\n", "\
This option can be set to one of:\n\
32 - Force GDB to allocate 32-bit chunks per argument\n\
64 - Force GDB to allocate 64-bit chunks per argument\n\
auto - Allow GDB to determine the correct setting from the current\n\
- target and executable (default)", &setmipscmdlist),
- &showmipscmdlist);
+ target and executable (default)", "\
+The amount of stack space reserved for each argument is %s.\n",
+ NULL, NULL, &setmipscmdlist, &showmipscmdlist);
/* Allow the user to override the ABI. */
c = add_set_enum_cmd
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.41
diff -p -u -r1.41 cli-decode.c
--- cli/cli-decode.c 30 Jul 2004 17:55:47 -0000 1.41
+++ cli/cli-decode.c 30 Oct 2004 17:09:26 -0000
@@ -402,6 +402,34 @@ add_set_enum_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. ENUMLIST is a list
+ of strings which may follow NAME. VAR is address of the variable
+ which will contain the matching string (from ENUMLIST). */
+
+void
+add_setshow_enum_cmd (char *name,
+ enum command_class class,
+ const char *enumlist[],
+ const char **var,
+ const char *set_doc,
+ const char *show_doc,
+ const char *help_doc,
+ const char *print,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
+{
+ struct cmd_list_element *c;
+ add_setshow_cmd_full (name, class, var_enum, var,
+ set_doc, show_doc, help_doc, print,
+ set_func, show_func,
+ set_list, show_list,
+ &c, NULL);
+ c->enums = enumlist;
+}
+
/* Add an auto-boolean command named NAME to both the set and show
command list lists. CLASS is as in add_cmd. VAR is address of the
variable which will contain the value. DOC is the documentation
next reply other threads:[~2004-10-30 17:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-30 17:11 Andrew Cagney [this message]
2004-10-30 23:24 ` Eli Zaretskii
2004-10-31 23:01 ` Andrew Cagney
2004-11-01 4:47 ` Eli Zaretskii
2004-11-01 5:12 ` Daniel Jacobowitz
2004-11-01 21:15 ` Eli Zaretskii
2004-11-01 22:37 ` Daniel Jacobowitz
2004-11-02 4:51 ` Eli Zaretskii
2004-11-09 1:15 ` Daniel Jacobowitz
2004-11-09 5:00 ` Eli Zaretskii
2004-11-09 15:29 ` Andrew Cagney
2004-11-09 18:42 ` Daniel Jacobowitz
2004-11-10 4:33 ` Eli Zaretskii
2004-11-10 20:55 ` Eli Zaretskii
2004-11-10 21:42 ` Mark Kettenis
2004-11-10 23:31 ` Eli Zaretskii
2004-11-10 23:41 ` Daniel Jacobowitz
2004-11-11 0:00 ` Eli Zaretskii
2004-11-11 5:37 ` Daniel Jacobowitz
2004-11-11 5:59 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4183BD22.3090905@gnu.org \
--to=cagney@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox