Hi Derek,

Has Nate mentioned his cprintf package to you?  It's basically a
type-safe C++ printf, which most of us find much nicer than C++ stream
I/O, particularly if you have to do a lot of formatting.  I don't
consider it a major integration issue (like integrating statistics or
debugging), but we use it almost exclusively in m5, and for
consistency it would be nice to see the Ruby code base shift over time
as well.

Steve

On Mon, Jul 20, 2009 at 8:11 AM, Derek Hower<d...@cs.wisc.edu> wrote:
> changeset c4e91b8e3da3 in /z/repo/m5
> details: http://repo.m5sim.org/m5?cmd=changeset;node=c4e91b8e3da3
> description:
>        ruby: better debug print for DataBlock
>
> diffstat:
>
> 1 file changed, 2 insertions(+), 2 deletions(-)
> src/mem/ruby/common/DataBlock.hh |    4 ++--
>
> diffs (14 lines):
>
> diff -r c6254810bb6c -r c4e91b8e3da3 src/mem/ruby/common/DataBlock.hh
> --- a/src/mem/ruby/common/DataBlock.hh  Sat Jul 18 16:54:45 2009 -0500
> +++ b/src/mem/ruby/common/DataBlock.hh  Sat Jul 18 16:58:33 2009 -0500
> @@ -108,8 +108,8 @@
>  {
>   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;
>  }
> _______________________________________________
> m5-dev mailing list
> m5-dev@m5sim.org
> http://m5sim.org/mailman/listinfo/m5-dev
>
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to