Sun Studio 12: Debugging a Program With dbx

Java Mode Syntax

The following specific syntaxes are valid in Java mode.

stop access mode class_name.field)name

Stop execution when the memory specified by class_name.field_name has been accessed.

stop at line_number

Stop execution at line_number.

stop at file_name:line_number

Stop execution at line_number in file_name.

stop change class_name.field_name

Stop execution when the value of field_name in class_name has changed.

stop classload

Stop execution when any class is loaded.

stop classload class_name

Stop execution when class_name is loaded.

stop classunload

Stop execution when any class is unloaded.

stop classunload class_name

Stop execution when class_name is unloaded.

stop cond condition_expression

Stop execution when the condition denoted by condition_expression evaluates to true.

stop in class_name.method_name

Stop execution when class_name.method_name has been entered, and the first line is about to be executed. If no parameters are specified and the method is overloaded, a list of methods is displayed.

stop in class_name.method_name([parameters])

Stop execution when class_name.method_name has been entered, and the first line is about to be executed.

stop inmethod class_name.method_name

Set breakpoints on all non-member methods class_name.method_name.

stop inmethod class_name.method_name ([parameters])

Set breakpoints on all non-member methods class_name.method_name.

stop throw

Stop execution when a Java exception has been thrown.

stop throw type

Stop execution when a Java exception of type has been thrown.

where:

class_name is the name of a Java class, using either the package path (using period (.) as a qualifier; for example, test1.extra.T1.Inner) or the full path name (preceded by a pound sign (#) and using slash (/) and dollar sign ($) as qualifiers; for example, #test1/extra/T1$Inner). Enclose class_name in quotation marks if you use the $ qualifier.

condition_expression can be any expression, but it must evaluate to an integral type.

field_name is the name of a field in the class.

file_name is the name of a file.

line_number is the number of a source code line.

method_name is the name of a Java method.

mode specifies how the memory was accessed. It can be composed of one or all of the letters:

r

The memory at the specified address has been read.

w

The memory has been written to.

mode can also contain the following:

b

Stops the process before the access.

The program counter will point at the offending instruction.

parameters are the method’s parameters.

type is a type of Java exception. -unhandled or -unexpected can be used for type.

The following modifiers are valid in Java mode:

-if condition_expression

The specified event occurs only when condition_expression evaluates to true.

-count number

Starting at 0, each time the event occurs, the counter is incremented. When number is reached, execution stops and the counter is reset to 0.

-count infinity

Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.

-temp

Create a temporary breakpoint that is deleted when the event occurs.

-disable

Create the breakpoint in a disabled state.

See also stopi Command for setting a machine-level breakpoint.

For a list and the syntax of all events see Setting Event Specifications.