CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    381

    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

  2. #2
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: See the execution path of my program


  3. #3
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: See the execution path of my program

    you can use Environment.StackTrace to get the current stack trace.

    Code:
    MessageBox.Show(Environment.StackTrace);

  4. #4
    Join Date
    May 2007
    Posts
    1,546

    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.

  5. #5
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    381

    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
  •  





Click Here to Expand Forum to Full Width

Featured