Click here to Skip to main content
15,903,175 members
Articles / All Topics

Help Yourself in Debugging by Using Call Stack and Immediate Window

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
25 Jul 2011CPOL2 min read 13.9K   3  
Help yourself in debugging by using call stack and immediate window

In this post, I am going to show you the two important windows of Visual Studio which are useful when you are debugging the project and to get the result on the fly during debug.

Call Stack Window

Most developers get confused when they are debugging application "From which function call came from up to my debug point", this happens when they are working the code design by someone else or debugging code of the DLL.

Following is one common scenario which I notice that is done a number of times by developers.

In the three tier application, developers always put the break point in presentation layer when the break point gets hit, they always check the data and they wonder which business layer method is called >> database layer method gets called by presentation layer to get this data.

The Solution is Call Stack Window which is part of the Visual Studio. Shortcut for it is Ctrl + Alt + C or go to menu Debug >> Windows >> Call Stack

Image 1

Image 2

As you can see the image with the help of the Call Stack Window, you will get information about the method that gets called, what is parameter value, line number of the method in file, is it external call or internal, programming language in which method is written.

Immediate Window

It always happens that in the middle of debugging, you want to execute some set of statements or some set of functions or want to check the value of the variable. But as a beginner, you don't know how to do it at the time of debugging.

You can open up the Immediate window by shortcut Ctrl + Alt + I or go to menu Debug >> Windows >> Immediate Window.

Image 3

Image 4

Immediate window has intelligence support as we have in the Coding window of the Visual Studio so that you can easily make use of the function, which makes your task easy.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India

Microsoft C# MVP (12-13)



Hey, I am Pranay Rana, working as a Team Leadin MNC. Web development in Asp.Net with C# and MS sql server are the experience tools that I have had for the past 5.5 years now.

For me def. of programming is : Programming is something that you do once and that get used by multiple for many years

You can visit my blog


StackOverFlow - http://stackoverflow.com/users/314488/pranay
My CV :- http://careers.stackoverflow.com/pranayamr

Awards:



Comments and Discussions

 
-- There are no messages in this forum --