gas: avoid spurious failures in non-ELF targets in the SPARC testsuite.
[deliverable/binutils-gdb.git] / sim / ppc / sim_calls.c
index ae74593dd69c018bc0066fe41ce7b1222a54bffa..470c95862a14ffdfff801340e39e3b3d42e56cc4 100644 (file)
@@ -4,7 +4,7 @@
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
  
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
  
     */
 
 #endif
 #endif
 
+#include "libiberty.h"
 #include "bfd.h"
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
+#include "gdb/signals.h"
 
 /* Define the rate at which the simulator should poll the host
    for a quit. */
@@ -62,7 +63,7 @@ SIM_DESC
 sim_open (SIM_OPEN_KIND kind,
          host_callback *callback,
          struct bfd *abfd,
-         char **argv)
+         char * const *argv)
 {
   callbacks = callback;
 
@@ -76,7 +77,8 @@ sim_open (SIM_OPEN_KIND kind,
   root_device = psim_tree();
   simulator = NULL;
 
-  psim_options(root_device, argv + 1);
+  if (psim_options (root_device, argv + 1, kind) == NULL)
+    return NULL;
 
   if (ppc_trace[trace_opts])
     print_options ();
@@ -96,7 +98,7 @@ sim_close (SIM_DESC sd, int quitting)
 
 
 SIM_RC
-sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
+sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty)
 {
   TRACE(trace_gdb, ("sim_load(prog=%s, from_tty=%d) called\n",
                    prog, from_tty));
@@ -142,7 +144,7 @@ sim_read (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
 
 
 int
-sim_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
+sim_write (SIM_DESC sd, SIM_ADDR mem, const unsigned char *buf, int length)
 {
   int result = psim_write_memory(simulator, MAX_NR_PROCESSORS,
                                 buf, mem, length,
@@ -163,8 +165,8 @@ sim_info (SIM_DESC sd, int verbose)
 SIM_RC
 sim_create_inferior (SIM_DESC sd,
                     struct bfd *abfd,
-                    char **argv,
-                    char **envp)
+                    char * const *argv,
+                    char * const *envp)
 {
   unsigned_word entry_point;
   TRACE(trace_gdb, ("sim_create_inferior(start_address=0x%x, ...)\n",
@@ -196,13 +198,13 @@ sim_stop_reason (SIM_DESC sd, enum sim_stop *reason, int *sigrc)
   case was_continuing:
     *reason = sim_stopped;
     if (status.signal == 0)
-      *sigrc = SIGTRAP;
+      *sigrc = GDB_SIGNAL_TRAP;
     else
       *sigrc = status.signal;
     break;
   case was_trap:
     *reason = sim_stopped;
-    *sigrc = SIGTRAP;
+    *sigrc = GDB_SIGNAL_TRAP;
     break;
   case was_exited:
     *reason = sim_exited;
@@ -246,7 +248,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
 }
 
 void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
 {
   TRACE(trace_gdb, ("sim_do_commands(cmd=%s) called\n",
                    cmd ? cmd : "(null)"));
@@ -257,6 +259,11 @@ sim_do_command (SIM_DESC sd, char *cmd)
   }
 }
 
+char **
+sim_complete_command (SIM_DESC sd, const char *text, const char *word)
+{
+  return NULL;
+}
 
 /* Polling, if required */
 
@@ -388,8 +395,3 @@ zalloc(long size)
   memset(memory, 0, size);
   return memory;
 }
-
-void zfree(void *data)
-{
-  free(data);
-}
This page took 0.026157 seconds and 4 git commands to generate.