Accept "set foo unlimited" in integer/uinteger/zuinteger_unlimited commands.
authorPedro Alves <palves@redhat.com>
Wed, 10 Apr 2013 15:11:12 +0000 (15:11 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 10 Apr 2013 15:11:12 +0000 (15:11 +0000)
Currently, several commands take "0" or "-1" to mean "unlimited".

"show" knows when to print "unlimited":

 (gdb) show height
 Number of lines gdb thinks are in a page is 45.
 (gdb) set height 0
 (gdb) show height
 Number of lines gdb thinks are in a page is unlimited.

However, the user can't herself specify "unlimited" directly:

 (gdb) set height unlimited
 No symbol table is loaded.  Use the "file" command.
 (gdb)

This patch addresses that, by adjusting the set handler for all
integer/uinteger/zuinteger_unlimited commands to accept literal
"unlimited".  It also installs a completer.  Presently, we complete on
symbols by default, and at
<http://sourceware.org/ml/gdb-patches/2013-03/msg00864.html> I've
shown a WIP prototype that tried to keep that half working in these
commands.  In the end, it turned out to be more complicated than
justifiable, IMO.  It's super rare to want to pass the value of a
variable/symbol in the program to a GDB set/show knob.  That'll still
work, it's just that we won't assist with completion anymore.  This
patch just sticks with the simple, and completes on "unlimited", and
nothing else.  This simplification means that

  "set he<tab><tab>"

is all it takes to get to:

  "set height unlimited"

The patch then goes through all integer/uinteger/zuinteger_unlimited
commands in the tree, and updates both the online help and the manual
to mention that "unlimited" is accepted in addition to 0/-1.  In the
cases where the command had no online help text at all, this adds it.
I've tried to make the texts read in a way that "unlimited" is
suggested before "0" or "-1" is.

Tested on x86_64 Fedora 17.

gdb/
2013-04-10  Pedro Alves  <palves@redhat.com>

* cli/cli-decode.c (integer_unlimited_completer): New function.
(add_setshow_integer_cmd, add_setshow_uinteger_cmd)
(add_setshow_zuinteger_unlimited_cmd): Install the "unlimited"
completer.
* cli/cli-setshow.c: Include "cli/cli-utils.h".
(is_unlimited_literal): New function.
(do_set_command): Handle literal "unlimited" arguments.
* frame.c (_initialize_frame) <set backtrace limit>: Document
"unlimited".
* printcmd.c (_initialize_printcmd) <set print
max-symbolic-offset>: Add help text.
* record-full.c (_initialize_record_full) <set record full
insn-number-max>: Likewise.
* record.c (_initialize_record) <set record
instruction-history-size, set record function-call-history-size>:
Add help text.
* ser-tcp.c (_initialize_ser_tcp) <set tcp connect-timeout>: Add
help text.
* tracepoint.c (_initialize_tracepoint) <set trace-buffer-size>:
Likewise.
* source.c (_initialize_source) <set listsize>: Add help text.
* utils.c (initialize_utils) <set height, set width>: Likewise.
<set pagination>: Mention "set height unlimited".
* valprint.c (_initialize_valprint) <set print elements, set print
repeats>: Document "unlimited".

gdb/doc/
2013-04-10  Pedro Alves  <palves@redhat.com>

* gdb.texinfo (Process Record and Replay): Document that "set
record full insn-number-max", "set record
instruction-history-size" and "set record
function-call-history-size" accept "unlimited".
(Backtrace): Document that "set backtrace limit" accepts
"unlimited".
(List): Document that "set listsize" accepts "unlimited".
(Print Settings)" Document that "set print max-symbolic-offset",
"set print elements" and "set print repeats" accept "unlimited".
(Starting and Stopping Trace Experiments): Document that "set
trace-buffer-size" accepts "unlimited".
(Remote Configuration): Document that "set tcp connect-timeout"
accepts "unlimited".
(Command History): Document that "set history size" accepts
"unlimited".
(Screen Size): Document that "set height" and "set width" accepts
"unlimited".  Adjust "set pagination"'s description to suggest
"set height unlimited" instead of "set height 0".

gdb/testsuite/
2013-04-10  Pedro Alves  <palves@redhat.com>

* gdb.base/completion.exp: Test "set height", "set listsize" and
"set trace-buffer-size" completion.
* gdb.base/setshow.exp: Test "set height unlimited".
* gdb.trace/trace-buffer-size.exp: Test "set trace-buffer-size
unlimited".

19 files changed:
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/cli/cli-setshow.c
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/frame.c
gdb/printcmd.c
gdb/record-full.c
gdb/record.c
gdb/ser-tcp.c
gdb/source.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/completion.exp
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.trace/trace-buffer-size.exp
gdb/top.c
gdb/tracepoint.c
gdb/utils.c
gdb/valprint.c

index bd222cced1f041a7b430a08d05e7e27d40451643..89b787b57f325ab02043578465c0d613bbe6341b 100644 (file)
@@ -1,3 +1,31 @@
+2013-04-10  Pedro Alves  <palves@redhat.com>
+
+       * cli/cli-decode.c (integer_unlimited_completer): New function.
+       (add_setshow_integer_cmd, add_setshow_uinteger_cmd)
+       (add_setshow_zuinteger_unlimited_cmd): Install the "unlimited"
+       completer.
+       * cli/cli-setshow.c: Include "cli/cli-utils.h".
+       (is_unlimited_literal): New function.
+       (do_set_command): Handle literal "unlimited" arguments.
+       * frame.c (_initialize_frame) <set backtrace limit>: Document
+       "unlimited".
+       * printcmd.c (_initialize_printcmd) <set print
+       max-symbolic-offset>: Add help text.
+       * record-full.c (_initialize_record_full) <set record full
+       insn-number-max>: Likewise.
+       * record.c (_initialize_record) <set record
+       instruction-history-size, set record function-call-history-size>:
+       Add help text.
+       * ser-tcp.c (_initialize_ser_tcp) <set tcp connect-timeout>: Add
+       help text.
+       * tracepoint.c (_initialize_tracepoint) <set trace-buffer-size>:
+       Likewise.
+       * source.c (_initialize_source) <set listsize>: Add help text.
+       * utils.c (initialize_utils) <set height, set width>: Likewise.
+       <set pagination>: Mention "set height unlimited".
+       * valprint.c (_initialize_valprint) <set print elements, set print
+       repeats>: Document "unlimited".
+
 2013-04-10  Pedro Alves  <palves@redhat.com>
 
        * cli/cli-cmds.c (quit_command): Call query_if_trace_running
index 61a7b5aa0a7895f87a59a9b3aaa816bc1ebaa079..9bc14b5dbfda7b5cc7005a2ea268b2e869fcf75a 100644 (file)
@@ -638,6 +638,22 @@ add_setshow_optional_filename_cmd (const char *name, enum command_class class,
 
 }
 
+/* Completes on literal "unlimited".  Used by integer commands that
+   support a special "unlimited" value.  */
+
+static VEC (char_ptr) *
+integer_unlimited_completer (struct cmd_list_element *ignore,
+                            const char *text, const char *word)
+{
+  static const char * const keywords[] =
+    {
+      "unlimited",
+      NULL,
+    };
+
+  return complete_on_enum (keywords, text, word);
+}
+
 /* 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
@@ -653,11 +669,15 @@ add_setshow_integer_cmd (const char *name, enum command_class class,
                         struct cmd_list_element **set_list,
                         struct cmd_list_element **show_list)
 {
+  struct cmd_list_element *set;
+
   add_setshow_cmd_full (name, class, var_integer, var,
                        set_doc, show_doc, help_doc,
                        set_func, show_func,
                        set_list, show_list,
-                       NULL, NULL);
+                       &set, NULL);
+
+  set_cmd_completer (set, integer_unlimited_completer);
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
@@ -674,11 +694,15 @@ add_setshow_uinteger_cmd (const char *name, enum command_class class,
                          struct cmd_list_element **set_list,
                          struct cmd_list_element **show_list)
 {
+  struct cmd_list_element *set;
+
   add_setshow_cmd_full (name, class, var_uinteger, var,
                        set_doc, show_doc, help_doc,
                        set_func, show_func,
                        set_list, show_list,
-                       NULL, NULL);
+                       &set, NULL);
+
+  set_cmd_completer (set, integer_unlimited_completer);
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
@@ -714,11 +738,15 @@ add_setshow_zuinteger_unlimited_cmd (const char *name,
                                     struct cmd_list_element **set_list,
                                     struct cmd_list_element **show_list)
 {
+  struct cmd_list_element *set;
+
   add_setshow_cmd_full (name, class, var_zuinteger_unlimited, var,
                        set_doc, show_doc, help_doc,
                        set_func, show_func,
                        set_list, show_list,
-                       NULL, NULL);
+                       &set, NULL);
+
+  set_cmd_completer (set, integer_unlimited_completer);
 }
 
 /* Add element named NAME to both the set and show command LISTs (the
index f6123699e52987432edadd87efde6b787df63d93..3e41fd4deac3d22c68495df7a6b3c6f07121ed75 100644 (file)
@@ -28,6 +28,7 @@
 #include "cli/cli-decode.h"
 #include "cli/cli-cmds.h"
 #include "cli/cli-setshow.h"
+#include "cli/cli-utils.h"
 
 /* Return true if the change of command parameter should be notified.  */
 
@@ -127,6 +128,20 @@ deprecated_show_value_hack (struct ui_file *ignore_file,
     }
 }
 
