* config/tc-sparc.c (md_show_usage): Add missing backslash at end
[deliverable/binutils-gdb.git] / gdb / remote-pa.c
index 6d5f0796e8084aba85ad080623fbb7c6e4d9d7d8..3fc422ff5ce3954c9888574585b1e4525c653569 100644 (file)
@@ -15,7 +15,7 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* Remote communication protocol.
 
@@ -135,7 +135,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
        "0* " means the same as "0000".  */
 
 #include "defs.h"
-#include <string.h>
+#include "gdb_string.h"
 #include <fcntl.h>
 #include "frame.h"
 #include "inferior.h"
@@ -160,10 +160,28 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Prototypes for local functions */
 
 static int
-remote_write_bytes PARAMS ((CORE_ADDR memaddr, unsigned char *myaddr, int len));
+remote_remove_breakpoint PARAMS ((CORE_ADDR, char *));
 
 static int
-remote_read_bytes PARAMS ((CORE_ADDR memaddr, unsigned char *myaddr, int len));
+remote_insert_breakpoint PARAMS ((CORE_ADDR, char *));
+
+static void
+remote_mourn PARAMS ((void));
+
+static void
+remote_kill PARAMS ((void));
+
+static int
+read_frame PARAMS ((char *));
+
+static void
+boot_board PARAMS ((char *, int));
+
+static int
+remote_write_bytes PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
+
+static int
+remote_read_bytes PARAMS ((CORE_ADDR memaddr, char *myaddr, int len));
 
 static void
 remote_files_info PARAMS ((struct target_ops *ignore));
@@ -237,10 +255,6 @@ extern struct target_ops remote_ops;       /* Forward decl */
    be plenty.  */
 static int remote_timeout = 2;
 
-#if 0
-int icache;
-#endif
-
 /* Descriptor for I/O to remote machine.  Initialize it to NULL so that
    remote_open knows that we don't have a file open when the program
    starts.  */
@@ -299,6 +313,8 @@ remote_close (quitting)
 
 /* Query the remote side for the text, data and bss offsets. */
 
+#if 0
+
 static void
 get_offsets ()
 {
@@ -354,10 +370,14 @@ get_offsets ()
   objfile_relocate (symfile_objfile, offs);
 }
 
+#endif /* unused */
+
 #define INBUFSIZE 10
 
-void
-boot_board()
+static void
+boot_board (dummy1, dummy2)
+     char *dummy1;
+     int dummy2;
 {
   char c;
   char buf[INBUFSIZE];
@@ -394,8 +414,6 @@ static int
 remote_start_remote (dummy)
      char *dummy;
 {
-  int  timeout;
-
   immediate_quit = 1;          /* Allow user to interrupt it */
 
   /* Ack any packet which the remote side has already sent.  */
@@ -654,7 +672,7 @@ remote_wait (pid, status)
              {
                unsigned char *p1;
 
-               regno = strtol (p, &p1, 16); /* Read the register number */
+               regno = strtol (p, (char **) &p1, 16); /* Read the register number */
 
                if (p1 == p)
                  warning ("Remote sent badly formed register number: %s\nPacket: '%s'\n",
@@ -845,12 +863,11 @@ remote_store_registers (regno)
 
 /* Use of the data cache is disabled because it loses for looking at
    and changing hardware I/O ports and the like.  Accepting `volatile'
-   would perhaps be one way to fix it, but a better way which would
-   win for more cases would be to use the executable file for the text
-   segment, like the `icache' code below but done cleanly (in some
-   target-independent place, perhaps in target_xfer_memory, perhaps
-   based on assigning each target a speed or perhaps by some simpler
-   mechanism).  */
+   would perhaps be one way to fix it.  Another idea would be to use the
+   executable file for the text segment (for all SEC_CODE sections?
+   For all SEC_READONLY sections?).  This has problems if you want to
+   actually see what the memory contains (e.g. self-modifying code,
+   clobbered memory, user downloaded the wrong thing).  */
 
 /* Read a word from remote address ADDR and return it.
    This goes through the data cache.  */
@@ -859,19 +876,6 @@ static int
 remote_fetch_word (addr)
      CORE_ADDR addr;
 {
-#if 0
-  if (icache)
-    {
-      extern CORE_ADDR text_start, text_end;
-
-      if (addr >= text_start && addr < text_end)
-       {
-         int buffer;
-         xfer_core_file (addr, &buffer, sizeof (int));
-         return buffer;
-       }
-    }
-#endif
   return dcache_fetch (remote_dcache, addr);
 }
 
@@ -898,7 +902,7 @@ remote_store_word (addr, word)
 static int
 remote_write_bytes (memaddr, myaddr, len)
      CORE_ADDR memaddr;
-     unsigned char *myaddr;
+     char *myaddr;
      int len;
 {
   char buf[PBUFSIZ];
@@ -946,7 +950,7 @@ remote_write_bytes (memaddr, myaddr, len)
 static int
 remote_read_bytes (memaddr, myaddr, len)
      CORE_ADDR memaddr;
-     unsigned char *myaddr;
+     char *myaddr;
      int len;
 {
   char buf[PBUFSIZ];
@@ -1013,11 +1017,9 @@ remote_xfer_memory(memaddr, myaddr, len, should_write, target)
        xfersize = len;
 
       if (should_write)
-        bytes_xferred = remote_write_bytes (memaddr,
-                                           (unsigned char *)myaddr, xfersize);
+        bytes_xferred = remote_write_bytes (memaddr, myaddr, xfersize);
       else
-       bytes_xferred = remote_read_bytes (memaddr,
-                                          (unsigned char *)myaddr, xfersize);
+       bytes_xferred = remote_read_bytes (memaddr, myaddr, xfersize);
 
       /* If we get an error, we are done xferring.  */
       if (bytes_xferred == 0)
@@ -1214,7 +1216,7 @@ putpkt (buf)
                case '$':
                  if (started_error_output)
                    {
-                     putc_unfiltered ('\n');
+                     putchar_unfiltered ('\n');
                      started_error_output = 0;
                    }
                }
@@ -1245,7 +1247,7 @@ putpkt (buf)
                      started_error_output = 1;
                      printf_unfiltered ("putpkt: Junk: ");
                    }
-                 putc_unfiltered (ch & 0177);
+                 putchar_unfiltered (ch & 0177);
                }
              continue;
            }
@@ -1362,7 +1364,6 @@ getpkt (buf, forever)
      char *buf;
      int forever;
 {
-  char *bp;
   int c;
   int tries;
   int timeout;
@@ -1443,9 +1444,6 @@ remote_mourn ()
    than other targets.  */
 static unsigned char break_insn[] = REMOTE_BREAKPOINT;
 
-/* Check that it fits in BREAKPOINT_MAX bytes.  */
-static unsigned char check_break_insn_size[BREAKPOINT_MAX] = REMOTE_BREAKPOINT;
-
 #else /* No REMOTE_BREAKPOINT.  */
 
 /* Same old breakpoint instruction.  This code does nothing different
@@ -1520,6 +1518,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya) or telnet port.",
   remote_mourn,                        /* to_mourn_inferior */
   0,                           /* to_can_run */
   0,                           /* to_notice_signals */
+  0,                           /* to_thread_alive */
   0,                           /* to_stop */
   process_stratum,             /* to_stratum */
   NULL,                                /* to_next */
This page took 0.026244 seconds and 4 git commands to generate.