Sun Studio 12: Debugging a Program With dbx

Setting Breakpoints on Code That Has Not Yet Been Loaded by the JVM Software

To set a stop breakpoint on a Java method in a class file that has not been loaded by the JVM software, use the full name of the class with a stop in command, or the class name with a stop inmethod command. See the following example.


(dbx) stop in Java.Pkg.Toy.myclass.class.mymethod
(dbx) stop inmethod myclass.class.mymethod

To set a stop breakpoint on a C function or C++ function in a shared library that has not been loaded by the JVM software, preload the symbol table of the shared library before setting the breakpoint. For example, if you have a library named mylibrary.so that contains a function named myfunc, you could preload the library and set a breakpoint on the function as follows:


(dbx) loadobject -load fullpathto/mylibrary.so
(dbx> stop in myfunc

You can also load the symbol tables of all dynamically loaded shared objects by running your application once before beginning to debug it with dbx.