This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/gdb-8.2-branch] Remove "repeat" argument from command_line_input


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=84a39102d73de5b195b3f8037780ed2133db1fb7

commit 84a39102d73de5b195b3f8037780ed2133db1fb7
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Aug 15 18:37:00 2018 -0600

    Remove "repeat" argument from command_line_input
    
    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.

Diff:
---
 gdb/ChangeLog                | 10 ++++++++++
 gdb/ada-lang.c               |  2 +-
 gdb/cli/cli-script.c         |  2 +-
 gdb/defs.h                   |  2 +-
 gdb/linespec.c               |  2 +-
 gdb/python/py-gdb-readline.c |  2 +-
 gdb/top.c                    | 11 +++--------
 7 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f7f1a05..e4d9e17 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 89cbec3..3e5bd8a 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -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"));
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 4c30e76..fef03d3 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -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.  */
diff --git a/gdb/defs.h b/gdb/defs.h
index 4cf83f0..fc42170 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -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);
 
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 2a41892..20b8328 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -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"));
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index a95be41..66f1ea8 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -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)
diff --git a/gdb/top.c b/gdb/top.c
index fdef3e0..d9876fd 100644
--- 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]