ruby: better debug print for DataBlock
authorDerek Hower <drh5@cs.wisc.edu>
Sat, 18 Jul 2009 21:58:33 +0000 (16:58 -0500)
committerDerek Hower <drh5@cs.wisc.edu>
Sat, 18 Jul 2009 21:58:33 +0000 (16:58 -0500)
src/mem/ruby/common/DataBlock.hh

index 2a0811f765af12625cc600cd103c8b66be4cb509..ccd73c36bd3ac4729d86adf8151a31f82f843771 100644 (file)
@@ -108,8 +108,8 @@ void DataBlock::print(ostream& out) const
 {
   int size = RubySystem::getBlockSizeBytes();
   out << "[ ";
-  for (int i = 0; i < size; i+=4) {
-    out << hex << *((uint32*)(&(m_data[i]))) << " ";
+  for (int i = 0; i < size; i++) {
+    out << setw(2) << setfill('0') << hex << "0x" << (int)m_data[i] << " ";
   }
   out << dec << "]" << flush;
 }