This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 02/10] Don't update target_dcache if it is not initialized
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Sun, 3 Nov 2013 13:54:02 +0800
- Subject: [PATCH 02/10] Don't update target_dcache if it is not initialized
- Authentication-results: sourceware.org; auth=none
- References: <1383458049-20893-1-git-send-email-yao at codesourcery dot com>
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-02 Yao Qi <yao@codesourcery.com>
* target.c (memory_xfer_partial_1): Update 'target_dcache' if
it is initialized.
---
gdb/target.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gdb/target.c b/gdb/target.c
index 6403e86..1a076f3 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);
}
--
1.7.7.6