
Professional Visual Studio 2005 (2006) [eng]
.pdf

Part IX
Debugging and
Testing
Chapter 48: Using the Debugging Windows
Chapter 49: Debugging Breakpoints
Chapter 50: Debugging Proxies and Visualizers
Chapter 51: Maintaining Web Applications
Chapter 52: Other Debugging Techniques
Chapter 53: Unit Testing


Using the Debugging
Windows
This chapter examines the numerous windows available in Visual Studio 2005 to support you in building and debugging applications. Debugging applications is one of the hardest tasks developers have to tackle, but correct use of the Visual Studio 2005 debugging windows will help you analyze the state of the application and determine the cause of any bugs.
Code Window
The most important window for debugging purposes is, of course, the code window. With the capability to set breakpoints and step through code, this window becomes the basis for nearly all debugging. Figure 48-1 shows a simple snippet of code with both a breakpoint and the current execution point visible.
Breakpoints
The first stage in debugging an application is usually to identify the area that is causing the error by setting a breakpoint and gradually stepping through the code. Setting breakpoints and working with the current execution point is covered in more detail in the next chapter. Although you can’t see the color in Figure 48-1, breakpoints are marked in the code window with a red dot in the margin of the page and red highlighting of the code itself.
When a breakpoint is encountered, the current execution point is marked with a yellow arrow in the margin and the actual code is also highlighted in yellow. As discussed in the next chapter, this marker can be dragged forward and backward to control the order of execution. However, this should be done sparingly because it modifies the behavior of the application.





