![]() |
DataBlade Developers Kit Tutorial |
Tutorial Exercise 2Debugging a DataBlade ModuleThis exercise demonstrates debugging a DataBlade module. You will debug the AddInts DataBlade module that you created in Exercise 1. The AddInts DataBlade module contains one user-defined routine, AddIntegers(), which adds two integers and returns the result. This exercise provides instructions for debugging a DataBlade module on Windows NT using Microsoft Visual C++ Developer Studio. You are assumed to be running your Informix server on the Windows NT workstation on which you built the AddInts DataBlade module. WARNING: Use a test database server for debugging because when you bring down the debugger in Step 5, the database server crashes. For information about debugging on UNIX, see the DataBlade Developers Kit User's Guide. Additional information about debugging is available from the Informix Developers Network. Tutorial StepsThis exercise consists of seven steps. It takes approximately 30 minutes to complete.
Before you attach the debugger process to the database server, load your DataBlade module dynamic link library file into the database server address space. With the dynamic link library file loaded, you can set breakpoints on module entry points and examine local storage provided by module functions.
Because you have not debugged your routines, you should execute a noncritical routine to load your DataBlade module. There are two methods for loading a DataBlade module dynamic link library without executing an untested critical routine:
See " Starting Informix Dynamic Server on Windows NT" for detailed instructions on starting Informix Dynamic Server on Windows NT. For instructions on starting Informix Dynamic Server on UNIX, see the Administrator's Guide for your database server.
The debugger stops the function from executing before it adds the two input values. You can check the values of the variables before and after their values are added. At the breakpoint, the variables have the following values.
If you have detected problems, you can re-open the Visual C++ workspace for your project (in this example, the file AddInts.dsw in the src\C directory) and modify the source code to correct the problems. Then save your changes and rebuild your DataBlade module to repeat the debugging process. Important: You must shut down the database server before you replace the DataBlade module dynamic link library (shared object file). See the "DataBlade Developers Kit User's Guide" for more information.
Copyright © 1998, Informix Software, Inc. All rights reserved. |