Click to See Complete Forum and Search --> : See the execution path of my program


d00_ape
February 16th, 2009, 10:18 AM
I’m a new developer in a very complex project. I like to create a program that can plot the methods that is executing in the program to get a fast view of what is calling what. Of course I can debug the program but the best way right now is to write some code like this:
StackTrace s = new StackTrace();
CallAMettodThatDoesALotOfOtherCalls();
s.PrintAllCalledMethodsInAnEasyToReadWay();
Any tip on code/tool that manages that?

dannystommen
February 16th, 2009, 11:50 AM
You could use log4net

http://logging.apache.org/log4net/index.html

eclipsed4utoo
February 16th, 2009, 01:10 PM
you can use Environment.StackTrace to get the current stack trace.


MessageBox.Show(Environment.StackTrace);

Mutant_Fruit
February 16th, 2009, 01:58 PM
There's no built in way to achieve this. What you probably want is to run your application through a performance or memory profiler. They can (generally speaking) show you which function gets called by which other function.

d00_ape
February 18th, 2009, 01:39 AM
I'll take a look at log4net and ANTS Profiler.