I have a JIT. I set up a watchpoint (watch
-- so it should trigger only on a write) to the jitted code of a function (all of it) as in this answer. And I provide --vgdb=full
to valgrind which means all instructions have to be instrumented and I should see execution stopped precisely where the stop happened.
However the watchpoint triggers several times in the middle of the function being watched. I noticed that the instructions at which execution stops are basic block entry points (they all follow either a jump
or a call
or it's the first instruction of my function).
I don't see actual write to the watched memory upon the watchpoint firing. So does valgrind consider execution of this memory (some of it) a write? Or is it some other valgrind weirdness, or is it just me?
Please, clarify.
My valgrind version is 3.10.0.SVN, gdb is 7.7.1 (Ubuntu 7.7.1-0ubuntu5~14.04.2).