Don't allow non-stack memory writes in the prologue for nios2.
[deliverable/binutils-gdb.git] / gdb / remote-mips.c
index 1f1650e22e7407fd79ed8e3aef73d9e1df1feacb..143e5fda7d948a1c904c5ea34e4bb1487b39a152 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote debugging interface for MIPS remote debugging protocol.
 
-   Copyright (C) 1993-2014 Free Software Foundation, Inc.
+   Copyright (C) 1993-2015 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by Ian Lance Taylor
    <ian@cygnus.com>.
@@ -29,7 +29,6 @@
 #include "gdbcore.h"
 #include "serial.h"
 #include "target.h"
-#include "exceptions.h"
 #include <sys/stat.h>
 #include "gdb_usleep.h"
 #include "regcache.h"
@@ -847,7 +846,7 @@ mips_send_packet (const char *s, int get_ack)
   /* unsigned */ int len;
   unsigned char *packet;
   int cksum;
-  int try;
+  int attempt;
 
   len = strlen (s);
   if (len > DATA_MAXLEN)
@@ -874,7 +873,7 @@ mips_send_packet (const char *s, int get_ack)
   /* We can only have one outstanding data packet, so we just wait for
      the acknowledgement here.  Keep retransmitting the packet until
      we get one, or until we've tried too many times.  */
-  for (try = 0; try < mips_send_retries; try++)
+  for (attempt = 0; attempt < mips_send_retries; attempt++)
     {
       int garbage;
       int ch;
@@ -2232,7 +2231,8 @@ mips_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
       /* Copy appropriate bytes out of the buffer.  */
       memcpy (readbuf, buffer + (memaddr & 3), len);
     }
-  return len;
+  *xfered_len = len;
+  return TARGET_XFER_OK;
 }
 
 /* Target to_xfer_partial implementation.  */
@@ -2374,8 +2374,11 @@ mips_insert_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch,
                        struct bp_target_info *bp_tgt)
 {
   if (monitor_supports_breakpoints)
-    return mips_set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
-                               BREAK_FETCH);
+    {
+      bp_tgt->placed_address = bp_tgt->reqstd_address;
+      return mips_set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
+                                 BREAK_FETCH);
+    }
   else
     return memory_insert_breakpoint (ops, gdbarch, bp_tgt);
 }
This page took 0.024552 seconds and 4 git commands to generate.