|
From: <sv...@va...> - 2008-10-30 13:08:38
|
Author: sewardj
Date: 2008-10-30 13:08:31 +0000 (Thu, 30 Oct 2008)
New Revision: 8719
Log:
Origin tracking: handle 16-bit excess in guest state reads/writes.
This gets rid of the messages "Approx: do_origins_Dirty(R): missed %d
bytes\n" and "Approx: do_origins_Dirty(W): missed %d bytes\n".
Modified:
trunk/memcheck/mc_translate.c
Modified: trunk/memcheck/mc_translate.c
===================================================================
--- trunk/memcheck/mc_translate.c 2008-10-30 11:11:40 UTC (rev 8718)
+++ trunk/memcheck/mc_translate.c 2008-10-30 13:08:31 UTC (rev 8719)
@@ -4174,10 +4174,13 @@
curr = gen_maxU32( mce, curr, here );
toDo -= 4;
}
- if (toDo != 0)
- VG_(printf)("Approx: do_origins_Dirty(R): missed %d bytes\n",
- (Int)toDo );
- //tl_assert(toDo == 0); /* also need to handle 1,2-byte excess */
+ /* handle possible 16-bit excess */
+ while (toDo >= 2) {
+ here = gen_load_b( mce, 2, d->mAddr, d->mSize - toDo );
+ curr = gen_maxU32( mce, curr, here );
+ toDo -= 2;
+ }
+ tl_assert(toDo == 0); /* also need to handle 1-byte excess */
}
/* Whew! So curr is a 32-bit B-value which should give an origin
@@ -4231,10 +4234,12 @@
gen_store_b( mce, 4, d->mAddr, d->mSize - toDo, curr );
toDo -= 4;
}
- if (toDo != 0)
- VG_(printf)("Approx: do_origins_Dirty(W): missed %d bytes\n",
- (Int)toDo );
- //tl_assert(toDo == 0); /* also need to handle 1,2-byte excess */
+ /* handle possible 16-bit excess */
+ while (toDo >= 2) {
+ gen_store_b( mce, 2, d->mAddr, d->mSize - toDo, curr );
+ toDo -= 2;
+ }
+ tl_assert(toDo == 0); /* also need to handle 1-byte excess */
}
}
|