sim: drop duplicate header checks
[binutils-gdb.git] / sim / mcore / interp.c
index 72c59f7ecb97bd31f793d8b7bd1e824b6a915d80..1b8d2a367826c2c13be0b23b19556cefbbf6951e 100644 (file)
@@ -1,5 +1,5 @@
 /* Simulator for Motorola's MCore processor
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+   Copyright (C) 1999-2015 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
 This file is part of GDB, the GNU debugger.
@@ -19,10 +19,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
 #include <signal.h>
-#include "sysdep.h"
+#include <stdlib.h>
+#include <string.h>
 #include <sys/times.h>
 #include <sys/param.h>
-#include <netinet/in.h>        /* for byte ordering macros */
+#include <unistd.h>
 #include "bfd.h"
 #include "gdb/callback.h"
 #include "libiberty.h"
@@ -1922,7 +1923,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_load (sd, prog, abfd, from_tty)
      SIM_DESC sd;
-     char * prog;
+     const char * prog;
      bfd * abfd;
      int from_tty;
 {
@@ -2120,17 +2121,10 @@ sim_create_inferior (sd, prog_bfd, argv, env)
   return SIM_RC_OK;
 }
 
-void
-sim_kill (sd)
-     SIM_DESC sd;
-{
-  /* nothing to do */
-}
-
 void
 sim_do_command (sd, cmd)
      SIM_DESC sd;
-     char * cmd;
+     const char *cmd;
 {
   /* Nothing there yet; it's all an error.  */
   
@@ -2143,6 +2137,7 @@ sim_do_command (sd, cmd)
          if ((simargv[1] == NULL) || (simargv[2] == NULL))
            {
              fprintf (stderr, "Error: missing argument to watch cmd.\n");
+             freeargv (simargv);
              return;
            }
          
@@ -2187,6 +2182,8 @@ sim_do_command (sd, cmd)
          fprintf (stderr,"Error: \"%s\" is not a valid M.CORE simulator command.\n",
                   cmd);
        }
+
+      freeargv (simargv);
     }
   else
     {