gdb:
authorYao Qi <yao@codesourcery.com>
Sun, 24 Jun 2012 07:28:10 +0000 (07:28 +0000)
committerYao Qi <yao@codesourcery.com>
Sun, 24 Jun 2012 07:28:10 +0000 (07:28 +0000)
* corefile.c (write_memory_with_notification): New.
* gdbcore.h: Declare write_memory_with_notification.
* ada-lang.c (ada_value_assign): Replace 'write_memory' and
'observer_notify_memory_changed' with 'write_memory_with_notification'.
* valops.c (value_assign): Likewise.
* python/py-inferior.c (infpy_write_memory): Call
'write_memory_with_notification'.

gdb/ChangeLog
gdb/ada-lang.c
gdb/corefile.c
gdb/gdbcore.h
gdb/python/py-inferior.c
gdb/valops.c

index 8b0c16dcb2b2cbe326e85d92af6117205116d4c6..817c074e123bff292297944c5a4f3cadea928ee8 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-24  Yao Qi  <yao@codesourcery.com>
+
+       * corefile.c (write_memory_with_notification): New.
+       * gdbcore.h: Declare write_memory_with_notification.
+       * ada-lang.c (ada_value_assign): Replace 'write_memory' and
+       'observer_notify_memory_changed' with 'write_memory_with_notification'.
+       * valops.c (value_assign): Likewise.
+       * python/py-inferior.c (infpy_write_memory): Call
+       'write_memory_with_notification'.
+
 2012-06-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * cc-with-index.sh: Use also -ex "set auto-load no".
index 6f654720645eef3316d50f56b0660684a7b870b7..7afcef8d4a8592f9567d5c10244aa0368c259c73 100644 (file)
@@ -2534,8 +2534,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
       else
         move_bits (buffer, value_bitpos (toval),
                   value_contents (fromval), 0, bits, 0);
-      write_memory (to_addr, buffer, len);
-      observer_notify_memory_changed (to_addr, len, buffer);
+      write_memory_with_notification (to_addr, buffer, len);
 
       val = value_copy (toval);
       memcpy (value_contents_raw (val), value_contents (fromval),
index 611cd62f2b1fbf92f0b735f56a2e0f490f2e4d9d..ac8eff55a6e2559878c001601ed29ca5a41f883f 100644 (file)
@@ -34,6 +34,7 @@
 #include "gdb_stat.h"
 #include "completer.h"
 #include "exceptions.h"
+#include "observer.h"
 
 /* Local function declarations.  */
 
@@ -361,6 +362,16 @@ write_memory (CORE_ADDR memaddr,
     memory_error (status, memaddr);
 }
 
+/* Same as write_memory, but notify 'memory_changed' observers.  */
+
+void
+write_memory_with_notification (CORE_ADDR memaddr, const bfd_byte *myaddr,
+                               ssize_t len)
+{
+  write_memory (memaddr, myaddr, len);
+  observer_notify_memory_changed (memaddr, len, myaddr);
+}
+
 /* Store VALUE at ADDR in the inferior as a LEN-byte unsigned
    integer.  */
 void
index 1081f3f362d74987a56573d38fafc65325595741..d6c9de20e3f22d8c930a790cb8dd217eb8ed62cf 100644 (file)
@@ -86,6 +86,12 @@ CORE_ADDR read_memory_typed_address (CORE_ADDR addr, struct type *type);
 extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
                          ssize_t len);
 
+/* Same as write_memory, but notify 'memory_changed' observers.  */
+
+extern void write_memory_with_notification (CORE_ADDR memaddr,
+                                           const bfd_byte *myaddr,
+                                           ssize_t len);
+
 /* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer.  */
 extern void write_memory_unsigned_integer (CORE_ADDR addr, int len,
                                            enum bfd_endian byte_order,
index efbf14b061c7d7b48b97f2fb163c1b03022494f0..2b229beeda6bdad43d75f3513580a09d91a70c68 100644 (file)
@@ -493,7 +493,7 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
          error = 1;
          break;
        }
-      write_memory (addr, buffer, length);
+      write_memory_with_notification (addr, buffer, length);
     }
   GDB_PY_HANDLE_EXCEPTION (except);
 
index 5002272301c81c5a0c7f4ce237a480ffdb0779ff..97d889b2bcf14e5504e2d75d783faef9712f4714 100644 (file)
@@ -1299,9 +1299,7 @@ value_assign (struct value *toval, struct value *fromval)
            dest_buffer = value_contents (fromval);
          }
 
-       write_memory (changed_addr, dest_buffer, changed_len);
-       observer_notify_memory_changed (changed_addr, changed_len,
-                                       dest_buffer);
+       write_memory_with_notification (changed_addr, dest_buffer, changed_len);
       }
       break;