1. Build the shared object file with debugging support while logged on as user informix (if necessary).
2. Install the DataBlade module shared object and SQL scripts in the $INFORMIXDIR/extend/project directory.
3. Start your database server with the oninit command, while logged on as the informix user.
4. Register the DataBlade module, using BladeManager (if necessary).
5. If you are replacing an existing shared object, shut down and restart the database server with the onmode -yuk and oninit commands.
6. Load the DataBlade module by calling one of its routines.
7. Log on as user root in a new window to run the debugger.
8. Obtain the database server process ID for the root session.
9. Run the debugger and attach to the database server process.
10. Set any appropriate breakpoints.
11. Issue SQL statements to call your DataBlade module routines from the informix session.
12. Edit the source code (if necessary).
13. Repeat the procedure, as necessary.
Figure 8-1 Sample onstat Command Output
Typically, the PID circled in the sample output is the one you need. In this example, there are no user-defined virtual processor classes; all the DataBlade routines are marked as well behaved and run in the single instance of the CPU VP. Running the Solaris Debugger To debug your DataBlade module, use a debugger that can attach to the active database server process and access the symbol tables of dynamically loaded shared object files. On Solaris, the dbx utility meets these criteria, as does debugger. Before beginning debugging, enter the following commands to disable signal handlers in the debugger:
You can set breakpoints, examine the stack, resume execution, or carry out any other normal dbx command. See the on-line dbx manual page for more information about available dbx commands. Setting Breakpoints You can set breakpoints in any routine with an entry point known to dbx. Informix database server software is compiled with debugging support turned off, so local storage and line number information is not available for database server routines. However, after you compile the DataBlade module for debugging, you can see line number information and local storage for your functions. When you enter a command in the client that calls one of your DataBlade module routines, the debugger stops in the routine. Then you can follow the steps of your routine. Because your DataBlade module is compiled with debugging support, you can view the local variables and stack for your routines.