|
From: Alex B. <ker...@be...> - 2006-07-11 16:55:30
|
Hi,
Not that I want to seem as though I'm monopolising the mailing list
today could I suggest an additional variant of the very useful
VALGRIND_CHECK_VALUE_IS_DEFINED() that does return a value on failure.
This would be useful for programs dumping internal state when something
goes wrong.
I have hacked something together using VALGRIND_CHECK_MEM_IS_DEFINED:
if (VALGRIND_CHECK_MEM_IS_DEFINED(&a,sizeof(MyThing)) ||
VALGRIND_CHECK_MEM_IS_DEFINED(&b,sizeof(MyThing)))
{
fprintf(stderr, "orRRR pc=0x%lx a=%d/%d, b = %d/%d\n",currentPc,
rs1,MyClass::gprToRegisterID(rs1),
rs2,MyClass::gprToRegisterID(rs2));
}
But it seems a little in-elegant somehow.
One really handy ability for use would be to dump the Valgrind binding
stream in a generated function (say in Jit'ed code). However looking at
how the binding and inline assembler I suspect this will be tricky to do
in a portable way. I'll see if I can get anything sensible working when
I've got some spare time.
--
Alex, homepage: http://www.bennee.com/~alex/
May a Misguided Platypus lay its Eggs in your Jockey Shorts
|