trace subcommand for dbx: Print tracing information

Format

Description

The trace subcommand prints tracing information for the specified procedure, function, source line, expression, or variable when the program runs. A condition can be specified. The dbx debug program associates a number with each trace subcommand. To view these numbers, use the status subcommand. To turn tracing off, use the delete subcommand.

Options

atsourceline
Specifies the source line at which to find the expression being traced.
ifcondition
Specifies a condition for the beginning of the trace. The trace begins only ifcondition is true.
inprocedure
Specifies the procedure in which to find the procedure or variable being traced.

Usage notes

The trace subcommand can be run only while the dbx debug program is running.

Examples

  1. To trace each call to the printf() procedure, enter:
    trace printf
  2. To trace each execution of line 22 in the hello.c file, enter:
    trace "hello.c":22
  3. To trace changes to the x variable within the main procedure, enter:
    trace x in main
  4. To trace at line 52 only when mutex $m1 is not held, enter:
    trace at 52 if $m2.lock == 0

Related information

The tracei subcommand.