Program Control Buttons

Button Description


Run

Executes an attached program. If the program is an applet, also runs the Applet Viewer. Run compiles the program if:

  • Source files are newer than compiled files,
  • A new source file has been added to the project,
  • An existing source file has been removed from the project,
  • A newly-created .vb file has been saved.
After the initial run, allows you to rerun the program, maintaining the breakpoints you have set.
  

Build

Opens the Build card and compiles the program using javac with the build options specified in the Project Settings dialog. Choose Project > Project Settings ... to modify the build options. Compiles only those files that have changed. To compile all files, choose Project > Build All.

Build also builds or rebuilds the class database needed to graph classes and perform queries over classes.

Output from the compiler and build process appear in the Build card and in the status line above the Source panel.

Note: When you click the Build button (or choose Project > Build), Cosmo Code compiles only those files that have changed, or those that generated errors during the last build. It does not compile dependent files. Occasionally you may encounter runtime errors because dependent files were not recompiled.
  

Examine

Grayed-out unless your program is stopped at a breakpoint. Allows you to select a symbol to examine.

If you have selected a symbol to examine or evaluate in the Source panel, and the symbol is within the program's scope, it takes you to the Data card and displays the symbol in the Expr. field.
  

Continue
Continues execution of all threads when threads were suspended by reaching a breakpoint, and continues a single thread when the thread has been explicitly suspended. If you press the right mouse button with the cursor over the Continue button, you can choose to continue either "This Thread" or "All Threads" from the menu. The Continue command is legal only if the running thread or threads are suspended. If the program has not been run or has been killed, the button is grayed-out. If the target program has not yet started executing, click the Run button to start execution.
  

Suspend

Suspends execution of the thread that is selected as the current thread. If you press the right mouse button with the cursor over the Suspend button, you can choose to suspend "This Thread" or "All Threads." The Suspend command is valid only when a thread is running; otherwise the button is grayed-out.

Note: To avoid a deadlock that would freeze your debugging session, the Java interpreter does not allow the debugger to suspend a thread which is in the process of using certain important Java runtime resources, such as I/O operations.
  

Step Into

Executes a single step in a line of source code. This command is legal only if a thread is suspended; otherwise the button is grayed-out. If a statement invokes a method, it is stepped "into." That is, the next source statement is displayed, even if that statement is encountered in a different method. If a breakpoint is encountered while executing Step Into, the command is canceled and the thread is suspended where the breakpoint was fired.

In a call stack, if you select a frame other than the one where execution actually stopped, and you initiate a Step Into, the thread runs until it returns to the selected frame, at which point the Step Into takes place.

If you step into a method for which the source code is not available, the Source panel displays the message "Cannot find file.java." If you have access to the source file, and you want to display it, choose Project > Project Settings... to open the Project Settings dialog, then enter the pathname to the source file in the File Search Path field.

When you press the right mouse button with the cursor over the Step Into button, a popup menu allows you to choose the number of source lines to be stepped. The step value menu selections consist of "1, 2, 3, 4, 5, 10, 15, 20, N..." If you choose "N...", a dialog opens allowing you to enter a step value.
  

Step Over

Executes a single step in a line of source code. This command is legal only if a thread is suspended; otherwise the button is grayed-out. If a statement invokes a method, it is stepped "over." That is, the next source statement in the current method is displayed, although statements in a different method are being executed. If a breakpoint is encountered while executing Step Over, the command is canceled and the thread is suspended where the breakpoint was fired.

In a call stack, if you select a frame other than the one where execution actually stopped, and you initiate a Step Over, the thread runs until it returns to the selected frame, at which point the Step Over takes place.

When you press the right mouse button with the cursor over the Step Over button, a popup menu allows you to choose the number of source lines to be stepped. The step value menu selections consist of "1, 2, 3, 4, 5, 10, 15, 20, N..." If you choose "N...", a dialog opens allowing you to enter a step value.
  

Return

Continues execution of the thread until the current method that is being executed returns. This command is legal only if a thread is suspended; otherwise the button is grayed-out. The thread is suspended immediately upon returning to the calling method. All code within the current method is executed as usual. If a breakpoint is encountered while executing Return, the command is canceled and the thread is suspended where the breakpoint was fired.

In a call stack, if you select a frame other than the one where execution actually stopped, and you initiate a Return, the thread runs until it returns to the selected frame, at which point the Return takes place.
  

Terminate
Stops, or terminates, the currently running thread. This command is legal only if the thread is running; otherwise the button is grayed-out. This button also has a right button menu that allows you to either terminate the thread or terminate the program (all threads).
  

Frame Down
Steps forward through the frames on the call stack for the current thread in any card, and displays information relevant to the current frame in the Source panel and the card that is open. This command is legal only if the running thread is suspended; otherwise the button is grayed-out. The information displayed in the card reflects the state of the thread at that stack frame.
  

Frame Up
Steps backward through the frames on the call stack for the current thread in any card, and displays information relevant to the current frame in the Source panel and the card that is open. This command is legal only if the running thread is suspended; otherwise the button is grayed-out. The information displayed in the card reflects the state of the thread at that stack frame.
  

Cosmo Create
Available when you have an applet project open in the Project card. Starts Cosmo Create with the HTML file that runs your applet
  

Visual Builder
When a project is open, starts the visual builder with the project's visual builder file. If the project does not already contain a visual builder file (.vb) starts the visual builder without specifying a file.

Guide to the Cosmo Code Development Environment
12-96*278