3. |
Compiling and debugging
| Prev | Next
Compiling
To compile a single file use the compile button in the toolbar. This will use the compiler which is configured in the currently selected JDK. To compile with another compiler just switch the JDK. To compile all files in your project use the Project > Rebuild menu item. To compile all dirty files in your project use the Project > Build menu item. A source file is dirty if it has no corresponding class file or if the class file is older than the source file. By default a project build is also done before you run the project. If the compiler reports errors or warnings they will appear in the output window. You can click on the errors to open the corresponding source files. Normally there will be no or only a few compile errors since they are already detected by CodeGuide as you type.
Running the project
To execute the current project press the run button in the toolbar. Please note that this will execute the project starting point (see Project Settings) rather than the current file. CodeGuide will start the VM which is configured in the currently selected JDK. To run your project with another VM just switch the JDK. If runtime exceptions occur during the execution they will be displayed in the output window so that you can click on them to open the corresponding files where the exceptions occurred.
Debugging
To debug the current project press the run debugger button in the toolbar. Please note that this will execute the project starting point (see Project Settings) rather than the current file. CodeGuide will start the debug VM which is configured in the currently selected JDK. To run your project with another VM just switch the JDK. CodeGuide can debug JDK 1.1, JDK 1.2, JDK 1.2 with JPDA and JDK 1.3. You can toggle breakpoints by clicking in the editor bar. When any thread passes the breakpoint line the debugger is suspended: Afterwards you can step your program line by line. To do this use the step buttons in the toolbar. To resume the execution of your program press the resume button. You can also suspend the execution of your program at any time by using the suspend button in the toolbar.
Debug Browser
When the debugger is suspended you can browse the state of your program with the debug browser: The debug browser contains a classes and a threads section. The classes section displays all loaded classes in all packages and all static fields with their values for each class. The threads section displays all existing threads. The current thread - i.e. the thread which stopped at a breakpoints indicated by a red flash. You can change the current thread by double-clicking on another thread. For each thread the stack trace is shown. For each frame in the stack trace all visible local variables with their values are shown. If a variable contains a reference to an object you can also show the fields of this object with their values: You can recursively browse the heap this way. In addition you can view the content of arrays. Please note that it is only possible to use the debug browser while the program being debugged is suspended because the content of the browser is rapidly changing when the program is running.
Prev | Next
Copyright © 2000 Omnicore Software Comments ands questions to support@omnicore.com All trademarks referenced herein are property of their respective owners