* hppa-tdep.h (hppa_in_solib_call_trampoline)
[deliverable/binutils-gdb.git] / gdb / remote-sim.c
index 7a5c7b0aba96eb99f3d80da814a9bed68fde0388..8942b0d5a8dad700f0bd80cf871e0626ae98f1e0 100644 (file)
@@ -1,7 +1,7 @@
 /* Generic remote debugging interface for simulators.
 
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2004, 2005 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.
    Steve Chamberlain (sac@cygnus.com).
@@ -20,8 +20,8 @@
 
    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.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -93,11 +93,6 @@ static ptid_t gdbsim_wait (ptid_t ptid, struct target_waitstatus *status);
 
 static void gdbsim_prepare_to_store (void);
 
-static int gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, 
-                                       int len, int write,
-                                       struct mem_attrib *attrib,
-                                       struct target_ops *target);
-
 static void gdbsim_files_info (struct target_ops *target);
 
 static void gdbsim_mourn_inferior (void);
@@ -364,7 +359,7 @@ gdbsim_store_register (int regno)
                                     tmp, register_size (current_gdbarch, regno));
       if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno))
        internal_error (__FILE__, __LINE__,
-                       "Register size different to expected");
+                       _("Register size different to expected"));
       /* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
         indicating that GDB and the SIM have different ideas about
         which registers are fetchable.  */
@@ -407,7 +402,7 @@ gdbsim_load (char *prog, int fromtty)
      Need error to either not print anything if passed NULL or need
      another routine that doesn't take any arguments.  */
   if (sim_load (gdbsim_desc, prog, NULL, fromtty) == SIM_RC_FAIL)
-    error ("unable to load program");
+    error (_("unable to load program"));
 
   /* FIXME: If a load command should reset the targets registers then
      a call to sim_create_inferior() should go here. */
@@ -431,9 +426,9 @@ gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
   char *arg_buf, **argv;
 
   if (exec_file == 0 || exec_bfd == 0)
-    warning ("No executable file specified.");
+    warning (_("No executable file specified."));
   if (!program_loaded)
-    warning ("No program loaded.");
+    warning (_("No program loaded."));
 
   if (sr_get_debug ())
     printf_filtered ("gdbsim_create_inferior: exec_file \"%s\", args \"%s\"\n",
@@ -527,14 +522,14 @@ gdbsim_open (char *args, int from_tty)
     }
   argv = buildargv (arg_buf);
   if (argv == NULL)
-    error ("Insufficient memory available to allocate simulator arg list.");
+    error (_("Insufficient memory available to allocate simulator arg list."));
   make_cleanup_freeargv (argv);
 
   init_callbacks ();
   gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, exec_bfd, argv);
 
   if (gdbsim_desc == 0)
-    error ("unable to create simulator instance");
+    error (_("unable to create simulator instance"));
 
   push_target (&gdbsim_ops);
   target_fetch_registers (-1);
@@ -599,7 +594,7 @@ static void
 gdbsim_resume (ptid_t ptid, int step, enum target_signal siggnal)
 {
   if (PIDGET (inferior_ptid) != 42)
-    error ("The program is not being run.");
+    error (_("The program is not being run."));
 
   if (sr_get_debug ())
     printf_filtered ("gdbsim_resume: step %d, signal %d\n", step, siggnal);
@@ -627,7 +622,7 @@ gdbsim_stop (void)
 }
 
 /* GDB version of os_poll_quit callback.
-   Taken from gdb/util.c - should be in a library */
+   Taken from gdb/util.c - should be in a library */
 
 static int
 gdb_os_poll_quit (host_callback *p)
@@ -679,8 +674,7 @@ gdbsim_wait (ptid_t ptid, struct target_waitstatus *status)
 #else
   prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
 #endif
-  sim_resume (gdbsim_desc, resume_step,
-             target_signal_to_host (resume_siggnal));
+  sim_resume (gdbsim_desc, resume_step, resume_siggnal);
   signal (SIGINT, prev_sigint);
   resume_step = 0;
 
@@ -695,24 +689,20 @@ gdbsim_wait (ptid_t ptid, struct target_waitstatus *status)
     case sim_stopped:
       switch (sigrc)
        {
-       case SIGABRT:
+       case TARGET_SIGNAL_ABRT:
          quit ();
          break;
-       case SIGINT:
-       case SIGTRAP:
+       case TARGET_SIGNAL_INT:
+       case TARGET_SIGNAL_TRAP:
        default:
          status->kind = TARGET_WAITKIND_STOPPED;
-         /* The signal in sigrc is a host signal.  That probably
-            should be fixed.  */
-         status->value.sig = target_signal_from_host (sigrc);
+         status->value.sig = sigrc;
          break;
        }
       break;
     case sim_signalled:
       status->kind = TARGET_WAITKIND_SIGNALLED;
-      /* The signal in sigrc is a host signal.  That probably
-         should be fixed.  */
-      status->value.sig = target_signal_from_host (sigrc);
+      status->value.sig = sigrc;
       break;
     case sim_running:
     case sim_polling:
@@ -742,12 +732,12 @@ gdbsim_prepare_to_store (void)
    Returns the number of bytes transferred. */
 
 static int
-gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
                             int write, struct mem_attrib *attrib,
                             struct target_ops *target)
 {
   if (!program_loaded)
-    error ("No program loaded.");
+    error (_("No program loaded."));
 
   if (sr_get_debug ())
     {
@@ -805,13 +795,13 @@ gdbsim_mourn_inferior (void)
 }
 
 static int
-gdbsim_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
+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, char *contents_cache)
+gdbsim_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
 {
   return memory_remove_breakpoint (addr, contents_cache);
 }
@@ -835,7 +825,7 @@ simulator_command (char *args, int from_tty)
          commands, is restricted to the period when the channel to the
          simulator is open. */
 
-      error ("Not connected to the simulator target");
+      error (_("Not connected to the simulator target"));
     }
 
   sim_do_command (gdbsim_desc, args);
@@ -863,7 +853,7 @@ init_gdbsim_ops (void)
   gdbsim_ops.to_fetch_registers = gdbsim_fetch_register;
   gdbsim_ops.to_store_registers = gdbsim_store_register;
   gdbsim_ops.to_prepare_to_store = gdbsim_prepare_to_store;
-  gdbsim_ops.to_xfer_memory = gdbsim_xfer_inferior_memory;
+  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;
@@ -891,6 +881,6 @@ _initialize_remote_sim (void)
   init_gdbsim_ops ();
   add_target (&gdbsim_ops);
 
-  add_com ("sim <command>", class_obscure, simulator_command,
-          "Send a command to the simulator.");
+  add_com ("sim", class_obscure, simulator_command,
+          _("Send a command to the simulator."));
 }
This page took 0.026517 seconds and 4 git commands to generate.