views:

170

answers:

2

How to view stack trace of project in debug mode in VS 2008?

I am running and debugging a big application in VS2008. Build mode is DEBUG, Windows Forms project. Is there a way I can see the pieces of codes getting called, something like Stack Trace in exception while i do normal actions in the form like clicking button, etc...

The project is so big I need to easily find the form being called on each nodes on the tree. It would be very helpful if I can see the something like Call Stack Trace. Call Stack is not working like this btw.

Thanks.

+2  A: 

Menu: Debug, Windows, Call Stack.

But you say "it is not working", could you elaborate a little?

Henk Holterman
I think the OP is asking about being able to view a call stack as the program is actually running. I could be wong but I believe you have to break into your program for the VS Call stack to be populated (ie it is not updated dynamically).
Ash
Ash, a 'real-time' call stack would slow down a program enormously and be too fast to read at the same time.
Henk Holterman
Henk, maybe, but I believe that is what the OP means by "it is not working".
Ash
A: 

Sounds like you want some sort of static or dynamic program analysis tool. Here is a good list of some of the more popular tools available for .NET.

Dynamic analysis programs allow you to run the the program and record the class construction and call hierarchy of your application on the fly, for later review.

Static analysis programs require you to point the program at your source code and then build a similar but possibly more exhaustive analysis of your call hierarchy.

See also: What static analysis tools are available for c#

Ash
Sorry for all the confusion but your answer is very close to what i want to achieve. A tool for dynamic analysis where i can see each code being execute as i do all he UI interactions in the winform application.
Rodel Dagumampan
Why do i need this?A big application is handed over to my team and for start we need to study it, upto the code level. Of course we have no idea where things are placed. Breakpoints works only if you know where to put break breakpoints. But in the case where you have no idea what forms in the hundreds of forms and classes in several solutions is loaded, it will be easy like seeing what gets executed for every click.
Rodel Dagumampan
@Rodel, Yes, code analysis tools are very useful when you are dumped with a large application with no/little documentation. It makes no difference whether it is a Windows Forms application, WPF, etc. You also learn where the program spends most of it's time, which also indicates more complex or possibly poorly designed code. Good luck.
Ash
What application is capable of this behaviour?"Dynamic analysis programs allow you to run the the program and record the class construction and call hierarchy of your application on the fly, for later review."
Rodel Dagumampan
NDepend, Visual Studio Team Edition Profiler and many others. The choicedepends how much and what sort of dynamic information you are looking for.
Ash