Hexdumping function?

Mike McCormack mike at codeweavers.com
Fri Apr 15 23:29:48 CDT 2005


Benjamin Cutler wrote:
> I'm writing a conformance test for my implementation of powrprof.dll
> that I've been working on, and something I'd like to do in the test is
> dump the contents of some structs to the screen without trying to make
> it pretty. I cobbled together the following function, but I'd like to
> know if there's something like this already so I don't reinvent the wheel:
> 
> void hexdump(void *p, int len) {
>         int i;
>         long *src = (long *)p;
>         len /= 4;
>         for(i = 0; i < len; i++) {
>                 printf("%08lX", src[i]);
>         }
> }

The conformance tests should have no output when they run correctly, so 
use this for your own debugging, but when you've got it right, delete 
the output.  It should only output stuff to complain about a problem.

Silence is golden ... http://www.google.com/search?q=silence+golden+unix

Mike



More information about the wine-devel mailing list