summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-06-13 10:55:25 +0000
committerPedro Alves <pedro@codesourcery.com>2011-06-13 10:55:25 +0000
commit7c7bb3f686eb1f50e253f35bac963c1bb1dda9e4 (patch)
tree51dadf7af34f5c6a0e67f5a09f51fc3093647fed /gdb/top.c
parent60deb1b873953e7e8bad2727eda4234a99059995 (diff)
downloadgdb-7c7bb3f686eb1f50e253f35bac963c1bb1dda9e4.tar.gz
2011-06-13 Pedro Alves <pedro@codesourcery.com>
gdb/ * top.h (line): Rename to ... (saved_command_line): ... this. (linesize): Rename to ... (saved_command_line_size): ... this. * top.c (line): Rename to ... (saved_command_line): ... this. (linesize): Rename to ... (saved_command_line_size): ... this. (dont_repeat, command_line_input, dont_repeat_command): Adjust. * event-top.c (command_line_handler): Adjust. * main.c (captured_main): Adjust.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/gdb/top.c b/gdb/top.c
index b69f7d694c9..58c50755c77 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -137,8 +137,8 @@ int xgdb_verbose;
/* Buffer used for reading command lines, and the size
allocated for it so far. */
-char *line;
-int linesize = 100;
+char *saved_command_line;
+int saved_command_line_size = 100;
/* Nonzero if the current command is modified by "server ". This
affects things like recording into the command history, commands
@@ -572,7 +572,7 @@ dont_repeat (void)
thing read from stdin in line and don't want to delete it. Null
lines won't repeat here in any case. */
if (instream == stdin)
- *line = 0;
+ *saved_command_line = 0;
}
/* Prevent dont_repeat from working, and return a cleanup that
@@ -1034,10 +1034,10 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
/* If we just got an empty line, and that is supposed to repeat the
previous command, return the value in the global buffer. */
if (repeat && p == linebuffer)
- return line;
+ return saved_command_line;
for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++);
if (repeat && !*p1)
- return line;
+ return saved_command_line;
*p = 0;
@@ -1058,13 +1058,13 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
/* Save into global buffer if appropriate. */
if (repeat)
{
- if (linelength > linesize)
+ if (linelength > saved_command_line_size)
{
- line = xrealloc (line, linelength);
- linesize = linelength;
+ saved_command_line = xrealloc (saved_command_line, linelength);
+ saved_command_line_size = linelength;
}
- strcpy (line, linebuffer);
- return line;
+ strcpy (saved_command_line, linebuffer);
+ return saved_command_line;
}
return linebuffer;
@@ -1314,8 +1314,9 @@ input_from_terminal_p (void)
static void
dont_repeat_command (char *ignored, int from_tty)
{
- *line = 0; /* Can't call dont_repeat here because we're
- not necessarily reading from stdin. */
+ /* Can't call dont_repeat here because we're not necessarily reading
+ from stdin. */
+ *saved_command_line = 0;
}
/* Functions to manipulate command line editing control variables. */