]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove "repeat" argument from command_line_input
authorTom Tromey <tom@tromey.com>
Thu, 16 Aug 2018 00:37:00 +0000 (18:37 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 17 Aug 2018 23:14:02 +0000 (17:14 -0600)
After the previous patch, all callers pass 0 as the repeat argument to
command_line_input.  So, this patch removes it.

2018-08-16  Tom Tromey  <tom@tromey.com>

* top.c (read_command_file): Update.
(command_line_input): Remove "repeat" argument.
* ada-lang.c (get_selections): Update.
* linespec.c (decode_line_2): Update.
* defs.h (command_line_input): Remove argument.
* cli/cli-script.c (read_next_line): Update.
* python/py-gdb-readline.c: Update.

gdb/ChangeLog
gdb/ada-lang.c
gdb/cli/cli-script.c
gdb/defs.h
gdb/linespec.c
gdb/python/py-gdb-readline.c
gdb/top.c

index f7f1a05cb58d24e6ba9daee36158f69347cc7090..e4d9e1734ecbda5dfc0e093739c01a1e238e95df 100644 (file)
@@ -1,3 +1,13 @@
+2018-08-16  Tom Tromey  <tom@tromey.com>
+
+       * top.c (read_command_file): Update.
+       (command_line_input): Remove "repeat" argument.
+       * ada-lang.c (get_selections): Update.
+       * linespec.c (decode_line_2): Update.
+       * defs.h (command_line_input): Remove argument.
+       * cli/cli-script.c (read_next_line): Update.
+       * python/py-gdb-readline.c: Update.
+
 2018-08-17  Tom Tromey  <tom@tromey.com>
 
        * cli/cli-script.c (read_next_line): Pass 0 as repeat argument to
index 89cbec35b03848192a9ad7b9f649ad07e00e40e6..3e5bd8a7c4f27d74e5bc1f23c23416c546a5183a 100644 (file)
@@ -4041,7 +4041,7 @@ get_selections (int *choices, int n_choices, int max_results,
   if (prompt == NULL)
     prompt = "> ";
 
-  args = command_line_input (prompt, 0, annotation_suffix);
+  args = command_line_input (prompt, annotation_suffix);
 
   if (args == NULL)
     error_no_arg (_("one or more choice numbers"));
index 4c30e76d8a355423336b8d61984af841083ddb47..fef03d353e1d2a115e43fdf8c59b74d7ce10ee0a 100644 (file)
@@ -903,7 +903,7 @@ read_next_line (void)
   else
     prompt_ptr = NULL;
 
-  return command_line_input (prompt_ptr, 0, "commands");
+  return command_line_input (prompt_ptr, "commands");
 }
 
 /* Return true if CMD's name is NAME.  */
index 4cf83f0d443e81a478d4cd5338fd3e3f579e1a44..fc4217005a19caa4ff398ce204edbb8da29a50ed 100644 (file)
@@ -309,7 +309,7 @@ typedef void initialize_file_ftype (void);
 
 extern char *gdb_readline_wrapper (const char *);
 
-extern char *command_line_input (const char *, int, const char *);
+extern char *command_line_input (const char *, const char *);
 
 extern void print_prompt (void);
 
index 2a4189278ef57847b5cfd2046c470b9c77a9d9f8..20b8328131fc97010c2bac95803f2cd3f2abd53b 100644 (file)
@@ -1556,7 +1556,7 @@ decode_line_2 (struct linespec_state *self,
     {
       prompt = "> ";
     }
-  args = command_line_input (prompt, 0, "overload-choice");
+  args = command_line_input (prompt, "overload-choice");
 
   if (args == 0 || *args == 0)
     error_no_arg (_("one or more choice numbers"));
index a95be41c49fcad5ddd005759d3c978e6ff04619f..66f1ea81dc9b55c4831d835e20408ee01c10f819 100644 (file)
@@ -41,7 +41,7 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
 
   TRY
     {
-      p = command_line_input (prompt, 0, "python");
+      p = command_line_input (prompt, "python");
     }
   /* Handle errors by raising Python exceptions.  */
   CATCH (except, RETURN_MASK_ALL)
index fdef3e0d0bf2cfcd54d19d84e73b3abcbe8a82b7..d9876fd91efd1aa15440e1566333b868f772aa60 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -418,7 +418,7 @@ read_command_file (FILE *stream)
       char *command;
 
       /* Get a command-line.  This calls the readline package.  */
-      command = command_line_input (NULL, 0, NULL);
+      command = command_line_input (NULL, NULL);
       if (command == NULL)
        break;
       command_handler (command);
@@ -1161,16 +1161,11 @@ gdb_safe_append_history (void)
 
    NULL is returned for end of file.
 
-   *If* input is from an interactive stream (stdin), the line read is
-   copied into the global 'saved_command_line' so that it can be
-   repeated.
-
    This routine either uses fancy command line editing or simple input
    as the user has requested.  */
 
 char *
-command_line_input (const char *prompt_arg, int repeat,
-                   const char *annotation_suffix)
+command_line_input (const char *prompt_arg, const char *annotation_suffix)
 {
   static struct buffer cmd_line_buffer;
   static int cmd_line_buffer_initialized;
@@ -1255,7 +1250,7 @@ command_line_input (const char *prompt_arg, int repeat,
        }
 
       cmd = handle_line_of_input (&cmd_line_buffer, rl,
-                                 repeat, annotation_suffix);
+                                 0, annotation_suffix);
       if (cmd == (char *) EOF)
        {
          cmd = NULL;