|
From: Peter \Firefly\ L. <fi...@di...> - 2003-11-03 11:50:43
|
On Sun, 2 Nov 2003, Avery Pennarun wrote:
> int x;
shouldn't x be volatile in any case?
(otherwise it might be stored in a register at setjmp/longjmp time -- and
they are not required to save/restore registers so when another task
longjmps back to your setjmp x will be trashed)
> if (!setjmp)
> longjmp(elsewhere)
> // else someone longjmped back to me
> VALGRIND_MAKE_READABLE(blah blah)
> printf("x is now %d\n", x);
What you would really like is to save/restore the validity bits for a
whole memory range together with your setjmp/longjmp. A stack of validity
stored bits won't be enough - you'll either need access to some id for
each range (and have valgrind manage the memory) or you'll need some sort
of escape hatch to copy these bits between valgrind and your memory space.
valgrind doesn't provide either at the moment, does it?
-Peter
|