Sun Studio 12 Update 1: Debugging a Program With dbx

Setting Data Change Breakpoints on Local Variables

Filters can be convenient when you are placing a data change breakpoint on a local variable. In the following example, the current scope is in function foo()(), while index, the variable of interest, is in function bar()().


(dbx) stop access w &bar`index -in bar

bar`index ensures that the index variable in function bar()() is picked up, instead of the index variable in function foo() or a global variable named index.

-in bar implies the following:

The stack location corresponding to index might be reused by some other local variable of some other function. -in ensures that the breakpoint is triggered only when bar`index is accessed.