* gdb.texinfo (gdbarch_in_function_epilogue_p): Add documentation.
[deliverable/binutils-gdb.git] / gdb / event-top.c
index deb7df670480fd284baac04a43672d4a02461dff..e76f08728c93ae3d441ecd9b8d258bfca61e9dfc 100644 (file)
@@ -1,5 +1,5 @@
 /* Top level stuff for GDB, the GNU debugger.
-   Copyright 1999 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
    Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
 
    This file is part of GDB.
@@ -24,9 +24,9 @@
 #include "inferior.h"
 #include "target.h"
 #include "terminal.h"          /* for job_control */
-#include "signals.h"
 #include "event-loop.h"
 #include "event-top.h"
+#include <signal.h>
 
 /* For dont_repeat() */
 #include "gdbcmd.h"
@@ -35,8 +35,6 @@
 #include <readline/readline.h>
 #include <readline/history.h>
 
-#include <signal.h>
-
 /* readline defines this.  */
 #undef savestring
 
@@ -157,7 +155,7 @@ struct readline_input_state
 readline_input_state;
 \f
 
-/* Wrapper function foe calling into the readline library. The event
+/* Wrapper function for calling into the readline library. The event
    loop expects the callback function to have a paramter, while readline 
    expects none. */
 static void
@@ -304,11 +302,11 @@ display_gdb_prompt (char *new_prompt)
          the user is not accounted for.  */
       fputs_unfiltered (new_prompt, gdb_stdout);
 
-#ifdef MPW
-      /* Move to a new line so the entered line doesn't have a prompt
-         on the front of it. */
-      fputs_unfiltered ("\n", gdb_stdout);
-#endif /* MPW */
+      /* OBSOLETE #ifdef MPW */
+      /* OBSOLETE        *//* Move to a new line so the entered line doesn't have a prompt */
+      /* OBSOLETE          on the front of it. */
+      /* OBSOLETE       fputs_unfiltered ("\n", gdb_stdout); */
+      /* OBSOLETE #endif  *//* MPW */
       gdb_flush (gdb_stdout);
     }
 }
@@ -393,13 +391,13 @@ pop_prompt (void)
        in effect, until the user does another 'set prompt'. */
     if (strcmp (PROMPT (0), PROMPT (-1)))
       {
-       free (PROMPT (-1));
+       xfree (PROMPT (-1));
        PROMPT (-1) = savestring (PROMPT (0), strlen (PROMPT (0)));
       }
 
-  free (PREFIX (0));
-  free (PROMPT (0));
-  free (SUFFIX (0));
+  xfree (PREFIX (0));
+  xfree (PROMPT (0));
+  xfree (SUFFIX (0));
   the_prompts.top--;
 }
 
@@ -480,18 +478,11 @@ command_handler (char *command)
   extern int display_time;
   extern int display_space;
 
-#if defined(TUI)
-  extern int insert_mode;
-#endif
-
   quit_flag = 0;
   if (instream == stdin && stdin_is_tty)
     reinitialize_more_filter ();
   old_chain = make_cleanup (null_cleanup, 0);
 
-#if defined(TUI)
-  insert_mode = 0;
-#endif
   /* If readline returned a NULL command, it means that the 
      connection with the terminal is gone. This happens at the
      end of a testsuite run, after Expect has hung up 
@@ -515,7 +506,7 @@ command_handler (char *command)
   execute_command (command, instream == stdin);
 
   /* Set things up for this function to be compete later, once the
-     executin has completed, if we are doing an execution command,
+     execution has completed, if we are doing an execution command,
      otherwise, just go ahead and finish. */
   if (target_can_async_p () && target_executing)
     {
@@ -643,7 +634,7 @@ command_line_handler (char *rl)
     {
       strcpy (linebuffer, readline_input_state.linebuffer);
       p = readline_input_state.linebuffer_ptr;
-      free (readline_input_state.linebuffer);
+      xfree (readline_input_state.linebuffer);
       more_to_come = 0;
       pop_prompt ();
     }
@@ -690,7 +681,7 @@ command_line_handler (char *rl)
   while (*p1)
     *p++ = *p1++;
 
-  free (rl);                   /* Allocated in readline.  */
+  xfree (rl);                  /* Allocated in readline.  */
 
   if (*(p - 1) == '\\')
     {
@@ -749,7 +740,7 @@ command_line_handler (char *rl)
          /* If there was an error, call this function again.  */
          if (expanded < 0)
            {
-             free (history_value);
+             xfree (history_value);
              return;
            }
          if (strlen (history_value) > linelength)
@@ -759,7 +750,7 @@ command_line_handler (char *rl)
            }
          strcpy (linebuffer, history_value);
          p = linebuffer + strlen (linebuffer);
-         free (history_value);
+         xfree (history_value);
        }
     }
 
@@ -868,7 +859,7 @@ gdb_readline2 (gdb_client_data client_data)
               if we are called again fgetc will still return EOF and
               we'll return NULL then.  */
            break;
-         free (result);
+         xfree (result);
          (*input_handler) (0);
        }
 
@@ -1016,8 +1007,7 @@ async_do_nothing (gdb_client_data arg)
 /* Tell the event loop what to do if SIGHUP is received. 
    See event-signal.c. */
 static void
-handle_sighup (sig)
-     int sig;
+handle_sighup (int sig)
 {
   mark_async_signal_handler_wrapper (sighup_token);
   signal (sig, handle_sighup);
@@ -1052,10 +1042,11 @@ async_stop_sig (gdb_client_data arg)
 #if HAVE_SIGPROCMASK
   {
     sigset_t zero;
+
     sigemptyset (&zero);
     sigprocmask (SIG_SETMASK, &zero, 0);
   }
-#else
+#elif HAVE_SIGSETMASK
   sigsetmask (0);
 #endif
   kill (getpid (), SIGTSTP);
This page took 0.026555 seconds and 4 git commands to generate.