* gdb/defs.h: unconditionally include <fcntl.h>, and
[deliverable/binutils-gdb.git] / gdb / remote-rdp.c
index a9dba9ab4013cf965160964b18dbcf364cd650df..54eaf778cddd47aba1231faad37303300bb17816 100644 (file)
@@ -1,7 +1,7 @@
 /* Remote debugging for the ARM RDP interface.
 
-   Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002 Free Software
-   Foundation, Inc.
+   Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2006
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -17,8 +17,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.  
 
 
  */
@@ -193,7 +193,7 @@ get_byte (void)
       if (timeout == 0)
        return (unsigned char) c;
 
-      error ("Timeout reading from remote_system");
+      error (_("Timeout reading from remote_system"));
     }
 
   return c;
@@ -352,11 +352,29 @@ rdp_init (int cold, int tty)
                  case SERIAL_TIMEOUT:
                    break;
                  case RDP_RES_VALUE_LITTLE_ENDIAN:
+#if 0
+                   /* FIXME: cagney/2003-11-22: Ever since the ARM
+                       was multi-arched (in 2002-02-08), this
+                       assignment has had no effect.  There needs to
+                       be some sort of check/decision based on the
+                       current architecture's byte-order vs the remote
+                       target's byte order.  For the moment disable
+                       the assignment to keep things building.  */
                    target_byte_order = BFD_ENDIAN_LITTLE;
+#endif
                    sync = 1;
                    break;
                  case RDP_RES_VALUE_BIG_ENDIAN:
+#if 0
+                   /* FIXME: cagney/2003-11-22: Ever since the ARM
+                       was multi-arched (in 2002-02-08), this
+                       assignment has had no effect.  There needs to
+                       be some sort of check/decision based on the
+                       current architecture's byte-order vs the remote
+                       target's byte order.  For the moment disable
+                       the assignment to keep things building.  */
                    target_byte_order = BFD_ENDIAN_BIG;
+#endif
                    sync = 1;
                    break;
                  default:
@@ -369,12 +387,12 @@ rdp_init (int cold, int tty)
 
   if (!sync)
     {
-      error ("Couldn't reset the board, try pressing the reset button");
+      error (_("Couldn't reset the board, try pressing the reset button"));
     }
 }
 
 
-void
+static void
 send_rdp (char *template,...)
 {
   char buf[200];
@@ -436,10 +454,10 @@ send_rdp (char *template,...)
              printf_unfiltered ("RDP: Unimplemented message\n");
              return;
            case 255:
-             error ("Command garbled");
+             error (_("Command garbled"));
              break;
            default:
-             error ("Corrupt reply from target");
+             error (_("Corrupt reply from target"));
              break;
            }
          break;
@@ -477,13 +495,13 @@ send_rdp (char *template,...)
          *pi = get_byte ();
          break;
        default:
-         internal_error (__FILE__, __LINE__, "failed internal consistency check");
+         internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
        }
     }
   va_end (alist);
 
   if (dst != buf)
-    internal_error (__FILE__, __LINE__, "failed internal consistency check");
+    internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
 }
 
 
@@ -612,7 +630,7 @@ remote_rdp_fetch_register (int regno)
     }
   else
     {
-      char buf[ARM_MAX_REGISTER_RAW_SIZE];
+      char buf[MAX_REGISTER_SIZE];
       if (regno < 15)
        rdp_fetch_one_register (1 << regno, buf);
       else if (regno == ARM_PC_REGNUM)
@@ -627,7 +645,7 @@ remote_rdp_fetch_register (int regno)
        {
          printf ("Help me with fetch reg %d\n", regno);
        }
-      supply_register (regno, buf);
+      regcache_raw_supply (current_regcache, regno, buf);
     }
 }
 
@@ -642,7 +660,7 @@ remote_rdp_store_register (int regno)
     }
   else
     {
-      char tmp[ARM_MAX_REGISTER_RAW_SIZE];
+      char tmp[MAX_REGISTER_SIZE];
       deprecated_read_register_gen (regno, tmp);
       if (regno < 15)
        rdp_store_one_register (1 << regno, tmp);
@@ -703,7 +721,7 @@ rdp_set_command_line (char *command, char *args)
   if (commandline != NULL)
     xfree (commandline);
 
-  xasprintf (&commandline, "%s %s", command, args);
+  commandline = xstrprintf ("%s %s", command, args);
 }
 
 static void
