Summary

[Previous] [Next]

The Visual C++ debugger has many powerful features, and this chapter introduced you to the first set of those features: advanced breakpoints and remote debugging. The most important conclusion you should have drawn is that the debugger can do a considerable amount of work for you if you know how to utilize it effectively. You should strive to make the most of the Visual C++ debugger so that you can minimize the time you spend in it.

Advanced breakpoints help you avoid tedious debugging sessions by allowing you to specify the exact conditions under which a breakpoint triggers. The context part of the advanced breakpoint syntax is what you use to tell the debugger the scope and exact position of the breakpoints. The standard location breakpoint has three modifiers that let you control when the breakpoint will trigger: skip counts, conditional expressions, and variable changes. The other types of breakpoints are the global expression breakpoints and the global data change breakpoints. The global data change breakpoints are the most useful of these two types and let you set a hardware-assisted breakpoint memory location; then when that data location is written to, the breakpoint fires.

Remote debugging is a two-machine debugging solution that's a great addition to your debugging toolkit. It's one of the few ways that you can debug difficult situations such as working with window activation code, handling painting problems, freeing up memory for your application, debugging in Windows 98, and avoiding state changes in the machine.

Another useful addition to your debugging repertoire is the many tips and tricks that help you stretch the uses of the Visual C++ debugger. The Watch window, with its wonderful flexibility, is where you can do amazing things to speed up your debugging. In addition to letting you change your variable values, the Watch window offers all sorts of formatting options so that you can view your data in exactly the way you want to. The Watch window also lets you call functions in your program from the debugger. This feature allows you to create and use special debugging functions to automate your most tedious debugging tasks. Finally, you can also define auto expansion rules for your own types so that with a quick glance you can see the important members of your structures and classes.



Debugging Applications
Debugging Applications for MicrosoftВ® .NET and Microsoft WindowsВ® (Pro-Developer)
ISBN: 0735615365
EAN: 2147483647
Year: 2000
Pages: 122
Authors: John Robbins

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