[06/10] gdb_readline -> gdb_readline_no_editing
Commit Message
Name this such that it's clearer that this is not a wrapper for the
real readline, but instead a replacement that provides no command line
editing features.
gdb/ChangeLog:
2016-02-18 Pedro Alves <palves@redhat.com>
* defs.h (gdb_readline): Delete declaration.
* top.c (gdb_readline): Rename to ...
(gdb_readline_no_editing): ... this, and make static.
---
gdb/defs.h | 2 --
gdb/top.c | 7 ++++---
2 files changed, 4 insertions(+), 5 deletions(-)
Comments
On Thursday, February 18 2016, Pedro Alves wrote:
> Name this such that it's clearer that this is not a wrapper for the
> real readline, but instead a replacement that provides no command line
> editing features.
>
> gdb/ChangeLog:
> 2016-02-18 Pedro Alves <palves@redhat.com>
>
> * defs.h (gdb_readline): Delete declaration.
> * top.c (gdb_readline): Rename to ...
> (gdb_readline_no_editing): ... this, and make static.
> ---
> gdb/defs.h | 2 --
> gdb/top.c | 7 ++++---
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/gdb/defs.h b/gdb/defs.h
> index f6ffeac..b94df30 100644
> --- a/gdb/defs.h
> +++ b/gdb/defs.h
> @@ -285,8 +285,6 @@ extern void print_transfer_performance (struct ui_file *stream,
>
> typedef void initialize_file_ftype (void);
>
> -extern char *gdb_readline (const char *);
> -
> extern char *gdb_readline_wrapper (const char *);
>
> extern char *command_line_input (const char *, int, char *);
> diff --git a/gdb/top.c b/gdb/top.c
> index fb1657a..e781cdd 100644
> --- a/gdb/top.c
> +++ b/gdb/top.c
> @@ -608,8 +608,9 @@ prevent_dont_repeat (void)
> malloc'd and should be freed by the caller.
>
> A NULL return means end of file. */
> -char *
> -gdb_readline (const char *prompt_arg)
> +
> +static char *
> +gdb_readline_no_editing (const char *prompt_arg)
> {
> int c;
> char *result;
> @@ -1117,7 +1118,7 @@ command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix)
> }
> else
> {
> - rl = gdb_readline (prompt);
> + rl = gdb_readline_no_editing (prompt);
> }
>
> if (annotation_level > 1 && instream == stdin)
> --
> 1.9.3
Thanks, I like this a lot.
LGTM.
@@ -285,8 +285,6 @@ extern void print_transfer_performance (struct ui_file *stream,
typedef void initialize_file_ftype (void);
-extern char *gdb_readline (const char *);
-
extern char *gdb_readline_wrapper (const char *);
extern char *command_line_input (const char *, int, char *);
@@ -608,8 +608,9 @@ prevent_dont_repeat (void)
malloc'd and should be freed by the caller.
A NULL return means end of file. */
-char *
-gdb_readline (const char *prompt_arg)
+
+static char *
+gdb_readline_no_editing (const char *prompt_arg)
{
int c;
char *result;
@@ -1117,7 +1118,7 @@ command_line_input (const char *prompt_arg, int repeat, char *annotation_suffix)
}
else
{
- rl = gdb_readline (prompt);
+ rl = gdb_readline_no_editing (prompt);
}
if (annotation_level > 1 && instream == stdin)