* 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 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".
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),
#include "gdb_stat.h"
#include "completer.h"
#include "exceptions.h"
+#include "observer.h"
/* Local function declarations. */
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
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,
error = 1;
break;
}
- write_memory (addr, buffer, length);
+ write_memory_with_notification (addr, buffer, length);
}
GDB_PY_HANDLE_EXCEPTION (except);
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;