Right Java tools for J2EE, Web Service, Grid and more
|Home | Products | Documents | Downloads | Purchase | Support | Company | Partners | Contact |

LimpidDebugger Tutorial

Welcome to LimpidDebugger!  This tutorial shows how to use LimpidDebugger.

By the way, you can press the F1 key to access context sensitive help system from any window throughout the whole program.

If you click on a menu item from the Run menu, or press a shortcut function key too many times, you can press the F11 (Back) key to go back. You can also press F12 (Forward) key to go forward as well. Back - Forward are for view points which are already visited in the debug session. You will not find his kind of feature with regular GUI debugger.

1. Go to the main menu. Click on the Modules > LimpidDebugger > Debugger.

The Debugger Panel appears.

2. This tutorial uses Java 5, so syntax highlighting is capable by set the preference on the Preference Panel. If you use Java 1.4, do not set this preference.

3. Let's go back to the Debugger Panel and open the demo project. Click on the tool bar Project > New project.


4.  A file chooser window appears. Choose a directory and key in test as the name of the new project.

5. The Database Panel appears. Let's take all default values and click on the Ok button to connect to the database. There is some sample data in the database.

6. At this time, the connection to the database is established. The Datum Panel appears, which tells information about the data in the database. Let's click the Close button to close it.

Then the Period Panel appears asking to specify the period for the debug session. The demo database does not have much data, we can specify a very early time without paying performance penalty. Let's change the year to be 2005 for From and click on the Ok button.

The Thread Panel appears. It lists all available threads in the database. All data in the demo database is for one machine and one thread. Let's select them anyway as below.

7. The debug session starts. It finds the first record from the database and tries to display the source code in question. But where is the source code? The source path has not been defined yet. So, an error window appears. Just click on the Ok button.

8. The Source Path Panel appears, prompting to specify a source path.

Let's click the Add button.

9. A file chooser appears for you to specify a source path.

The source code file is already under the current directory. So we need to specify the current directory by key in a dot "." and click on the Add button.

10. We back to the Source Path Panel. We see the current directory is added.

Let's click the Close button.

11. The first Source And Variable Panel appears. It is a tab in the Debugger Panel. The name of the tab is the base name of the Java source file. If you open more Java file, you will see more tabs, each of them is a source code file.

On the left, the vertical panel is the number component.

The record line is in the middle, just above the divider line. It shows information about the record: the event (**LINE), the log record: ID (2) and the time.

The cursor position indicator is next to the record line, on the right.

The project info line is at the bottom.

We has come to the first line since the From time of the period. The line is highlighted.

We can see the variable count is a static one and it has already been assigned value as 0. The variable count shows on the Variable Table Panel at the bottom of the Source And Variable Panel.

12. We want to trace the execution into the method. Let's click on the Run menu and click on the Step in menu item.

 

Note: for the most frequently used command on the Run menu, there accelerators (shortcut). For example, if you press F7 key, it is the same as you press menu item Step in.

13. The highlighted line goes to the line in question. That is the entrance of the construction method.

14. We want to further step into the method. Let's press F7 again. This time, the highlight moves to the first line of the constructor body. The content of the Variable Table Panel changes: it lists all argument variables ( s ).

15. We want to further step into the method. Let's press F7 again.

Hey! The highlight has not moved! But if you pay attention, you will see the record line changed. The highlight is still on the same line, but the event becomes **FIELD. And, the content of the Variable Table Panel has changed too. The event is for field variable text assignment. Its value is "Acelet provides tools for Java and J2EE". LimpidDebugger replays the log records event by event simulating the execution.

16. Let's press F7 again. The highlight moves again. The event is **LINE. There is no associated value change, so the Variable Table Panel changes to empty.

17. Now, we want set a break point. Let's click on the line 16 of the number component, so the line 16 is highlighted with red indicating the break point is set.

18. Let's click on the Run menu and click on the To break menu item.

19. The execution comes to the break point.

The source code at line 16 is buggy: all tokens in the input data are text, no numbers. So if we press F7, an Exception will be thrown. Let's just press F7 to see what is going to happen.

20. We come to line 17, which catches the exception.

22. Let's press F7 again. We stay on the same line, but come to event **STORE.

This is the event the exception is stored to variable ex. The exception is shown as a value being stored to a local variable on the Variable Table Panel.

23. The value of the variable is too long for us to read. Let's click on ex and highlight the line and click on the Detail button on the Variable Table Panel to see detailed information. The Variable Table Panel becomes Variable Detail Panel. We can see the whole exception stack now.

24. Let's click on the Step in menu item from the Run menu. The Variable Detail Panel is closed automatically and back to the Variable Table Panel.

Let's press F7 more times until the cursor moves to line 20. Then press F7 again. You will see the Variable Panel lists a value named <**RETURN>, which is the return value of the method.

25. Now, we want to save our project data, so we can come back easily. Click on the tool bar: Project > Save project as and give a project name.

But, before do that, you may want to check the Preference Panel by click on the Setting > Preference. The Preference Panel appears.

If you keep the Save password checked, the User and Password will be saved as part of the project data. On the Database Panel, the password does not show literally. But in the project file, it is saved as plain text. If you have security concern, do not check Save password. The next time you open the project, you will be prompted to key in User and Password.

26. The other important panel is Source Path Panel. You can access it from the menu Setting > Source path.

LimpidDebugger uses the source path to searche source code file. If you do not specify here, LimpidDebugger can not find the source code file. Do not worry, if that happens, LimpidDebugger will pops up this panel asking you to specify.

27. There are two menu item to close LimpidDebugger:

Both of the menu items terminate LimpidDebugger. The Close menu item remembers the size and the location of the divider, while Quit will not.

28. You can export your debug case to a file and send the file to other people from: Project > Export case menu item:

29. There are many features we have not covered yet. But you should have no problem to navigate the log records. Remember: LimpidDebugger replays historical data, event by event. You will master LimpidDebugger in a few minutes.

 


   © Copyright 2006-2007 Acelet Corporation. All rights reserved.