Section 9.4. The Call Stack


9.4. The Call Stack

As you step in and out of methods , the Call Stack window keeps track of the order and hierarchy of method calls . Figure 9-15 shows a close-up picture of the Call Stack window. You can see that the Time constructor was called by the Run( ) method, while the Run( ) method was in turn called by Main( ) .

Figure 9-15. The Call Stack window

In this case, if you double-click on the second line in the Call Stack window, the debugger shows you the line in Run( ) that called the Time constructor, as shown in Figure 9-16. Notice that the debugger puts a curved arrow on the line in the call stack you've double-clicked on, and a matching arrow in the editor to the line that corresponds to that call. This way, if you're debugging a method, and you think that the data causing the problem came from outside the method, you can quickly find where the method call came from, and check the values at that point.



Learning C# 2005
Learning C# 2005: Get Started with C# 2.0 and .NET Programming (2nd Edition)
ISBN: 0596102097
EAN: 2147483647
Year: 2004
Pages: 250

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net