The trace command has the following general syntax:
trace event_specification [modifier]
When the specified event occurs, a trace is printed.
The following specific syntaxes are valid in native mode:
Direct all trace output to the given file_name. To revert trace output to standard output use - for file_name. trace output is always appended to file_name. It is flushed whenever dbx prompts and when the application has exited. The file_name is always re-opened on a new run or resumption after an attach.
Trace each source line, function call, and return.
Trace each source line while in the given function.
Trace given source line..
Trace calls to and returns from the given function.
Trace calls to and returns from any function in file_name.
Trace calls to any member function named function.
Trace when any function named function is called.
Trace calls to any member function of class.
Trace changes to the variable.
where:
file_name is the name of the file to which you want trace output sent.
function is the name of a function.
line_number is the number of a source code line.
class is the name of a class.
variable is the name of a variable.
The following modifiers are valid in native mode.
The specified event occurs only when condition_expression evaluates to true.
Execution stops only if the specified event occurs in function.
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.
Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.
Create a temporary breakpoint that is deleted when the event occurs.
Create the breakpoint in a disabled state.
Do instruction level variation. For example, step becomes instruction level stepping, and at takes a text address for an argument instead of a line number.
Make this event permanent across debug. Certain events (like breakpoints) are not appropriate to be made permanent. delete all will not delete permanent handlers, use delete hid.
Hide the event from the status command. Some import modules may choose to use this. Use status -h to see them.
Execution stops only if the specified event occurs in the given LWP.
Execution stops only if the specified event occurs in the given thread.
The following specific syntaxes are valid in Java mode.
Direct all trace output to the given file_name. To revert trace output to standard output use - for file_nametrace output is always appended to file_name. It is flushed whenever dbxprompts and when the application has exited. The file_nameis always re-opened on a new run or resumption after an attach.
Trace line_number.
Trace give source file_name.line_number.
Trace calls to and returns from class_name. method_name.
Trace calls to and returns from class_name.method_name([parameters]).
Trace when any method named class_name.method_name is called.
Trace when any method named class_name.method_name [(parameters)] is called.
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.
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.
parameters are the method’s parameters
The following modifiers are valid in Java mode.
The specified event occurs and the trace is printed only when condition_expression evaluates to true.
Starting at 0, each time the event occurs, the counter is incremented. When number is reached, the trace is printed and the counter is reset to 0.
Starting at 0, each time the event occurs, the counter is incremented. Execution is not stopped.
Create a temporary breakpoint that is deleted when the event occurs and the trace is printed. If -temp is used with -count, the breakpoint is deleted only when the counter is reset to 0.
Create the breakpoint in a disabled state.
For a list and the syntax of all events see Setting Event Specifications.