*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / remote-sim.c
index 8942b0d5a8dad700f0bd80cf871e0626ae98f1e0..4e36f54af9a538a8b0f66395dc68adcfee79e77a 100644 (file)
@@ -1,7 +1,7 @@
 /* Generic remote debugging interface for simulators.
 
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2004, 2005 Free Software Foundation, Inc.
+   2002, 2004, 2005, 2006 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
    Steve Chamberlain (sac@cygnus.com).
@@ -43,6 +43,7 @@
 #include "gdb_assert.h"
 #include "sim-regno.h"
 #include "arch-utils.h"
+#include "readline/readline.h"
 
 /* Prototypes */
 
@@ -391,8 +392,21 @@ gdbsim_kill (void)
    GDB's symbol tables to match.  */
 
 static void
-gdbsim_load (char *prog, int fromtty)
+gdbsim_load (char *args, int fromtty)
 {
+  char **argv = buildargv (args);
+  char *prog;
+
+  if (argv == NULL)
+    nomem (0);
+
+  make_cleanup_freeargv (argv);
+
+  prog = tilde_expand (argv[0]);
+
+  if (argv[1] != NULL)
+    error (_("GDB sim does not yet support a load offset."));
+
   if (sr_get_debug ())
     printf_filtered ("gdbsim_load: prog \"%s\"\n", prog);
 
@@ -458,9 +472,6 @@ gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
   insert_breakpoints ();       /* Needed to get correct instruction in cache */
 
   clear_proceed_status ();
-
-  /* NB: Entry point already set by sim_create_inferior. */
-  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
 }
 
 /* The open routine takes the rest of the parameters from the command,
@@ -794,18 +805,6 @@ gdbsim_mourn_inferior (void)
   generic_mourn_inferior ();
 }
 
-static int
-gdbsim_insert_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
-{
-  return memory_insert_breakpoint (addr, contents_cache);
-}
-
-static int
-gdbsim_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
-{
-  return memory_remove_breakpoint (addr, contents_cache);
-}
-
 /* Pass the command argument through to the simulator verbatim.  The
    simulator must do any command interpretation work.  */
 
@@ -855,8 +854,8 @@ init_gdbsim_ops (void)
   gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
   gdbsim_ops.deprecated_xfer_memory = gdbsim_xfer_inferior_memory;
   gdbsim_ops.to_files_info = gdbsim_files_info;
-  gdbsim_ops.to_insert_breakpoint = gdbsim_insert_breakpoint;
-  gdbsim_ops.to_remove_breakpoint = gdbsim_remove_breakpoint;
+  gdbsim_ops.to_insert_breakpoint = memory_insert_breakpoint;
+  gdbsim_ops.to_remove_breakpoint = memory_remove_breakpoint;
   gdbsim_ops.to_kill = gdbsim_kill;
   gdbsim_ops.to_load = gdbsim_load;
   gdbsim_ops.to_create_inferior = gdbsim_create_inferior;
This page took 0.025823 seconds and 4 git commands to generate.