290 Embedded Linux System Design and Development
The Valgrind architecture can be decomposed into two layers: the core
and the skins. The core is the x86 simulator that translates all the executable
code into its own opcode. The translated opcode is then instrumented and
executed on the real CPU. The instrumentation depends on the skin type
chosen. The architecture of Valgrind is very modular allowing a new skin to
be plugged easily with the core.
We focus our attention on the memory checker skin, memcheck. This is
the default skin used by Valgrind (any other skin has to be specifically invoked
using the command line argument
--skin). Memcheck works by associating
every byte of working memory with two values: the V (valid value) bit and
the A (valid address) ...