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,
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/>.
*/
#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
}
}
+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;
}
-void
-zfree(void *chunk)
-{
- free(chunk);
-}
-
/* When a CNTRL-C occures, queue an event to shut down the simulation */
static RETSIGTYPE
device *root = psim_tree();
/* parse the arguments */
- argv = psim_options(root, argv + 1);
+ argv = psim_options (root, argv + 1, SIM_OPEN_STANDALONE);
if (argv[0] == NULL) {
if (ppc_trace[trace_opts]) {
print_options ();
return 0;
} else {
- psim_usage(0);
+ psim_usage (0, 0, SIM_OPEN_STANDALONE);
}
}
name_of_file = argv[0];
status = psim_get_status(simulation);
switch (status.reason) {
case was_continuing:
- error("psim: continuing while stoped!\n");
+ error("psim: continuing while stopped!\n");
return 0;
case was_trap:
error("psim: no trap insn\n");