diff options
author | Yao Qi <yao@codesourcery.com> | 2013-10-31 15:01:33 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-11-20 11:40:48 +0800 |
commit | f2de978509eb51f85410eab04696725f0bccf9c3 (patch) | |
tree | 3569419944f610265fc507008edb6cfe35392b45 | |
parent | 2a2f9fe4007a0135ac091878dc7000f91e75e339 (diff) | |
download | gdb-f2de978509eb51f85410eab04696725f0bccf9c3.zip gdb-f2de978509eb51f85410eab04696725f0bccf9c3.tar.gz gdb-f2de978509eb51f85410eab04696725f0bccf9c3.tar.bz2 |
Don't update target_dcache if it is not initialized
After previous patch, 'target_dcache' is initialized lazily. It is
possible that 'target_dcache' is still NULL when GDB writes to memory.
In this case, update to 'target_dcache' can be skipped.
gdb:
2013-11-20 Yao Qi <yao@codesourcery.com>
* target.c (memory_xfer_partial_1): Update 'target_dcache' if
it is initialized.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/target.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9de86a3..78a871f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-11-20 Yao Qi <yao@codesourcery.com> + * target.c (memory_xfer_partial_1): Update 'target_dcache' if + it is initialized. + +2013-11-20 Yao Qi <yao@codesourcery.com> + * dcache.c (last_cache): Remove. (dcache_free, dcache_init): Update. (dcache_update): diff --git a/gdb/target.c b/gdb/target.c index cb75853..2c0096e 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1667,11 +1667,12 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object, if (res > 0 && inf != NULL && writebuf != NULL + && target_dcache_init_p () && !region->attrib.cache && stack_cache_enabled_p && object != TARGET_OBJECT_STACK_MEMORY) { - DCACHE *dcache = target_dcache_get_or_init (); + DCACHE *dcache = target_dcache_get (); dcache_update (dcache, memaddr, (void *) writebuf, res); } |