]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
"set print raw frame-arguments" -> "set print raw-frame-arguments"
authorPedro Alves <palves@redhat.com>
Wed, 12 Jun 2019 23:06:53 +0000 (00:06 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 12 Jun 2019 23:18:41 +0000 (00:18 +0100)
A following patch will introduce options for the "backtrace" command,
based on some "set print" and "set backtrace" settings.  There's one
setting in particular that is a bit annoying if we want to describe
the backtrace options and the settings commands using the same data
structures:

  "set print raw frame-arguments"

The problem is that space between "raw" and "frame-arguments".

Calling the option

  "bt -raw frame-arguments"

would be odd.  So I'm calling the option

  "bt -raw-frame-arguments"

instead.

And for consistency, this patch renames the set/show commands to:

 "set print raw-frame-arguments"
 "show print raw-frame-arguments"

I.e., dash instead of space.  The old commands are left in place, but
marked deprecated.

We need to adjust a couple testcases, because the relevant tests use
gdb_test_no_output and the old commands are no longer silent:

  (gdb) set print raw frame-arguments on
  Warning: command 'set print raw frame-arguments' is deprecated.
  Use 'set print raw-frame-arguments'.

gdb/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* NEWS (Changed commands): Mention set/show print raw-frame-arguments,
and that "set/show print raw frame-arguments" are now deprecated.

* cli/cli-decode.c (add_setshow_boolean_cmd): Now returns the
command.
* command.h (add_setshow_boolean_cmd): Return cmd_list_element *.
* stack.c (_initialize_stack): Install "set/show print
raw-frame-arguments", and deprecate "set/show print raw
frame-arguments".
* valprint.c (_initialize_valprint): Deprecate "set/show print
raw".

gdb/doc/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* gdb.texinfo (Print Settings): Document "set/show print
raw-frame-arguments" instead of "set/show print raw
frame-arguments".

gdb/testsuite/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* gdb.guile/scm-frame-args.exp: Use "set print
raw-frame-arguments" instead of "set print raw frame-arguments".
* gdb.python/py-frame-args.exp: Likewise.

gdb/ChangeLog
gdb/NEWS
gdb/cli/cli-decode.c
gdb/command.h
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/stack.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.guile/scm-frame-args.exp
gdb/testsuite/gdb.python/py-frame-args.exp
gdb/valprint.c

index 9e3629abf14e5a2ae4346843ca6ec26a87bd170e..c3453b0510a4621f59434db12e758912cf007531 100644 (file)
@@ -1,3 +1,17 @@
+2019-06-13  Pedro Alves  <palves@redhat.com>
+
+       * NEWS (Changed commands): Mention set/show print raw-frame-arguments,
+       and that "set/show print raw frame-arguments" are now deprecated.
+
+       * cli/cli-decode.c (add_setshow_boolean_cmd): Now returns the
+       command.
+       * command.h (add_setshow_boolean_cmd): Return cmd_list_element *.
+       * stack.c (_initialize_stack): Install "set/show print
+       raw-frame-arguments", and deprecate "set/show print raw
+       frame-arguments".
+       * valprint.c (_initialize_valprint): Deprecate "set/show print
+       raw".
+
 2019-06-13  Pedro Alves  <palves@redhat.com>
 
        * compile/compile.c (struct compile_options): New.
index c4c7bcdf6d9cfcaca2bbd1f5abe97eb646d22f91..9e5c334fd073cc5209e9fb44922e05e062d12227 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -107,6 +107,13 @@ show style
   a style name in their output using its own style, to help
   the user visualize the different styles.
 
+set print raw-frame-arguments
+show print raw-frame-arguments
+
+  These commands replace the similarly-named "set/show print raw
+  frame-arguments" commands (now with a dash instead of a space).  The
+  old commands are now deprecated and may be removed in a future
+  release.
 
 * New MI commands
 
index d739a0d648ac4b1b3650257e7f61dd8c8e4f3555..a6ddd8cc6d848361983f1a7259b1bb94058a2c15 100644 (file)
@@ -585,8 +585,10 @@ const char * const boolean_enums[] = { "on", "off", NULL };
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  CLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
-   value.  SET_DOC and SHOW_DOC are the documentation strings.  */
-void
+   value.  SET_DOC and SHOW_DOC are the documentation strings.
+   Returns the new command element.  */
+
+cmd_list_element *
 add_setshow_boolean_cmd (const char *name, enum command_class theclass, int *var,
                         const char *set_doc, const char *show_doc,
                         const char *help_doc,
@@ -603,6 +605,8 @@ add_setshow_boolean_cmd (const char *name, enum command_class theclass, int *var
                        set_list, show_list,
                        &c, NULL);
   c->enums = boolean_enums;
+
+  return c;
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
index 26e402900892fa5a855bb20ba7ac51ce98de2681..4d52f00de51da1d26f87e970de875e6ced3938f8 100644 (file)
@@ -328,15 +328,16 @@ extern void add_setshow_auto_boolean_cmd (const char *name,
                                          struct cmd_list_element **set_list,
                                          struct cmd_list_element **show_list);
 
-extern void add_setshow_boolean_cmd (const char *name,
-                                    enum command_class theclass,
-                                    int *var,
-                                    const char *set_doc, const char *show_doc,
-                                    const char *help_doc,
-                                    cmd_const_sfunc_ftype *set_func,
-                                    show_value_ftype *show_func,
-                                    struct cmd_list_element **set_list,
-                                    struct cmd_list_element **show_list);
+extern cmd_list_element *
+  add_setshow_boolean_cmd (const char *name,
+                          enum command_class theclass,
+                          int *var,
+                          const char *set_doc, const char *show_doc,
+                          const char *help_doc,
+                          cmd_const_sfunc_ftype *set_func,
+                          show_value_ftype *show_func,
+                          struct cmd_list_element **set_list,
+                          struct cmd_list_element **show_list);
 
 extern void add_setshow_filename_cmd (const char *name,
                                      enum command_class theclass,
index 3615e96245df4f59c1062562f488acc338e2d28d..013ef02ffeddbff9af88d8933d68533a52211a23 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-13  Pedro Alves  <palves@redhat.com>
+
+       * gdb.texinfo (Print Settings): Document "set/show print
+       raw-frame-arguments" instead of "set/show print raw
+       frame-arguments".
+
 2019-06-13  Pedro Alves  <palves@redhat.com>
 
        * gdb.texinfo (Maintenance Commands): Document "maint
index 07dc2463d908d73e7f3eada2ba6d6a0f7911ffa9..2b8758f70f5a38692e5df74e5205c18af2995b01 100644 (file)
@@ -10533,16 +10533,16 @@ thus speeding up the display of each Ada frame.
 @item show print frame-arguments
 Show how the value of arguments should be displayed when printing a frame.
 
-@item set print raw frame-arguments on
+@item set print raw-frame-arguments on
 Print frame arguments in raw, non pretty-printed, form.
 
-@item set print raw frame-arguments off
+@item set print raw-frame-arguments off
 Print frame arguments in pretty-printed form, if there is a pretty-printer
 for the value (@pxref{Pretty Printing}),
 otherwise print the value in raw form.
 This is the default.
 
-@item show print raw frame-arguments
+@item show print raw-frame-arguments
 Show whether to print frame arguments in raw form.
 
 @anchor{set print entry-values}
index 408c795e3857e604f6f7a2aa77e7ca22fc6fc31a..d1b195c84d67bab12a7dfee05484372f4e7c9978 100644 (file)
@@ -3106,14 +3106,26 @@ Usage: func NAME"));
                        _("Show printing of non-scalar frame arguments"),
                        NULL, NULL, NULL, &setprintlist, &showprintlist);
 
-  add_setshow_boolean_cmd ("frame-arguments", no_class,
+  /* Install "set print raw frame-arguments", a deprecated spelling of
+     "set print raw-frame-arguments".  */
+  cmd = add_setshow_boolean_cmd ("frame-arguments", no_class,
+                                &print_raw_frame_arguments, _("\
+Set whether to print frame arguments in raw form."), _("\
+Show whether to print frame arguments in raw form."), _("\
+If set, frame arguments are printed in raw form, bypassing any\n\
+pretty-printers for that value."),
+                                NULL, NULL,
+                                &setprintrawlist, &showprintrawlist);
+  deprecate_cmd (cmd, "set print raw-frame-arguments");
+
+  add_setshow_boolean_cmd ("raw-frame-arguments", no_class,
                           &print_raw_frame_arguments, _("\
 Set whether to print frame arguments in raw form."), _("\
 Show whether to print frame arguments in raw form."), _("\
 If set, frame arguments are printed in raw form, bypassing any\n\
 pretty-printers for that value."),
                           NULL, NULL,
-                          &setprintrawlist, &showprintrawlist);
+                          &setprintlist, &showprintlist);
 
   add_setshow_auto_boolean_cmd ("disassemble-next-line", class_stack,
                                &disassemble_next_line, _("\
index 3684bfad63a7f79329def813cc32c1df5d172bb9..853aeb7c2d2b4c94bbbb45a87395462449956c38 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-13  Pedro Alves  <palves@redhat.com>
+
+       * gdb.guile/scm-frame-args.exp: Use "set print
+       raw-frame-arguments" instead of "set print raw frame-arguments".
+       * gdb.python/py-frame-args.exp: Likewise.
+
 2019-06-13  Pedro Alves  <palves@redhat.com>
 
        * gdb.compile/compile.exp: Adjust expected output to option
index 9a531f08e8dc7a81b5149bfbcc07e93e831ff31d..cae21677eafe5cc3de153b45decebfe4c0224c93 100644 (file)
@@ -38,7 +38,7 @@ gdb_continue_to_breakpoint "break-here" ".* break-here .*"
 
 # Test all combinations with raw off.
 
-gdb_test_no_output "set print raw frame-arguments off"
+gdb_test_no_output "set print raw-frame-arguments off"
 
 gdb_test_no_output "set print frame-arguments none"
 gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
@@ -57,7 +57,7 @@ gdb_test "frame" \
 
 # Test all combinations with raw on.
 
-gdb_test_no_output "set print raw frame-arguments on"
+gdb_test_no_output "set print raw-frame-arguments on"
 
 gdb_test_no_output "set print frame-arguments none"
 gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
index a32473568bb508dfd2bf42b64186fb5536ede723..b921330ddb6623426308e727a53592a4f63c4b96 100644 (file)
@@ -36,7 +36,7 @@ gdb_continue_to_breakpoint "break-here" ".* break-here .*"
 
 # Test all combinations with raw off.
 
-gdb_test_no_output "set print raw frame-arguments off"
+gdb_test_no_output "set print raw-frame-arguments off"
 
 gdb_test_no_output "set print frame-arguments none"
 gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
@@ -53,7 +53,7 @@ gdb_test "frame" \
 
 # Test all combinations with raw on.
 
-gdb_test_no_output "set print raw frame-arguments on"
+gdb_test_no_output "set print raw-frame-arguments on"
 
 gdb_test_no_output "set print frame-arguments none"
 gdb_test "frame" ".*foo \\(x=\[.\]{3}, ss=\[.\]{3}\\).*" \
index e3197e69192a0becbcc5a8d2d6624ea4cc866594..6f9b47da80c1101e60a67993c1b676ad5bb72244 100644 (file)
@@ -3248,6 +3248,8 @@ make_value_print_options_def_group (value_print_options *opts)
 void
 _initialize_valprint (void)
 {
+  cmd_list_element *cmd;
+
   add_prefix_cmd ("print", no_class, set_print,
                  _("Generic command for setting how things print."),
                  &setprintlist, "set print ", 0, &setlist);
@@ -3261,13 +3263,18 @@ _initialize_valprint (void)
   add_alias_cmd ("p", "print", no_class, 1, &showlist);
   add_alias_cmd ("pr", "print", no_class, 1, &showlist);
 
-  add_prefix_cmd ("raw", no_class, set_print_raw,
-                 _("\
+  cmd = add_prefix_cmd ("raw", no_class, set_print_raw,
+                       _("\
 Generic command for setting what things to print in \"raw\" mode."),
-                 &setprintrawlist, "set print raw ", 0, &setprintlist);
-  add_prefix_cmd ("raw", no_class, show_print_raw,
-                 _("Generic command for showing \"print raw\" settings."),
-                 &showprintrawlist, "show print raw ", 0, &showprintlist);
+                       &setprintrawlist, "set print raw ", 0,
+                       &setprintlist);
+  deprecate_cmd (cmd, nullptr);
+
+  cmd = add_prefix_cmd ("raw", no_class, show_print_raw,
+                       _("Generic command for showing \"print raw\" settings."),
+                       &showprintrawlist, "show print raw ", 0,
+                       &showprintlist);
+  deprecate_cmd (cmd, nullptr);
 
   gdb::option::add_setshow_cmds_for_options
     (class_support, &user_print_options, value_print_option_defs,