|
-
February 16th, 2009, 11:18 AM
#1
See the execution path of my program
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:
Code:
StackTrace s = new StackTrace();
CallAMettodThatDoesALotOfOtherCalls();
s.PrintAllCalledMethodsInAnEasyToReadWay();
Any tip on code/tool that manages that?
...and justice for all
-
February 16th, 2009, 12:50 PM
#2
Re: See the execution path of my program
-
February 16th, 2009, 02:10 PM
#3
Re: See the execution path of my program
you can use Environment.StackTrace to get the current stack trace.
Code:
MessageBox.Show(Environment.StackTrace);
-
February 16th, 2009, 02:58 PM
#4
Re: See the execution path of my program
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.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
February 18th, 2009, 02:39 AM
#5
Re: See the execution path of my program
I'll take a look at log4net and ANTS Profiler.
...and justice for all
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|