Chapter 7 -- Power Debugging with the Visual Basic Debugger

[Previous] [Next]

Chapter 7

The Microsoft Visual Basic debugger is an interesting beast—developers either love it or hate it. On the positive side, the Visual Basic debugger makes debugging some applications, such as Microsoft ActiveX controls written in Visual Basic, trivial. The Visual Basic debugger is also easy to use. Finally, the Immediate window is a model for what all debuggers should include to make power debugging a snap.

On the negative side, the Visual Basic debugger has some serious problems. The first problem, which happens to be extremely annoying when you're trying to track down difficult bugs over multiple debugging sessions, is that the Visual Basic integrated development environment (IDE) doesn't save your breakpoints or your Watch window watches between sessions. Unfortunately, there's nothing you can do to work around this problem. The second problem, which I'll cover in detail later in this chapter, is that the debugger and the debuggee share the same address space, so when one crashes, the other follows. The final problem is that you're debugging interpreted p-code, which isn't exactly what your users will be running.

In this chapter, I'll explain how the Visual Basic debugger works and offer some recommendations for getting around its limitations with your sanity intact. I'll start by defining what it means to debug in Visual Basic. Then I'll go over the error trapping options and show you how to get the most out of the Locals, Immediate, and Watch windows. Finally, as I did in the chapters on the Microsoft Visual C++ debugger, I'll provide some tips and tricks to maximize your debugging pleasure.



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