gdb/
authorPedro Alves <palves@redhat.com>
Fri, 28 Jan 2011 16:00:16 +0000 (16:00 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 28 Jan 2011 16:00:16 +0000 (16:00 +0000)
* target.c (memory_xfer_partial): No need to restore shadows if we
haven't read anything.

gdb/ChangeLog
gdb/target.c

index 8b07d70..aab7ed1 100644 (file)
@@ -1,5 +1,10 @@
 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
 
+       * target.c (memory_xfer_partial): No need to restore shadows if we
+       haven't read anything.
+
+2011-01-28  Pedro Alves  <pedro@codesourcery.com>
+
        * mips-tdep.c (mips_print_register): Use get_frame_register_value
        and val_print_scalar_formatted.
 
index 710af02..ad695a1 100644 (file)
@@ -1414,7 +1414,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
     }
   while (ops != NULL);
 
-  if (readbuf && !show_memory_breakpoints)
+  if (res > 0 && readbuf != NULL && !show_memory_breakpoints)
     breakpoint_restore_shadows (readbuf, memaddr, reg_len);
 
   /* Make sure the cache gets updated no matter what - if we are writing