Skip to content

Commit 84a3910

Browse files
committed
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.
1 parent 5424be6 commit 84a3910

7 files changed

Lines changed: 18 additions & 13 deletions

File tree

gdb/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2018-08-16 Tom Tromey <tom@tromey.com>
2+
3+
* top.c (read_command_file): Update.
4+
(command_line_input): Remove "repeat" argument.
5+
* ada-lang.c (get_selections): Update.
6+
* linespec.c (decode_line_2): Update.
7+
* defs.h (command_line_input): Remove argument.
8+
* cli/cli-script.c (read_next_line): Update.
9+
* python/py-gdb-readline.c: Update.
10+
111
2018-08-17 Tom Tromey <tom@tromey.com>
212

313
* cli/cli-script.c (read_next_line): Pass 0 as repeat argument to

gdb/ada-lang.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4041,7 +4041,7 @@ get_selections (int *choices, int n_choices, int max_results,
40414041
if (prompt == NULL)
40424042
prompt = "> ";
40434043

4044-
args = command_line_input (prompt, 0, annotation_suffix);
4044+
args = command_line_input (prompt, annotation_suffix);
40454045

40464046
if (args == NULL)
40474047
error_no_arg (_("one or more choice numbers"));

gdb/cli/cli-script.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ read_next_line (void)
903903
else
904904
prompt_ptr = NULL;
905905

906-
return command_line_input (prompt_ptr, 0, "commands");
906+
return command_line_input (prompt_ptr, "commands");
907907
}
908908

909909
/* Return true if CMD's name is NAME. */

gdb/defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ typedef void initialize_file_ftype (void);
309309

310310
extern char *gdb_readline_wrapper (const char *);
311311

312-
extern char *command_line_input (const char *, int, const char *);
312+
extern char *command_line_input (const char *, const char *);
313313

314314
extern void print_prompt (void);
315315

gdb/linespec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ decode_line_2 (struct linespec_state *self,
15561556
{
15571557
prompt = "> ";
15581558
}
1559-
args = command_line_input (prompt, 0, "overload-choice");
1559+
args = command_line_input (prompt, "overload-choice");
15601560

15611561
if (args == 0 || *args == 0)
15621562
error_no_arg (_("one or more choice numbers"));

gdb/python/py-gdb-readline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
4141

4242
TRY
4343
{
44-
p = command_line_input (prompt, 0, "python");
44+
p = command_line_input (prompt, "python");
4545
}
4646
/* Handle errors by raising Python exceptions. */
4747
CATCH (except, RETURN_MASK_ALL)

gdb/top.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ read_command_file (FILE *stream)
418418
char *command;
419419

420420
/* Get a command-line. This calls the readline package. */
421-
command = command_line_input (NULL, 0, NULL);
421+
command = command_line_input (NULL, NULL);
422422
if (command == NULL)
423423
break;
424424
command_handler (command);
@@ -1161,16 +1161,11 @@ gdb_safe_append_history (void)
11611161
11621162
NULL is returned for end of file.
11631163
1164-
*If* input is from an interactive stream (stdin), the line read is
1165-
copied into the global 'saved_command_line' so that it can be
1166-
repeated.
1167-
11681164
This routine either uses fancy command line editing or simple input
11691165
as the user has requested. */
11701166

11711167
char *
1172-
command_line_input (const char *prompt_arg, int repeat,
1173-
const char *annotation_suffix)
1168+
command_line_input (const char *prompt_arg, const char *annotation_suffix)
11741169
{
11751170
static struct buffer cmd_line_buffer;
11761171
static int cmd_line_buffer_initialized;
@@ -1255,7 +1250,7 @@ command_line_input (const char *prompt_arg, int repeat,
12551250
}
12561251

12571252
cmd = handle_line_of_input (&cmd_line_buffer, rl,
1258-
repeat, annotation_suffix);
1253+
0, annotation_suffix);
12591254
if (cmd == (char *) EOF)
12601255
{
12611256
cmd = NULL;

0 commit comments

Comments
 (0)