Sun Studio 12 Update 1: Debugging a Program With dbx

Enabling a Handler While Within a Function (in function)

To enable a handler while within a function, type:


<dbx> trace step -in foo

This is equivalent to:


    # create handler in disabled state
    when step -disable { echo Stepped to $line; }
    t=$newhandlerid    # remember handler id
    when in foo {
    # when entered foo enable the trace
    handler -enable "$t"
    # arrange so that upon returning from foo,
    # the trace is disabled.
    when returns { handler -disable "$t"; };
    }