Command Card

Access

Purpose

Features

        

Navigation Control

The Command card allows you to type in debugging commands similar to dbx commands at the cosmocode prompt. Cut and paste features are available in this area, in addition to the following navigation control sequences:

Command Description
Completion
Esc Completes a command. Beeps if completion is not possible or if there are multiple completions.
Ctrl+d On an empty line, lists all the available debugging commands in the command-line area. Otherwise lists all possible completions. Beeps if no completions are possible.
Movement
up arrow Move backward one line in the history list
down arrow Move forward one line in the history list
left arrow Move cursor back one character
right arrow Move cursor forward one character
Alt+b Move cursor back one word
Alt+f Move cursor forward one word
Deletion
Ctrl+d Delete forward one character
Backspace Delete backward one character
Ctrl+w or Alt+Backspace Delete backward one word
Alt+d Delete forward one word
Ctrl+u Delete entire line
Other
Ctrl+y Retrieve the last deleted lines or words
Ctrl+s Search forward in the history list
!! Repeat the last command

Debugging Commands

alias [name ["string"]]
Without arguments, lists all aliases. With a single argument, lists the value for name. With arguments name and string, creates an alias called name with the value string.
attach thread_id
Attaches to the specified thread, adding it to the pool of controlled threads and making it the current active thread.
class classname
Loads the specified class into the source panel and makes that source the current file.
classes
Lists all currently known classes.
clear
Clears all input and output from the command-line text area.
continue
Causes the current thread to resume.
delete all
Deletes all breakpoints.
delete breakpoint_number [,breakpoint_number, ...]
Deletes the specified breakpoint or breakpoints. Use the status command to get a list of breakpoint numbers.
dir [dir][...]
Without arguments, prints the current source directory list (the list of directories in which to locate a file). Otherwise appends the directory or directories supplied to the current source directory list.
disable all
Disables all enabled breakpoints.
disable breakpoint_number [,breakpoint_number, ...]
Disables the specified breakpoint or breakpoints. Use the status command to get a list of breakpoint numbers.
down [count]
Without arguments, moves down the specified number of frames in the call stack. down moves in the direction of the calling function.
enable all
Enables all inactive breakpoints.
enable breakpoint_number [,breakpoint_number, ...]
Enables the specified breakpoint or breakpoints. Use the status command to get a list of breakpoint numbers.
examine expression
Displays expression in the Data card.
exceptions
Lists all exceptions that are caught.
file [filename]
Without arguments, displays the current file. Otherwise, loads filename into the Source panel and makes filename the current file.
help [keyword]
Without arguments, prints help information for all commands. Otherwise prints help for keyword. keyword can be either a complete command or the initial characters of a command. If the characters are not unique, help is displayed for all matches to the characters specified.
history
Lists the contents of the command history list. Last command can be repeated with !!. The history list can be searched using the up and down arrow keys. The length of the history list can be set by choosing File > Preferences... and modifying the Command line preference category.
kill [thread_id][...]
Without arguments, kills the active thread. Otherwise kills the thread or threads specified.
load [classname]
Without arguments, reports the class currently being debugged when a program is attached. Otherwise loads the specified class for debugging.
locals
Displays all the local variable names for the current frame and their values.
memusage
Lists total and free memory for the program running.
methods classname
Lists the methods in the specified class.
next [count]
Without an argument, steps over the next line. Otherwise, steps over the specified number of source instructions. This command does not step into methods.
pop [card]
Without arguments, displays the last card visited. Otherwise displays the specified card. The argument can be either a complete card or enough initial characters of the name to uniquely identify it.
print expression[@format] [, expression[@format] ...]
Prints the value of the specified expression(s). If format is specified using one of the options below, expression is printed in the specified format.

Argument Description
DEFAULT String displaying the value
DECIMAL Number (base 10)
OCTAL Number (base 8)
HEX Number (base 16)
TYPE Java data type of a variable
HANDLE Address or reference to the Java object
TEXT Formatted string display of an object
ARRAY-TEXT Formatted string display of an array

quit
Exits the debugging session.
rerun [parameters]
Without arguments, runs the program again using the same arguments. Otherwise runs using the specified arguments.
resume [id1 id2 ..]
Without arguments, resumes current thread. Otherwise resumes specified thread or threads.
return
Continues execution of the thread until the method currently being executed returns. If you move up and down the call stack while a thread is suspended, return continues execution and returns from whichever method you are currently examining on the call stack.
run [parameters]
Without arguments, removes any existing parameters to the program and runs the program. Otherwise runs the program with the specified parameters.
source [-sync] filename
Runs the commands in the specified file as a script. With the "-sync" flag, commands are run synchronously, that is, the next command is not executed until the previous command completes.
status [breakpoint_number [, breakpoint_number, ...]]
Without arguments, displays a list of all currently set breakpoints. Otherwise displays the specified breakpoints.
step [count]
Without an argument, steps into the next line. Otherwise, steps the specified number of source instructions.
stop at [class] class{::|:}line_number
Sets a breakpoint to stop execution at the specified class and line.
stop at [file file{::|:}]line_number
If a file is specified, sets a breakpoint to stop execution at the specified file and line. Otherwise sets a breakpoint at line_number in the file currently displayed in the Source panel.
stop exception exception_object
Stops the thread when an exception is thrown.
stop in|entry [class] classname{::|:}method_name
Stops execution on entering a specified class and method.
suspend [thread_id1 thread_id2 ..]
Without arguments, suspends the current thread. Otherwise, suspends the specified thread or threads.
thread thread_id
Sets the current thread to the specified thread.
threads [groupname]
Without an argument, lists threads in the current thread group. Otherwise, lists all threads in the specified group.
unalias name
Cancels the alias specified as name.
up [count]
Without arguments, moves up the specified number of frames in the call stack. up moves in the direction of the called function.
use [dir][dir]
Without arguments, displays the current source directory list (the set of directories in which to locate a file). Otherwise, sets the source directory list to the directories supplied.
where [thread]
Without arguments, prints the current call stack. Otherwise prints the call stack for the specified thread. The specified thread can either be the ID displayed by the threads command, or the thread name displayed by the threads command and in the Thread bar.
Guide to the Cosmo Code Development Environment
12-96*274