If your custom server does not operate as expected, you can use the debug facility to identify the point of error. Using the AIX dbx debugger, you can step through each statement and observe the results of the execution of that line of code.
You can also use custom server trace for debugging custom servers; this may be more suitable for debugging custom servers that are in production. See Tracing custom servers.
To use the dbx debugger, you must specify -g as a compile (C flags) option when you define the main() function properties, as described in Defining properties.
If you want to use another debugging tool, instead of dbx, edit the custom server debug script, CA_DEBUG which is located in $VAETOOLS. Change the line that initiates dbx to initiate your debugging tool.
The printf C-library function can be useful for debugging. To avoid a delay caused by buffering, follow each printf with an fflush function. The output of the printf function is sent to the DTstatus.out file. However, the results of the printf function can become merged with other data sent to DTstatus.out; to prevent this happening, use the setlinebuf function before your printf function to ensure that your data always starts printing on a new line.
Use the following procedure to initiate the debug facility: