* mem-break.c (inc_ref_fast_tracepoint_jump): New.
[deliverable/binutils-gdb.git] / gdb / gdbserver / mem-break.c
index 56ff40684525fb1618c632f1219ca4065acf541f..a6c8ce65f6b39d373b07c04a3910c8078af0da57 100644 (file)
@@ -302,6 +302,12 @@ delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel)
   return ENOENT;
 }
 
+void
+inc_ref_fast_tracepoint_jump (struct fast_tracepoint_jump *jp)
+{
+  jp->refcount++;
+}
+
 struct fast_tracepoint_jump *
 set_fast_tracepoint_jump (CORE_ADDR where,
                          unsigned char *insn, ULONGEST length)
@@ -357,7 +363,8 @@ set_fast_tracepoint_jump (CORE_ADDR where,
      the current shadow contents, because write_inferior_memory
      updates any shadow memory with what we pass here, and we want
      that to be a nop.  */
-  err = write_inferior_memory (where, fast_tracepoint_jump_shadow (jp), length);
+  err = write_inferior_memory (where, fast_tracepoint_jump_shadow (jp),
+                              length);
   if (err != 0)
     {
       if (debug_threads)
@@ -1028,7 +1035,8 @@ check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
 }
 
 void
-check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
+check_mem_write (CORE_ADDR mem_addr, unsigned char *buf,
+                const unsigned char *myaddr, int mem_len)
 {
   struct process_info *proc = current_process ();
   struct raw_breakpoint *bp = proc->raw_breakpoints;
@@ -1062,7 +1070,7 @@ check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
       buf_offset = start - mem_addr;
 
       memcpy (fast_tracepoint_jump_shadow (jp) + copy_offset,
-             buf + buf_offset, copy_len);
+             myaddr + buf_offset, copy_len);
       if (jp->inserted)
        memcpy (buf + buf_offset,
                fast_tracepoint_jump_insn (jp) + copy_offset, copy_len);
@@ -1091,7 +1099,7 @@ check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
       copy_offset = start - bp->pc;
       buf_offset = start - mem_addr;
 
-      memcpy (bp->old_data + copy_offset, buf + buf_offset, copy_len);
+      memcpy (bp->old_data + copy_offset, myaddr + buf_offset, copy_len);
       if (bp->inserted)
        {
          if (validate_inserted_breakpoint (bp))
This page took 0.026257 seconds and 4 git commands to generate.