aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ.T. Conklin <jtc@acorntoolworks.com>2001-04-06 22:43:55 +0000
committerJ.T. Conklin <jtc@acorntoolworks.com>2001-04-06 22:43:55 +0000
commitc839c4db61a73535746c9a8f52e127c100c600ca (patch)
tree09a6964882402d9469603cc4499cf364006cfd77
parentaf471f3cf4c701963e0771d904ed9f86d02c1cb8 (diff)
downloadgdb-c839c4db61a73535746c9a8f52e127c100c600ca.zip
gdb-c839c4db61a73535746c9a8f52e127c100c600ca.tar.gz
gdb-c839c4db61a73535746c9a8f52e127c100c600ca.tar.bz2
* dcache.c (dcache_write_line): Fixed bugs where cache line was
not written to target correctly.
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/dcache.c13
2 files changed, 12 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 20de0be..95a30ef 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2001-04-06 J.T. Conklin <jtc@redback.com>
+ * dcache.c (dcache_write_line): Fixed bugs where cache line was
+ not written to target correctly.
+
* gdbserver/low-hppabsd.c (read_inferior_memory): Add explicit
void return value;
* gdbserver/low-nbsd.c: Likewise.
diff --git a/gdb/dcache.c b/gdb/dcache.c
index d6268f7..6e74274 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -278,20 +278,24 @@ dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
while (reg_len > 0)
{
s = XFORM(memaddr);
- do {
+ while (reg_len > 0) {
if (db->state[s] == ENTRY_DIRTY)
break;
s++;
reg_len--;
- } while (reg_len > 0);
+
+ memaddr++;
+ myaddr++;
+ len--;
+ }
e = s;
- do {
+ while (reg_len > 0) {
if (db->state[e] != ENTRY_DIRTY)
break;
e++;
reg_len--;
- } while (reg_len > 0);
+ }
dirty_len = e - s;
while (dirty_len > 0)
@@ -304,6 +308,7 @@ dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
memset (&db->state[XFORM(memaddr)], ENTRY_OK, res);
memaddr += res;
myaddr += res;
+ len -= res;
dirty_len -= res;
}
}