For just about every programming language there's an IDE with a debugger and a profiler, and some profilers generate call graphs, which sounds like what you're after.
For C, for example, there's the venerable gprof: http://sourceware.org/binutils/docs/gprof/index.html, for PHP there's xhprof: http://mirror.facebook.net/facebook/xhprof/doc.html, and there's one for Microsoft Visual Studio as well: http://msdn.microsoft.com/en-us/magazine/cc337887.aspx.
If you're only interested in particular function calls and changes to particular variables, then it might actually be better to add code yourself to dump lines with interesting events to a logfile while your program runs and then use a script to convert the log lines into a DOT file (http://en.wikipedia.org/wiki/DOT_language), and use graphviz (http://www.graphviz.org) or Omnigraffle (http://www.omnigroup.com/applications/OmniGraffle/) to generate pretty pictures for you.
Good luck.