@@ -773,9 +791,6 @@ argsin;
 #define SWI_GenerateError               0x71
 
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
 
 static int translate_open_mode[] =
 {
@@ -970,7 +985,7 @@ handle_swi (void)
          break;
 
        default:
-         error ("Unimplemented SWI argument");
+         error (_("Unimplemented SWI argument"));
        }
 
       type = type >> 2;
@@ -1035,7 +1050,7 @@ rdp_execute (void)
 }
 
 static int
-remote_rdp_insert_breakpoint (CORE_ADDR addr, char *save)
+remote_rdp_insert_breakpoint (CORE_ADDR addr, bfd_byte *save)
 {
   int res;
   if (ds.rdi_level > 0)
@@ -1059,7 +1074,7 @@ remote_rdp_insert_breakpoint (CORE_ADDR addr, char *save)
 }
 
 static int
-remote_rdp_remove_breakpoint (CORE_ADDR addr, char *save)
+remote_rdp_remove_breakpoint (CORE_ADDR addr, bfd_byte *save)
 {
   int res;
   if (ds.rdi_level > 0)
@@ -1108,7 +1123,7 @@ remote_rdp_open (char *args, int from_tty)
   int not_icebreaker;
 
   if (!args)
-    error_no_arg ("serial port device name");
+    error_no_arg (_("serial port device name"));
 
   baud_rate = 9600;
 
@@ -1163,7 +1178,7 @@ remote_rdp_open (char *args, int from_tty)
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  print_stack_frame (get_selected_frame (), -1, 1);
+  print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
 }
 
 
@@ -1333,12 +1348,13 @@ remote_rdp_files_info (struct target_ops *target)
 
 
 static void
-remote_rdp_create_inferior (char *exec_file, char *allargs, char **env)
+remote_rdp_create_inferior (char *exec_file, char *allargs, char **env,
+                           int from_tty)
 {
   CORE_ADDR entry_point;
 
   if (exec_file == 0 || exec_bfd == 0)
-    error ("No executable file specified.");
+    error (_("No executable file specified."));
 
   entry_point = (CORE_ADDR) bfd_get_start_address (exec_bfd);
 
@@ -1357,8 +1373,7 @@ remote_rdp_create_inferior (char *exec_file, char *allargs, char **env)
      ** so we don't bother to look for MEMSIZE in the environment.
    */
 
-  /* Let's go! */
-  proceed (entry_point, TARGET_SIGNAL_DEFAULT, 0);
+  write_pc (entry_point);
 }
 
 /* Attach doesn't need to do anything */
@@ -1386,7 +1401,7 @@ init_remote_rdp_ops (void)
   remote_rdp_ops.to_fetch_registers = remote_rdp_fetch_register;
   remote_rdp_ops.to_store_registers = remote_rdp_store_register;
   remote_rdp_ops.to_prepare_to_store = remote_rdp_prepare_to_store;
-  remote_rdp_ops.to_xfer_memory = remote_rdp_xfer_inferior_memory;
+  remote_rdp_ops.deprecated_xfer_memory = remote_rdp_xfer_inferior_memory;
   remote_rdp_ops.to_files_info = remote_rdp_files_info;
   remote_rdp_ops.to_insert_breakpoint = remote_rdp_insert_breakpoint;
   remote_rdp_ops.to_remove_breakpoint = remote_rdp_remove_breakpoint;
@@ -1403,6 +1418,8 @@ init_remote_rdp_ops (void)
   remote_rdp_ops.to_magic = OPS_MAGIC;
 }
 
+extern initialize_file_ftype _initialize_remote_rdp; /* -Wmissing-prototypes */
+
 void
 _initialize_remote_rdp (void)
 {
This page took 0.028561 seconds and 4 git commands to generate.