|
From: Rahul R. <ra...@ya...> - 2004-12-01 10:23:17
|
Hi, I understand that Valgrind simulates a synthetic CPU. Are all the instructions of the client program executed twice (once on the synthetic CPU and once on the real CPU. For example: Will the same a=b+c instruction be executed twice? ) or just once? Thanks, ~Rahul. |
|
From: Nicholas N. <nj...@ca...> - 2004-12-01 10:59:11
|
On Wed, 1 Dec 2004, Rahul Ravindran wrote: > Hi, > I understand that Valgrind simulates a synthetic CPU. Are all the instructions > of the client program executed twice (once on the synthetic CPU and once on the > real CPU. For example: Will the same a=b+c instruction be executed twice? ) or > just once? Just once. The term "synthetic CPU" can be misleading; basically all the original code gets translated and instrumented before being run on the real CPU. None of the original code is run. However, some tools (eg. Memcheck) augment the original code with extra code, so for a single 'add' in the original code, the translated code will do an 'add' plus some associated extra work. HTH N |