is there a tool to log the code execution?
<p>Let's say I have a program made of several "basic" algorithms on integral variables, such as :</p>

<pre><code>if(a&lt;b)
   a += c;
</code></pre>

<p>Is there a tool that would allow me to automatically log all the changes made to the different variables at run time?</p>

<p>For instance it would display in that case in a log file:</p>

<pre><code> "condition passed because 5=a &lt; b=10
     a += 10; because c=10"
</code></pre>

<p>or some equivalent.</p>

<p>I am aware that I could manually log each operation but that would be much too complex.
Is there any tool that would allow me to do something like that? I don't care about refactoring / recompiling as long as it's not totally manual.</p>
