diff options
author | Yao Qi <yao@codesourcery.com> | 2012-06-24 07:28:10 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-06-24 07:28:10 +0000 |
commit | 972daa01e2ee0a5c41e1dd45a71ad398c9266af8 (patch) | |
tree | 7e71907c31591615f449be8d88c3c99fb068076d | |
parent | 8d6e0714b7f1919bfe3720e8d0417708f00ae1ba (diff) | |
download | gdb-972daa01e2ee0a5c41e1dd45a71ad398c9266af8.zip gdb-972daa01e2ee0a5c41e1dd45a71ad398c9266af8.tar.gz gdb-972daa01e2ee0a5c41e1dd45a71ad398c9266af8.tar.bz2 |
gdb:
* 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'.
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/ada-lang.c | 3 | ||||
-rw-r--r-- | gdb/corefile.c | 11 | ||||
-rw-r--r-- | gdb/gdbcore.h | 6 | ||||
-rw-r--r-- | gdb/python/py-inferior.c | 2 | ||||
-rw-r--r-- | gdb/valops.c | 4 |
6 files changed, 30 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8b0c16d..817c074 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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". diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6f65472..7afcef8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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), diff --git a/gdb/corefile.c b/gdb/corefile.c index 611cd62..ac8eff5 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -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 diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h index 1081f3f..d6c9de2 100644 --- a/gdb/gdbcore.h +++ b/gdb/gdbcore.h @@ -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, diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index efbf14b..2b229be 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -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); diff --git a/gdb/valops.c b/gdb/valops.c index 5002272..97d889b 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -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; |