This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Use add_setshow_uinteger_cmd
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 18 Feb 2005 14:49:09 -0500
- Subject: [commit] Use add_setshow_uinteger_cmd
FYI,
committed,
Andrew
2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_uinteger_cmd through out.
* printcmd.c, source.c, utils.c, valprint.c: Update.
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.92
diff -p -u -r1.92 printcmd.c
--- printcmd.c 18 Feb 2005 15:25:26 -0000 1.92
+++ printcmd.c 18 Feb 2005 19:49:13 -0000
@@ -2128,12 +2128,13 @@ Same as \"print\" command, except that i
environment, the value is printed in its own window."));
set_cmd_completer (c, location_completer);
- deprecated_add_show_from_set
- (add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,
- (char *) &max_symbolic_offset,
- "Set the largest offset that will be printed in <symbol+1234> form.",
- &setprintlist),
- &showprintlist);
+ add_setshow_uinteger_cmd ("max-symbolic-offset", no_class,
+ &max_symbolic_offset, _("\
+Set the largest offset that will be printed in <symbol+1234> form."), _("\
+Show the largest offset that will be printed in <symbol+1234> form."), NULL,
+ NULL,
+ NULL, /* FIXME: i18n: */
+ &setprintlist, &showprintlist);
add_setshow_boolean_cmd ("symbol-filename", no_class,
&print_symbol_filename, _("\
Set printing of source filename and line number with <symbol>."), _("\
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.65
diff -p -u -r1.65 source.c
--- source.c 15 Feb 2005 15:49:20 -0000 1.65
+++ source.c 18 Feb 2005 19:49:13 -0000
@@ -1633,10 +1633,10 @@ The matching line number is also stored
add_com_alias ("?", "reverse-search", class_files, 0);
}
- deprecated_add_show_from_set
- (add_set_cmd ("listsize", class_support, var_uinteger,
- (char *) &lines_to_list,
- "Set number of source lines gdb will list by default.",
- &setlist),
- &showlist);
+ add_setshow_uinteger_cmd ("listsize", class_support, &lines_to_list, _("\
+Set number of source lines gdb will list by default."), _("\
+Show number of source lines gdb will list by default."), NULL,
+ NULL,
+ NULL, /* FIXME: i18n: */
+ &setlist, &showlist);
}
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.155
diff -p -u -r1.155 utils.c
--- utils.c 18 Feb 2005 15:25:29 -0000 1.155
+++ utils.c 18 Feb 2005 19:49:13 -0000
@@ -2446,16 +2446,19 @@ initialize_utils (void)
{
struct cmd_list_element *c;
- c = add_set_cmd ("width", class_support, var_uinteger, &chars_per_line,
- "Set number of characters gdb thinks are in a line.",
- &setlist);
- deprecated_add_show_from_set (c, &showlist);
- set_cmd_sfunc (c, set_width_command);
-
- c = add_set_cmd ("height", class_support, var_uinteger, &lines_per_page,
- "Set number of lines gdb thinks are in a page.", &setlist);
- deprecated_add_show_from_set (c, &showlist);
- set_cmd_sfunc (c, set_height_command);
+ add_setshow_uinteger_cmd ("width", class_support, &chars_per_line, _("\
+Set number of characters gdb thinks are in a line."), _("\
+Show number of characters gdb thinks are in a line."), NULL,
+ set_width_command,
+ NULL, /* FIXME: i18n: */
+ &setlist, &showlist);
+
+ add_setshow_uinteger_cmd ("height", class_support, &lines_per_page, _("\
+Set number of lines gdb thinks are in a page."), _("\
+Show number of lines gdb thinks are in a page."), NULL,
+ set_height_command,
+ NULL, /* FIXME: i18n: */
+ &setlist, &showlist);
init_page_info ();
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.48
diff -p -u -r1.48 valprint.c
--- valprint.c 18 Feb 2005 15:25:30 -0000 1.48
+++ valprint.c 18 Feb 2005 19:49:13 -0000
@@ -1205,12 +1205,13 @@ _initialize_valprint (void)
add_alias_cmd ("p", "print", no_class, 1, &showlist);
add_alias_cmd ("pr", "print", no_class, 1, &showlist);
- deprecated_add_show_from_set
- (add_set_cmd ("elements", no_class, var_uinteger, (char *) &print_max,
- "Set limit on string chars or array elements to print.\n\
-\"set print elements 0\" causes there to be no limit.",
- &setprintlist),
- &showprintlist);
+ add_setshow_uinteger_cmd ("elements", no_class, &print_max, _("\
+Set limit on string chars or array elements to print."), _("\
+Show limit on string chars or array elements to print."), _("\
+\"set print elements 0\" causes there to be no limit."),
+ NULL,
+ NULL, /* FIXME: i18n: */
+ &setprintlist, &showprintlist);
add_setshow_boolean_cmd ("null-stop", no_class, &stop_print_at_null, _("\
Set printing of char arrays to stop at first null char."), _("\
@@ -1219,13 +1220,14 @@ Show printing of char arrays to stop at
NULL, /* FIXME: i18n: */
&setprintlist, &showprintlist);
- deprecated_add_show_from_set
- (add_set_cmd ("repeats", no_class, var_uinteger,
- (char *) &repeat_count_threshold,
- "Set threshold for repeated print elements.\n\
-\"set print repeats 0\" causes all elements to be individually printed.",
- &setprintlist),
- &showprintlist);
+ add_setshow_uinteger_cmd ("repeats", no_class,
+ &repeat_count_threshold, _("\
+Set threshold for repeated print elements."), _("\
+Show threshold for repeated print elements."), _("\
+\"set print repeats 0\" causes all elements to be individually printed."),
+ NULL,
+ NULL, /* FIXME: i18n: */
+ &setprintlist, &showprintlist);
add_setshow_boolean_cmd ("pretty", class_support, &prettyprint_structs, _("\
Set prettyprinting of structures."), _("\
@@ -1255,19 +1257,19 @@ Show printing of addresses."), NULL,
NULL, /* FIXME: i18n: */
&setprintlist, &showprintlist);
- c = add_set_cmd ("input-radix", class_support, var_uinteger,
- (char *) &input_radix,
- "Set default input radix for entering numbers.",
- &setlist);
- deprecated_add_show_from_set (c, &showlist);
- set_cmd_sfunc (c, set_input_radix);
-
- c = add_set_cmd ("output-radix", class_support, var_uinteger,
- (char *) &output_radix,
- "Set default output radix for printing of values.",
- &setlist);
- deprecated_add_show_from_set (c, &showlist);
- set_cmd_sfunc (c, set_output_radix);
+ add_setshow_uinteger_cmd ("input-radix", class_support, &input_radix, _("\
+Set default input radix for entering numbers."), _("\
+Show default input radix for entering numbers."), NULL,
+ set_input_radix,
+ NULL, /* FIXME: i18n: */
+ &setlist, &showlist);
+
+ add_setshow_uinteger_cmd ("output-radix", class_support, &output_radix, _("\
+Set default output radix for printing of values."), _("\
+Show default output radix for printing of values."), NULL,
+ set_output_radix,
+ NULL, /* FIXME: i18n: */
+ &setlist, &showlist);
/* The "set radix" and "show radix" commands are special in that
they are like normal set and show commands but allow two normally