Debugging JNI

To enable OLT to debug JNI, follow these steps:

  1. Start the Java debugger on your Java client application (see Java commands: Debugging a Java client from startup). Do not click Run.
  2. Attach the Java executables, as follows:
    1. From the menu bar, select File -> Attach Process... (CTRL-A).
    2. Select the Compile tab and click Get Process List. The list is displayed.
    3. Look for java under Executables in the list. You will find two java executables. Select the first java executable and click OK.
    4. Click Attach to attach the executable.
    5. Repeat steps 2a-d to attach the second Java executable.
    6. Once the Java executable processes are attached to the Debugger, from the menu bar, select Breakpoints -> Set Load Occurrence...
    7. Type the DLL name which is the DLL called by the JNI and click OK.
    8. Finally, select Debug -> Run (F5).
  3. Go to the Java code that makes the JNI call and set required breakpoints. This is done by opening the appropriate source file (Source -> Open New Source), typing the desired class name in the Source textbox, including the package name (com.ibm.debug.olt...), and clicking either Open for multiple files or OK to close the dialog box. Click on the Packages tab and expanding the desired package's expanding list. Finally, select Debug -> Run (F5).
  4. Once the DLL (named in step 2g) is loaded the following Debugger message is displayed:

    "Program was stopped due to load occurrence breakpoint(s) for: xxxxx.DLL."

    The java.exe process that stops execution is the correct process. At this point, breakpoints can be set in the C/++ code by clicking on Modules tab and expanding the xxxxx.DLL list. Finally, select Debug -> Run (F5).

  5. OLT will execute, stopping its execution at any breakpoints.


Distributed debugging using OLT