+/* Returns true if ARG is "unlimited".  */
+
+static int
+is_unlimited_literal (const char *arg)
+{
+  size_t len = sizeof ("unlimited") - 1;
+
+  arg = skip_spaces_const (arg);
+
+  return (strncmp (arg, "unlimited", len) == 0
+         && (isspace (arg[len]) || arg[len] == '\0'));
+}
+
+
 /* Do a "set" command.  ARG is NULL if no argument, or the
    text of the argument, and FROM_TTY is nonzero if this command is
    being entered directly by the user (i.e. these are just like any
@@ -273,8 +288,17 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c)
        LONGEST val;
 
        if (arg == NULL)
-         error_no_arg (_("integer to set it to."));
-       val = parse_and_eval_long (arg);
+         {
+           if (c->var_type == var_uinteger)
+             error_no_arg (_("integer to set it to, or \"unlimited\"."));
+           else
+             error_no_arg (_("integer to set it to."));
+         }
+
+       if (c->var_type == var_uinteger && is_unlimited_literal (arg))
+         val = 0;
+       else
+         val = parse_and_eval_long (arg);
 
        if (c->var_type == var_uinteger && val == 0)
          val = UINT_MAX;
@@ -300,8 +324,17 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c)
        LONGEST val;
 
        if (arg == NULL)
-         error_no_arg (_("integer to set it to."));
-       val = parse_and_eval_long (arg);
+         {
+           if (c->var_type == var_integer)
+             error_no_arg (_("integer to set it to, or \"unlimited\"."));
+           else
+             error_no_arg (_("integer to set it to."));
+         }
+
+       if (c->var_type == var_integer && is_unlimited_literal (arg))
+         val = 0;
+       else
+         val = parse_and_eval_long (arg);
 
        if (val == 0 && c->var_type == var_integer)
          val = INT_MAX;
@@ -396,8 +429,12 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c)
        LONGEST val;
 
        if (arg == NULL)
-         error_no_arg (_("integer to set it to."));
-       val = parse_and_eval_long (arg);
+         error_no_arg (_("integer to set it to, or \"unlimited\"."));
+
+       if (is_unlimited_literal (arg))
+         val = -1;
+       else
+         val = parse_and_eval_long (arg);
 
        if (val > INT_MAX)
          error (_("integer %s out of range"), plongest (val));
index 9e3a956d42d952cc37b62799bf99cab961381c95..e55b219ea059f81ea56e11cdad8606a4e496ce5e 100644 (file)
@@ -1,3 +1,24 @@
+2013-04-10  Pedro Alves  <palves@redhat.com>
+
+       * gdb.texinfo (Process Record and Replay): Document that "set
+       record full insn-number-max", "set record
+       instruction-history-size" and "set record
+       function-call-history-size" accept "unlimited".
+       (Backtrace): Document that "set backtrace limit" accepts
+       "unlimited".
+       (List): Document that "set listsize" accepts "unlimited".
+       (Print Settings)" Document that "set print max-symbolic-offset",
+       "set print elements" and "set print repeats" accept "unlimited".
+       (Starting and Stopping Trace Experiments): Document that "set
+       trace-buffer-size" accepts "unlimited".
+       (Remote Configuration): Document that "set tcp connect-timeout"
+       accepts "unlimited".
+       (Command History): Document that "set history size" accepts
+       "unlimited".
+       (Screen Size): Document that "set height" and "set width" accepts
+       "unlimited".  Adjust "set pagination"'s description to suggest
+       "set height unlimited" instead of "set height 0".
+
 2013-04-10  Yao Qi  <yao@codesourcery.com>
 
        * gdb.texinfo (Trace Files): Add "target ctf".
index 6974b5c79db8cc50a5cab0db60d0c35273f03461..15a889491f2c223fdd6d4947285eda7776a12ae1 100644 (file)
@@ -6207,6 +6207,7 @@ File must have been created with @code{record save}.
 
 @kindex set record full
 @item set record full insn-number-max @var{limit}
+@itemx set record full insn-number-max unlimited
 Set the limit of instructions to be recorded for the @code{full}
 recording method.  Default value is 200000.
 
@@ -6219,9 +6220,9 @@ instruction to keep the number of recorded instructions at the limit.
 lets you control what happens when the limit is reached, by means of
 the @code{stop-at-limit} option, described below.)
 
-If @var{limit} is zero, @value{GDBN} will never delete recorded
-instructions from the execution log.  The number of recorded
-instructions is unlimited in this case.
+If @var{limit} is @code{unlimited} or zero, @value{GDBN} will never
+delete recorded instructions from the execution log.  The number of
+recorded instructions is limited only by the available memory.
 
 @kindex show record full
 @item show record full insn-number-max
@@ -6333,9 +6334,11 @@ number @var{end} is not included.
 This command may not be available for all recording methods.
 
 @kindex set record
-@item set record instruction-history-size
+@item set record instruction-history-size @var{size}
+@itemx set record instruction-history-size unlimited
 Define how many instructions to disassemble in the @code{record
 instruction-history} command.  The default value is 10.
+A @var{size} of @code{unlimited} means unlimited instructions.
 
 @kindex show record
 @item show record instruction-history-size
@@ -6399,9 +6402,11 @@ included.
 
 This command may not be available for all recording methods.
 
-@item set record function-call-history-size
+@item set record function-call-history-size @var{size}
+@itemx set record function-call-history-size unlimited
 Define how many lines to print in the
 @code{record function-call-history} command.  The default value is 10.
+A size of @code{unlimited} means unlimited lines.
 
 @item show record function-call-history-size
 Show how many lines to print in the
@@ -6678,9 +6683,10 @@ Display the current internal entry point backtrace policy.
 
 @item set backtrace limit @var{n}
 @itemx set backtrace limit 0
+@itemx set backtrace limit unlimited
 @cindex backtrace limit
-Limit the backtrace to @var{n} levels.  A value of zero means
-unlimited.
+Limit the backtrace to @var{n} levels.  A value of @code{unlimited}
+or zero means unlimited levels.
 
 @item show backtrace limit
 Display the current limit on backtrace levels.
@@ -6919,9 +6925,10 @@ the @code{list} command.  You can change this using @code{set listsize}:
 @table @code
 @kindex set listsize
 @item set listsize @var{count}
+@itemx set listsize unlimited
 Make the @code{list} command display @var{count} source lines (unless
 the @code{list} argument explicitly specifies some other number).
-Setting @var{count} to 0 means there's no limit.
+Setting @var{count} to @code{unlimited} or 0 means there's no limit.
 
 @kindex show listsize
 @item show listsize
@@ -8652,11 +8659,13 @@ printed is reasonably close to the closest earlier symbol:
 
 @table @code
 @item set print max-symbolic-offset @var{max-offset}
+@itemx set print max-symbolic-offset unlimited
 @cindex maximum value for offset of closest symbol
 Tell @value{GDBN} to only display the symbolic form of an address if the
 offset between the closest earlier symbol and the address is less than
-@var{max-offset}.  The default is 0, which tells @value{GDBN}
-to always print the symbolic form of an address if any symbol precedes it.
+@var{max-offset}.  The default is @code{unlimited}, which tells @value{GDBN}
+to always print the symbolic form of an address if any symbol precedes
+it.  Zero is equivalent to @code{unlimited}.
 
 @item show print max-symbolic-offset
 Ask how large the maximum offset is that @value{GDBN} prints in a
@@ -8733,6 +8742,7 @@ Show whether the index of each element is printed when displaying
 arrays.
 
 @item set print elements @var{number-of-elements}
+@itemx set print elements unlimited
 @cindex number of array elements to print
 @cindex limit on number of printed array elements
 Set a limit on how many elements of an array @value{GDBN} will print.
@@ -8740,7 +8750,8 @@ If @value{GDBN} is printing a large array, it stops printing after it has
 printed the number of elements set by the @code{set print elements} command.
 This limit also applies to the display of strings.
 When @value{GDBN} starts, this limit is set to 200.
-Setting  @var{number-of-elements} to zero means that the printing is unlimited.
+Setting @var{number-of-elements} to @code{unlimited} or zero means
+that the number of elements to print is unlimited.
 
 @item show print elements
 Display the number of elements of a large array that @value{GDBN} will print.
@@ -8910,15 +8921,17 @@ entry resolution see @ref{set debug entry-values}.
 Show the method being used for printing of frame argument values at function
 entry.
 
-@item set print repeats
+@item set print repeats @var{number-of-repeats}
+@itemx set print repeats unlimited
 @cindex repeated array elements
 Set the threshold for suppressing display of repeated array
 elements.  When the number of consecutive identical elements of an
 array exceeds the threshold, @value{GDBN} prints the string
 @code{"<repeats @var{n} times>"}, where @var{n} is the number of
 identical repetitions, instead of displaying the identical elements
-themselves.  Setting the threshold to zero will cause all elements to
-be individually printed.  The default threshold is 10.
+themselves.  Setting the threshold to @code{unlimited} or zero will
+cause all elements to be individually printed.  The default threshold
+is 10.
 
 @item show print repeats
 Display the current threshold for printing repeated identical
@@ -11880,12 +11893,13 @@ for instance if you are looking at frames from a trace file.
 
 @table @code
 @item set trace-buffer-size @var{n}
+@itemx set trace-buffer-size unlimited
 @kindex set trace-buffer-size
 Request that the target use a trace buffer of @var{n} bytes.  Not all
 targets will honor the request; they may have a compiled-in size for
 the trace buffer, or some other limitation.  Set to a value of
-@code{-1} to let the target use whatever size it likes.  This is also
-the default.
+@code{unlimited} or @code{-1} to let the target use whatever size it
+likes.  This is also the default.
 
 @item show trace-buffer-size
 @kindex show trace-buffer-size
@@ -18286,13 +18300,16 @@ Do not auto-retry failed TCP connections.
 Show the current auto-retry setting.
 
 @item set tcp connect-timeout @var{seconds}
+@itemx set tcp connect-timeout unlimited
 @cindex connection timeout, for remote TCP target
 @cindex timeout, for remote target connection
 Set the timeout for establishing a TCP connection to the remote target to
 @var{seconds}.  The timeout affects both polling to retry failed connections 
 (enabled by @code{set tcp auto-retry on}) and waiting for connections
 that are merely slow to complete, and represents an approximate cumulative
-value.
+value.  If @var{seconds} is @code{unlimited}, there is no timeout and
+@value{GDBN} will keep attempting to establish a connection forever,
+unless interrupted with @kbd{Ctrl-c}.  The default is 15 seconds.
 
 @item show tcp connect-timeout
 Show the current connection timeout setting.
@@ -21256,9 +21273,12 @@ Stop recording command history in a file.
 @kindex set history size
 @cindex @env{HISTSIZE}, environment variable
 @item set history size @var{size}
+@itemx set history size unlimited
 Set the number of commands which @value{GDBN} keeps in its history list.
 This defaults to the value of the environment variable
-@code{HISTSIZE}, or to 256 if this variable is not set.
+@code{HISTSIZE}, or to 256 if this variable is not set.  If @var{size}
+is @code{unlimited}, the number of commands @value{GDBN} keeps in the
+history list is unlimited.
 @end table
 
 History expansion assigns special meaning to the character @kbd{!}.
@@ -21343,25 +21363,28 @@ width} commands:
 @kindex show width
 @kindex show height
 @item set height @var{lpp}
+@itemx set height unlimited
 @itemx show height
 @itemx set width @var{cpl}
+@itemx set width unlimited
 @itemx show width
 These @code{set} commands specify a screen height of @var{lpp} lines and
 a screen width of @var{cpl} characters.  The associated @code{show}
 commands display the current settings.
 
-If you specify a height of zero lines, @value{GDBN} does not pause during
-output no matter how long the output is.  This is useful if output is to a
-file or to an editor buffer.
+If you specify a height of either @code{unlimited} or zero lines,
+@value{GDBN} does not pause during output no matter how long the
+output is.  This is useful if output is to a file or to an editor
+buffer.
 
-Likewise, you can specify @samp{set width 0} to prevent @value{GDBN}
-from wrapping its output.
+Likewise, you can specify @samp{set width unlimited} or @samp{set
+width 0} to prevent @value{GDBN} from wrapping its output.
 
 @item set pagination on
 @itemx set pagination off
 @kindex set pagination
 Turn the output pagination on or off; the default is on.  Turning
-pagination off is the alternative to @code{set height 0}.  Note that
+pagination off is the alternative to @code{set height unlimited}.  Note that
 running @value{GDBN} with the @option{--batch} option (@pxref{Mode
 Options, -batch}) also automatically disables pagination.
 
index a4d18bbadebbd06e46b4cd543ed75ca07a66b64f..8d4e2c805404ddcd3e8230a388fefd2370430fc4 100644 (file)
@@ -2495,7 +2495,7 @@ the rest of the stack trace."),
 Set an upper bound on the number of backtrace levels."), _("\
 Show the upper bound on the number of backtrace levels."), _("\
 No more than the specified number of frames can be displayed or examined.\n\
-Zero is unlimited."),
+Literal \"unlimited\" or zero means no limit."),
                            NULL,
                            show_backtrace_limit,
                            &set_backtrace_cmdlist,
index 4f8c9d46a9a9e1ed2e07bd0e34a10d9748ad9800..2cc33d04dfed94982afe2b3be9e83412e1b3c270 100644 (file)
@@ -2615,7 +2615,12 @@ but no count or size letter (see \"x\" command)."));
   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,
+Show the largest offset that will be printed in <symbol+1234> form."), _("\
+Tell GDB to only display the symbolic form of an address if the\n\
+offset between the closest earlier symbol and the address is less than\n\
+the specified maximum offset.  The default is \"unlimited\", which tells GDB\n\
+to always print the symbolic form of an address if any symbol precedes\n\
+it.  Zero is equivalent to \"unlimited\"."),
                            NULL,
                            show_max_symbolic_offset,
                            &setprintlist, &showprintlist);
index 2ff7decb5c2be3c1898db1143845e3b872f9e2d5..03d287d0f03d849b74f197046bb756046385de2d 100644 (file)
@@ -2971,7 +2971,8 @@ delete the oldest recorded instruction to make room for each new one."),
                            _("Set record/replay buffer limit."),
                            _("Show record/replay buffer limit."), _("\
 Set the maximum number of instructions to be stored in the\n\
-record/replay buffer.  Zero means unlimited.  Default is 200000."),
+record/replay buffer.  A value of either \"unlimited\" or zero means no\n\
+limit.  Default is 200000."),
                            set_record_full_insn_max_num,
                            NULL, &set_record_full_cmdlist,
                            &show_record_full_cmdlist);
index 2736a1eb17b7c1608a95275ea54b924c7aba601e..0a7f0a1aa5031d08f1936a8becd97f14ddf559cc 100644 (file)
@@ -701,16 +701,16 @@ _initialize_record (void)
   add_setshow_uinteger_cmd ("instruction-history-size", no_class,
                            &record_insn_history_size_setshow_var, _("\
 Set number of instructions to print in \"record instruction-history\"."), _("\
-Show number of instructions to print in \"record instruction-history\"."),
-                           NULL,
+Show number of instructions to print in \"record instruction-history\"."), _("\
+A size of \"unlimited\" means unlimited instructions.  The default is 10."),
                            set_record_insn_history_size, NULL,
                            &set_record_cmdlist, &show_record_cmdlist);
 
   add_setshow_uinteger_cmd ("function-call-history-size", no_class,
                            &record_call_history_size_setshow_var, _("\
 Set number of function to print in \"record function-call-history\"."), _("\
-Show number of functions to print in \"record function-call-history\"."),
-                           NULL,
+Show number of functions to print in \"record function-call-history\"."), _("\
+A size of \"unlimited\" means unlimited lines.  The default is 10."),
                            set_record_call_history_size, NULL,
                            &set_record_cmdlist, &show_record_cmdlist);
 
index a818c657cae26be5e069287b811df10e927d960d..e4fbf265b9f0bd63de3b48f46f11b2c0dc98569f 100644 (file)
@@ -424,8 +424,11 @@ Show auto-retry on socket connect"),
 
   add_setshow_uinteger_cmd ("connect-timeout", class_obscure,
                            &tcp_retry_limit, _("\
-Set timeout limit for socket connection"), _("\
-Show timeout limit for socket connection"),
-                          NULL, NULL, NULL,
-                          &tcp_set_cmdlist, &tcp_show_cmdlist);
+Set timeout limit in seconds for socket connection"), _("\
+Show timeout limit in seconds for socket connection"), _("\
+If set to \"unlimited\", GDB will keep attempting to establish a\n\
+connection forever, unless interrupted with Ctrl-c.\n\
+The default is 15 seconds."),
+                           NULL, NULL,
+                           &tcp_set_cmdlist, &tcp_show_cmdlist);
 }
index 03c5253ba13a5f4c40a18d1b19e45a7ae34524c2..55970bac334b8799861cf768611030416b900188 100644 (file)
@@ -2046,7 +2046,10 @@ The matching line number is also stored as the value of \"$_\"."));
 
   add_setshow_integer_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,
+Show number of source lines gdb will list by default."), _("\
+Use this to choose how many source lines the \"list\" displays (unless\n\
+the \"list\" argument explicitly specifies some other number).\n\
+A value of \"unlimited\", or zero, means there's no limit."),
                            NULL,
                            show_lines_to_list,
                            &setlist, &showlist);
index 92d8ff3a3ab8729d128c882416e72a0a6c800fda..90a83b003a452ae06aa11abb972ced1f118f450f 100644 (file)
@@ -1,3 +1,11 @@
+2013-04-10  Pedro Alves  <palves@redhat.com>
+
+       * gdb.base/completion.exp: Test "set height", "set listsize" and
+       "set trace-buffer-size" completion.
+       * gdb.base/setshow.exp: Test "set height unlimited".
+       * gdb.trace/trace-buffer-size.exp: Test "set trace-buffer-size
+       unlimited".
+
 2013-04-10  Yao Qi  <yao@codesourcery.com>
 
        * gdb.trace/actions.exp: Save trace data to CTF.
index 7b664bfc25638e16ce0fa721eb5943f5301f300b..008cb0a33a7b727e9385d51fd55be56a54fa3131 100644 (file)
@@ -720,6 +720,22 @@ foreach target_name { "core" "tfile" "exec" } {
        "target ${target_name} ./gdb.base/completion\\.exp.*"
 }
 
+#
+# "set foo unlimited" completion.
+#
+
+# A var_uinteger command.
+gdb_test "complete set height " "set height unlimited"
+gdb_test "complete set height u" "set height unlimited"
+
+# A var_integer command.
+gdb_test "complete set listsize " "set listsize unlimited"
+gdb_test "complete set listsize unl" "set listsize unlimited"
+
+# A var_zuinteger_unlimited command.
+gdb_test "complete set trace-buffer-size " "set trace-buffer-size unlimited"
+gdb_test "complete set trace-buffer-size unl" "set trace-buffer-size unlimited"
+
 # Restore globals modified in this test...
 set timeout $oldtimeout1
 
index eadd1f5c1833d6188ac8cf1989530e02f8757da2..d33d6c7f3fc977aef10f3d174f8019a6a0612b52 100644 (file)
@@ -162,8 +162,9 @@ gdb_test "show environment FOOBARBAZ" "FOOBARBAZ = grbxgrbxgrbx.*"  "show enviro
 gdb_test_no_output "set height 100" "set height 100" 
 #test show height 100
 gdb_test "show height" "Number of lines gdb thinks are in a page is 100..*" "show height" 
-# back to infinite height to avoid pagers
-gdb_test_no_output "set height 0" ""
+# Back to infinite height to avoid pagers.  While at it, check that
+# literal "unlimited" works just as well as 0.
+gdb_test_no_output "set height unlimited"
 #test set history expansion on
 gdb_test_no_output "set history expansion on" "set history expansion on" 
 #test show history expansion on
index e8c6a95da6432ebecf2407c99f10007ce60759b8..0916df737a24896411fa7e5a2748b7459f6b7dcc 100644 (file)
@@ -64,10 +64,14 @@ gdb_test "show trace-buffer-size $BUFFER_SIZE" \
   "Requested size of trace buffer is $BUFFER_SIZE.*" \
   "show trace buffer size"
 
+# -1 means "no limit on GDB's end.  Let the target choose."
 gdb_test_no_output \
   "set trace-buffer-size -1" \
   "set trace buffer size 2"
 
+# "unlimited" means the same.
+gdb_test_no_output "set trace-buffer-size unlimited"
+
 # Test that tstatus gives us default buffer size now.
 gdb_test "tstatus" \
   ".*Trace buffer has $decimal bytes of $default_size bytes free.*" \
index bc61d3b84c9105a96cbddeb316655bc3fd1c0597..72fbebd865db01f71d24aa1701f998df019341b1 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1670,7 +1670,10 @@ Without an argument, saving is enabled."),
   add_setshow_uinteger_cmd ("size", no_class, &history_size_setshow_var, _("\
 Set the size of the command history,"), _("\
 Show the size of the command history,"), _("\
-ie. the number of previous commands to keep a record of."),
+ie. the number of previous commands to keep a record of.\n\
+If set to \"unlimited\", the number of commands kept in the history\n\
+list is unlimited.  This defaults to the value of the environment\n\
+variable \"HISTSIZE\", or to 256 if this variable is not set."),
                            set_history_size_command,
                            show_history_size,
                            &sethistlist, &showhistlist);
index 7b4cfb2d64cfeea6371a8f2a902aaa71236c5ccd..b1686b7ad7e3b366b13cd75e9a0a36ee81390a30 100644 (file)
@@ -5884,8 +5884,8 @@ up and stopping the trace run."),
 Set requested size of trace buffer."), _("\
 Show requested size of trace buffer."), _("\
 Use this to choose a size for the trace buffer.  Some targets\n\
-may have fixed or limited buffer sizes.  A value of -1 disables\n\
-any attempt to set the buffer size and lets the target choose."),
+may have fixed or limited buffer sizes.  Specifying \"unlimited\" or -1\n\
+disables any attempt to set the buffer size and lets the target choose."),
                                       set_trace_buffer_size, NULL,
                                       &setlist, &showlist);
 
index a222c59ea1815bcfbacca02fa0b1a21b24dcec23..37deb02c8e9397d65eda57016117fe21d1e37790 100644 (file)
@@ -2651,7 +2651,7 @@ initialize_utils (void)
 Set number of characters where GDB should wrap lines of its output."), _("\
 Show number of characters where GDB should wrap lines of its output."), _("\
 This affects where GDB wraps its output to fit the screen width.\n\
-Setting this to zero prevents GDB from wrapping its output."),
+Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."),
                            set_width_command,
                            show_chars_per_line,
                            &setlist, &showlist);
@@ -2661,7 +2661,7 @@ Set number of lines in a page for GDB output pagination."), _("\
 Show number of lines in a page for GDB output pagination."), _("\
 This affects the number of lines after which GDB will pause\n\
 its output and ask you whether to continue.\n\
-Setting this to zero causes GDB never pause during output."),
+Setting this to \"unlimited\" or zero causes GDB never pause during output."),
                            set_height_command,
                            show_lines_per_page,
                            &setlist, &showlist);
@@ -2674,7 +2674,7 @@ Set state of GDB output pagination."), _("\
 Show state of GDB output pagination."), _("\
 When pagination is ON, GDB pauses at end of each screenful of\n\
 its output and asks you whether to continue.\n\
-Turning pagination off is an alternative to \"set height 0\"."),
+Turning pagination off is an alternative to \"set height unlimited\"."),
                           NULL,
                           show_pagination_enabled,
                           &setlist, &showlist);
index 18cff49f3b50a11dbfb5a710de692e584623be69..bc21f4f223b6518a28eb7ed803e978f48028e771 100644 (file)
@@ -2707,7 +2707,7 @@ _initialize_valprint (void)
                            &user_print_options.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."),
+\"set print elements unlimited\" causes there to be no limit."),
                            NULL,
                            show_print_max,
                            &setprintlist, &showprintlist);
@@ -2724,7 +2724,7 @@ Show printing of char arrays to stop at first null char."), NULL,
                            &user_print_options.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."),
+\"set print repeats unlimited\" causes all elements to be individually printed."),
                            NULL,
                            show_repeat_count_threshold,
                            &setprintlist, &showprintlist);
This page took 0.090368 seconds and 4 git commands to generate.