The when command executes commands when a specified event occurs.
If dbx is in Java mode and you want to set a when breakpoint in native code, switch to Native mode using the joff command or prefix the when command with native.
If dbx is in JNI mode and you want to set a when breakpoint in Java code, prefix the when command with java.
The when command has the following general syntax:
when event-specification [modifier]{command; ... }
When the specified event occurs, the commands are executed. The following commands are forbidden in the when command:
attach
debug
next
replay
rerun
restore
run
save
step
A cont command with no options is ignored.
The following specific syntaxes are valid in native mode:
Execute command when line-number is reached.
Execute command when procedure is called.
where:
line-number is the number of a source code line.
command is the name of a command.
procedure is the name of a procedure.
The following specific syntaxes are valid in Java mode.
Execute command when source line-number is reached.
Execute command when filename.line-number is reached.
Execute command when class-name.method-name is called.
Execute command when class-name.method-name([parameters]) is called.
class-name is the name of a Java class. You can use either of the following:
The package path using a period (.) as a qualifier; for example, test1.extra.T1.Inner
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.
filename 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.
parameters are the method’s parameters.
For a list and the syntax of all events, see Setting Event Specifications.
See wheni Command for information about executing commands on a specified low-level event.