NetBeans: The Definitive Guide
by Tim Boudreau, Jesse Glick, Simeon Greene, Vaughn Spurlin, Jack J. Woehr
Chapter 4. Debugging
Debugger Types
Real programmers know that watching their applications run smoothly isn’t nearly as much fun as just getting them to run in the first place. The best part is seeing what’s going on under the hood. Don’t you just love to watch the threads weaving around, and the values in one variable affecting another like a chain of dominos falling over? Well, the people at NetBeans understand, so they created some great debugging features. In the event that you make a programming error and can’t immediately see what’s wrong, you can use these debugging features to find out what’s really going on. But I’m sure you’re more careful than that, so just think of debugging as a fun diversion from writing code. Here are some of the ways you can play with the inner workings of your programs while they’re running:
Set breakpoints
Watch values change for variables and expressions
Examine and modify variable values
Step through code, line by line
Examine running threads, classes, and the callstack
Run several debugging sessions at the same time
Actually, the same user interface supports a choice of backend debugging facilities. The Java Platform Debugger Architecture (JPDA) is the default. Be sure to specify the right debugger type for the object to be debugged; these types are delineated in Table 4-1.
Table 4-1. Debugger types that come with NetBeans 3.3
|
Debugger type |
Remarks |
Where to use it |
|---|---|---|
|
Default |
Based on JPDA |
Use with ordinary Java applications |
|
Applet |
Based on ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access