From f2de978509eb51f85410eab04696725f0bccf9c3 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Thu, 31 Oct 2013 15:01:33 +0800 Subject: 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 * target.c (memory_xfer_partial_1): Update 'target_dcache' if it is initialized. --- gdb/ChangeLog | 5 +++++ gdb/target.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 + * target.c (memory_xfer_partial_1): Update 'target_dcache' if + it is initialized. + +2013-11-20 Yao Qi + * 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); } -- cgit v1.1