PR 12848
[deliverable/binutils-gdb.git] / gdb / event-top.c
index 71accf6363860ad3634c24a809a0f6787f274027..72cbfdcfc6e98169ee6768fcd97cf5d3adc9b7a6 100644 (file)
@@ -33,7 +33,7 @@
 #include "cli/cli-script.h"     /* for reset_command_nest_depth */
 #include "main.h"
 #include "gdbthread.h"
-
+#include "continuations.h"
 #include "gdbcmd.h"            /* for dont_repeat() */
 
 /* readline include files.  */
@@ -165,7 +165,7 @@ readline_input_state;
 
 /* This hook is called by rl_callback_read_char_wrapper after each
    character is processed.  */
-void (*after_char_processing_hook) ();
+void (*after_char_processing_hook) (void);
 \f
 
 /* Wrapper function for calling into the readline library.  The event
@@ -520,8 +520,6 @@ command_line_handler (char *rl)
   static unsigned linelength = 0;
   char *p;
   char *p1;
-  extern char *line;
-  extern int linesize;
   char *nline;
   char got_eof = 0;
 
@@ -661,7 +659,7 @@ command_line_handler (char *rl)
      previous command, return the value in the global buffer.  */
   if (repeat && p == linebuffer && *p != '\\')
     {
-      command_handler (line);
+      command_handler (saved_command_line);
       display_gdb_prompt (0);
       return;
     }
@@ -669,7 +667,7 @@ command_line_handler (char *rl)
   for (p1 = linebuffer; *p1 == ' ' || *p1 == '\t'; p1++);
   if (repeat && !*p1)
     {
-      command_handler (line);
+      command_handler (saved_command_line);
       display_gdb_prompt (0);
       return;
     }
@@ -693,15 +691,15 @@ command_line_handler (char *rl)
   /* 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);
+      strcpy (saved_command_line, linebuffer);
       if (!more_to_come)
        {
-         command_handler (line);
+         command_handler (saved_command_line);
          display_gdb_prompt (0);
        }
       return;
This page took 0.024415 seconds and 4 git commands to generate.