Sun Studio 12 Update 1: Debugging a Program With dbx

Setting Breakpoints in Objects

Set an In Object breakpoint to check the operations applied to a specific object instance.

By default, an In Object breakpoint suspends program execution in all nonstatic member functions of the object’s class, including inherited ones, when called from the object. To set a breakpoint to suspend program execution in only nonstatic member functions defined in the object’s class and not inherited classes, specify the -norecurse option.

To set a breakpoint in all nonstatic member functions defined in the base class of object foo, and in all nonstatic member functions defined in inherited classes of object foo, type:


(dbx) stop inobject &foo

To set a breakpoint in all nonstatic member functions defined in the class of object foo, but not those defined in inherited classes of object foo, type:


(dbx) stop inobject &foo -norecurse

For more information on specifying an inobject event, see inobject object-expression [-recurse | -norecurse] and stop Command