]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/ppc/main.c
sim:
[thirdparty/binutils-gdb.git] / sim / ppc / main.c
index a2948e0a6b0c7dd561c8846f1b385fab8ddcb746..6be9054f38d7028ac822527757b746d4bd2595a5 100644 (file)
 #include "device.h" /* FIXME: psim should provide the interface */
 #include "events.h" /* FIXME: psim should provide the interface */
 
+#include "bfd.h"
+#include "gdb/callback.h"
+#include "gdb/remote-sim.h"
+
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
@@ -222,13 +226,29 @@ sim_io_flush_stdoutput(void)
   }
 }
 
+void
+sim_io_error (SIM_DESC sd, const char *msg, ...)
+{
+  va_list ap;
+  va_start(ap, msg);
+  vprintf(msg, ap);
+  printf("\n");
+  va_end(ap);
+
+  /* any final clean up */
+  if (ppc_trace[trace_print_info] && simulation != NULL)
+    psim_print_info (simulation, ppc_trace[trace_print_info]);
+
+  exit (1);
+}
+
 
 void *
 zalloc(long size)
 {
   void *memory = malloc(size);
   if (memory == NULL)
-    error("zmalloc failed\n");
+    error("zalloc failed\n");
   memset(memory, 0, size);
   return memory;
 }
@@ -263,7 +283,7 @@ main(int argc, char **argv)
       print_options ();
       return 0;
     } else {
-      psim_usage(0);
+      psim_usage(0, 0);
     }
   }
   name_of_file = argv[0];