Java debugger  

Graphical Java Debugger - JDebugTool


Home
Screenshots
Features
Download
Starting Out
How To
Purchase
Testimonials
News
Contact
About
JDebugTool RSS feed

 FAQ

 Frequently Asked Questions about the JDebugTool® graphical Java™ debugger:

  1. How do I correctly mount a Source Path(s)?

  2. Why am I getting dialog entitled JDebugTool Instructions when trying to debug (Run/Attach/Listen) a target JVM?

  3. Why am I getting a "java.lang.NoClassDefFoundError com/debugtools/jdebugtool/Main" exception when trying to invoke JDebugTool?

  4. What is the most direct way to set a breakpoint?

  5. How do I directly set a method breakpoint?

  6. How do I drill down to view an object's fields?

  7. How do I stop when a certain exception is thrown?

  8. How do I set a watch?

  9. How do I set a watchpoint?

  10. How do I stop on Thread Start and/or Thread Death events?

  11. How do I stop on Class Prepare and/or Class Unload events?

  12. How do I stop on Method Entry and/or Method Exit events?

  13. JDebugTool does not stop at the main() breakpoint, or does not display my local variables or method arguments, or I cannot successfully set/hit breakpoints.

  14. How do I prevent JDebugTool from stepping into 3rd party packages and trying to display 3rd party source code that I am not interested in?

  15. How do I change the value of a primitive variable?

  16. How do I set/edit breakpoint groups?

  17. How do I Hot Swap a class?

  18. How do I Pop a stack frame?

  19. Why are my breakpoints in inner classes not being hit?

  20. Will JDebugTool work correctly if the same class is loaded multiple times (by multiple ClassLoaders) into the target JVM?

  21. How do I prevent JDebugTool from stopping at uncaught thrown exceptions in the target JVM?

  22. I have specified a Java exception to be caught in the debugger. How do I filter out this exception when thrown from locations that I am not interested in?

  23. How do I select the Look and Feel, and also the font size of the GUI?

  24. How do I define and launch an external text editor?

  25. How do I persistently save debugger settings into projects?

  26. How do I debug multiple JVM processes simultaneously in JDebugTool?

  27. Why are breakpoints not being hit in the debugger?

  28. What is JDebugTool's debugging thread model?


  1. How do I correctly mount a Source Path(s)?

    Use the File | Mount Source Path... menu item to select a Source Path directory so that JDebugTool can find your source code. A Source Path is a parent directory containing your Java packages (and source files) and is set analogously to a CLASSPATH directory. JDebugTool assumes that the directory structure matches the package hierarchy. For example, if the source file corresponding to class mypackage.MyClass (class MyClass in package mypackage) is located in the file c:/myjavafiles/mypackage/MyClass.java, then the correct Source Path would be c:/myjavafiles Note that a Source Path does not include any package names.

    You can also just type the full path name of the Source Path directory (for example: c:/myjavafiles) in the File name text field and then click on the Mount (Open) button.

    JDebugTool can automatically detect and fix incorrectly mounted source paths. In the Source Tree panel, under an incorrectly mounted source path, click on a Java source file in order to display the file. JDebugTool will then automatically unmount the incorrect source path, and then automatically mount the corresponding correct source path, after prompting the user.

    Note that you can mount multiple Source Paths for each independent source tree hierarchy.



  2. Why am I getting dialog entitled JDebugTool Instructions when trying to debug (Run/Attach/Listen) a target JVM?

    This is because you did not invoke JDebugTool itself correctly. In order to debug a target JVM, JDebugTool needs access to the Java Debugger Interface found in the JDK tools.jar file (so make sure that you typed the path to tools.jar correctly). See Step 5. Invoking JDebugTool in the Tutorial.



  3. Why am I getting a "java.lang.NoClassDefFoundError com/debugtools/jdebugtool/Main" exception when trying to invoke JDebugTool?

    This is because you do not invoke JDebugTool itself correctly. Either the jdebugtool.jar file can not be found (so make sure that you typed the path to jdebugtool.jar correctly) or you did not type "com.debugtools.jdebugtool.Main" correctly. See Step 5. Invoking JDebugTool in the Tutorial.



  4. What is the most direct way to set a breakpoint?

    To directly set/clear a breakpoint, click on the line number column on the appropriate line in a Source Window. To directly enable/disable a breakpoint, hold down the Ctrl key and click on the line number column on the appropriate line (that already has a breakpoint set) in a Source Window.



  5. How do I directly set a method breakpoint?

    To create a breakpoint when a particular method is called, navigate to the method body in the source code. Click to place the blinking cursor anywhere on the same line as the method name in the method signature, and then select Set Method Breakpoint from the right-click pop-up menu.

    Method breakpoints are visually indicated in the line number column at the same line as the corresponding method signature in the source code display, when the breakpoint is set by the user, if the method breakpoint can be resolved by parsing the source code.



  6. How do I drill down to view an object's fields?

    Double click (or select Inspect... from the right-click popup menu) on any object reference displayed in a table in JDebugTool. Or click an object reference in the current scope in the Source Window and click on the Magnifying Glass button in the toolbar (or select Inspect... from the right-click popup menu). The object's fields will be displayed in a popup window.

    The same procedures are also used for drilling down into array and string references.

    Hover the mouse over an object reference (including array and string references) displayed in the GUI in the current scope, to display a multi-line tool tip showing the contents of the object.



  7. How do I stop when a certain exception is thrown?

    For JDebugTool to catch a thrown exception, select the Exceptions | Catch... menu item, from the menubar.



  8. How do I set a watch?

    A watch is a simple expression to evaluate when the target is stopped in the debugger according to the current context. JDebugTool supports two tables of watches -- Watch Panel 1 and Watch Panel 2.

    To set a watch, select a local variable displayed in the Locals Panel table or select an object field displayed in the This Panel table, and then select the Add to Watch Panel 1 or Add to Watch Panel 2 menu item from the right-click popup menu. Or click on a variable name in the current scope in the Source Window and then select the Add to Watch Panel 1 or Add to Watch Panel 2 menu item from the right-click popup menu.

    Or select Add to Watch Panel 1... or Add to Watch Panel 2... from the Watches menu in the menubar. Then enter an expression in the resulting New Watch Dialog and finally click on the OK button.



  9. How do I set a watchpoint?

    A watchpoint stops execution of the target JVM in the debugger when a field is accessed (read) or modified (written) and optionally according to certain constraints on the value of the field.

    To set a watchpoint, select a field displayed in a table in JDebugTool, and then select the Watchpoint... menu item from the right-click popup menu. Or drill down and select a field in the loaded Classes Panel tree, and select the Watchpoint... menu item from the right-click popup menu.

    The Set Watchpoint Dialog will then be displayed, where you can enter your constraints followed by clicking on the OK button.



  10. How do I stop on Thread Start and/or Thread Death events?

    In the Threads Panel, select the Events... menu item from the right-click popup menu. The Set Thread Events Dialog will then be displayed, where you can enter your constraints followed by clicking on the OK button.



  11. How do I stop on Class Prepare and/or Class Unload events?

    In the Loaded Classes Panel, select the Events... menu item from the right-click popup menu. The Set Class Events Dialog will then be displayed, where you can enter your constraints followed by clicking on the OK button.



  12. How do I stop on Method Entry and/or Method Exit events?

    In the Threads Panel, check the Method Entry Events checkbox and/or Method Exit Events checkbox for the appropriate thread(s).



  13. JDebugTool does not stop at the main() breakpoint, or does not display my local variables or method arguments, or I cannot successfully set/hit breakpoints.

    You must compile your source code with the -g option [for Sun's javac] in order for the compiler to generate debugging information, for example:

    javac -g *.java

    See also FAQ #27: Why are breakpoints not being hit in the debugger?



  14. How do I prevent JDebugTool from stepping into 3rd party packages and trying to display 3rd party source code that I am not interested in?

    Use the Execution | Excludes... menu item from the menubar, and the resulting Stepping Excludes Dialog.



  15. How do I change the value of a primitive variable?

    Double click on the value of a primitive (boolean, byte, character, short, int, long, float or double) variable displayed in a table in the GUI; enter the new value followed by hitting the Enter key (hitting the Escape key will cancel the editing).



  16. How do I set/edit breakpoint groups?

    Double click on a cell in the Group column in the Breakpoints Panel; enter the new group name followed by hitting the Enter key (hitting the Escape key will cancel the editing). If the Group column is not displayed, select the Columns... menu item from the right click popup menu in the Breakpoints Panel.

    To clear or disable/enable all the breakpoints in a group, see the Breakpoints menu in the menubar.



  17. How do I Hot Swap a class?

    Hot Swap (fix a bug, reload the class, and continue) is a feature of JDK 1.4 or later. Select a class in the Classes Tree Panel and then select Hot Swap... from the right click popup menu. Or select Hot Swap... from the right click popup menu in the Source Window to Hot Swap the class whose source code contains the blinking cursor in the currently viewed source file. Check the Target Info Dialog to see if your target JVM supports Hot Swap. Note that methods currently being executing before the Hot Swap will continue to execute with the old code. New method invocations after the Hot Swap will execute with the newly defined code.

    See also FAQ #18: How do I Pop a stack frame?



  18. How do I Pop a stack frame?

    Popping a stack frame(s) is a feature of JDK 1.4 or later. Select the Pop... menu item in the Stack menu in the menubar. Check the Target Info Dialog to see if your target JVM supports Can pop frames. This feature is useful for re-executing a method(s) particularly those that are to be Hot Swapped. You can Pop a method, Hot Swap the corresponding class, and then Step In and re-execute the fixed method code.



  19. Why are my breakpoints in inner classes not being hit?

    First make sure you have correctly specified the version of the Java compiler that was used to compile your project's source code. Select the Project Settings... menu item from the Edit menu in JDebugTool's main menubar.

    JDebugTool figures out the inner class name to set the breakpoint in by parsing your source code file. If the breakpoint is not being hit, then JDebugTool maybe generating the wrong inner class name. You can see the class name that JDebugTool heuristically generated, by examining the corresponding breakpoint row in the Breakpoints Panel, and looking at the Class column (the tool tip will show the complete, expanded class name). Also look at the message in the Resolved column (see the JDebugTool Breakpoints Panel context-sensitive help for more details).

    The correct class name to use for the breakpoint, depends on which version of the JDK and corresponding compiler you are using. We currently support Sun's javac. If you think that JDebugTool is generating the wrong class name, then examine the following:

    • Inspect the Navigator Panel to see if JDebugTool is parsing your source code correctly, to determine the class (including inner class) structure and corresponding methods of your source file. A tool tip on a class or inner class tree node, will display the corresponding generated full class name.

    • By examining the names of the corresponding .class files that your compiler generates, you may be able figure out the correct class name for the breakpoint. Also by inspecting the classes displayed in the Loaded Classes Panel, you may also be able to determine the correct class name for the breakpoint.

    • If you think that JDebugTool is generating the wrong class name for the breakpoint, you can prove this by manually creating the breakpoint in JDebugTool, by selecting Set... from the Breakpoints menu in the menubar. In the resulting Set Breakpoint dialog, you can then enter the correct Java Class and Line Number parameters, followed by clicking the OK button. If the entered parameters are correct, then JDebugTool should hit the corresponding breakpoint.



  20. Will JDebugTool work correctly if the same class is loaded multiple times (by multiple ClassLoaders) into the target JVM?

    Yes, as of JDebugTool 4.4.3. The debugger supports breakpoints, exceptions, and watchpoints when the same class is loaded multiple times (by multiple ClassLoaders) into the target JVM. The Resolved column (and corresponding tool tips), gives ClassLoader aware feedback in the Breakpoints, Exceptions, and Watchpoints panels (select Columns... from the right-click pop-up menu).

    For the Hot Swap feature, if there are multiple classes by the same name loaded (by multiple ClassLoaders) into the target JVM, Hot Swap will try to Hot Swap all of them, after confirmation by the user. The number of classes successfully Hot Swapped (and corresponding ClassLoaders), will then be reported.



  21. How do I prevent JDebugTool from stopping at uncaught thrown exceptions in the target JVM?

    By default, JDebugTool will stop at any thrown exceptions that are not caught by the target program. To prevent this, if desired, disable the (All Uncaught Exceptions) first table row (by clicking on the E checkbox) in the Exceptions Panel in the debugger.

    You can also right-click on the (All Uncaught Exceptions) first table row in the Exceptions Panel and select Edit...from the resulting pop up context menu, to display the Catch Exception Dialog, in order to edit the properties of (All Uncaught Exceptions). Use the Include Classes or the Exclude Classes fields to filter out uncaught exceptions when thrown from locations that you are not interested in.



  22. I have specified a Java exception to be caught in the debugger. How do I filter out this exception when thrown from locations that I am not interested in?

    Right-click on a user specified exception to be caught in the debugger in the Exceptions Panel and select Edit... from the resulting pop up context menu, to display the Catch Exception Dialog, in order to edit the properties of the exception. Use the Include Classes or the Exclude Classes fields to filter out the exception when thrown from locations that you are not interested in. These filters can also be specified when initially creating the exception to catch in the debugger.



  23. How do I select the Look and Feel, and also the font size of the GUI?

    See Global Settings (Edit | Global Settings...).



  24. How do I define and launch an external text editor?

    A user definable external text editor can be specified in the Global Settings (Edit | Global Settings...) in the Source tab. To launch the external text editor on the currently displayed Java source file, select File | External Editor....



  25. How do I persistently save debugger settings into projects?

    See the Project Manager (File | Project Manager...). There is always a default project, if you do not want to create any projects.



  26. How do I debug multiple JVM processes simultaneously in JDebugTool?

    For each target JVM process that you want to debug, invoke a corresponding JDebugTool instance. In each JDebugTool instance, create a project (File | Project Manager...) corresponding to each target JVM process. Then in each JDebugTool instance, connect to (see the Target menu and the Tutorial) and debug each corresponding target JVM process.



  27. Why are breakpoints not being hit in the debugger?

    JDebugTool can tell you whether a breakpoint should be hit or not, when connected to a target JVM, once the corresponding class should have been loaded: Right-click on the Breakpoints Panel, and select Columns...from the resulting pop up menu. Then select the Resolved checkbox, and click OK. Now the Resolved column (and corresponding tool tips) in the Breakpoints Panel will give you feedback about each breakpoint:

    Whether the breakpoint is currently resolved; that is, the corresponding breakpoint class has been loaded by a class loader into the target JVM, and the breakpoint has been successfully set. The number before the "/" is the number of times the breakpoint has been successfully resolved. The number after the "/" is the number of times the breakpoint class has been loaded by a class loader. The table cell is displayed in green, if all resolutions have been successful. The table cell is displayed in red, if there has been at least one resolution error. The table cell is displayed in orange (unresolved), if no corresponding breakpoint class has been loaded in the target JVM.

    A tool tip displays the class loader(s) that have loaded the breakpoint class, and the corresponding source file and line number the breakpoint has been resolved to. If there was an error during resolution, the tool tip displays the corresponding error message in red.

    See also:

    • FAQ #13: JDebugTool does not stop at the main() breakpoint, or does not display my local variables or method arguments, or I cannot successfully set/hit breakpoints.
    • FAQ #19: Why are my breakpoints in inner classes not being hit?
    • FAQ #20: Will JDebugTool work correctly if the same class is loaded multiple times (by multiple ClassLoaders) into the target JVM?


  28. What is JDebugTool's debugging thread model?

    When the target JVM is suspended (such as hitting a breakpoint, catching an exception in the debugger, hitting a watchpoint, stopping on a thread start/death, class prepare/unload or method entry/exit debugging event, or clicking on the Suspend All button), all threads in the target JVM are suspended.

    When the target JVM is resumed (such as single stepping, or clicking on the Resume All or Run to Cursor buttons), all threads in the target JVM are resumed.

    When the target JVM is suspended, you can switch the debugging context between threads, by clicking on a thread in the Threads panel.

View the Screenshots or Download now.


©2001-2010. debugtools.com LLC. All rights reserved.     Terms of Use     Trademarks     Privacy Statement