Debugging a DataBlade module

Debugging a DataBlade® module is usually an iterative process, repeated many times until the code is debugged.

About this task

The Creating a Simple User-Define Routine exercise in the DBDK InfoShelf tutorial guides you through this process.

The debugging process on a local database server has the following general steps:

Procedure

  1. Open the project.dsw file in Visual C++. You can do this in BladeSmith by clicking the MSDev button on the Generate DataBlade dialog box or by choosing Tools > MSDev.

    The DBDK Visual C++ Add-In toolbar is present in the Visual C++ program if you installed DBDK after you installed Visual C++. If it is not present, you must add it manually before you continue with the next step. See Manually loading the Add-In for instructions.

  2. The DBDK Visual C++ Add-In prompts you to configure the session for your new DataBlade project. Click Yes to select a local server.
  3. Specify the project database server, database, and, optionally, the SQL script to initialize your database.
    See Specify properties for a project for more information.
  4. Set appropriate breakpoints in one of the source code files.
    See Setting breakpoints for instructions.
  5. Open the appropriate unit test file in Visual C++ and edit it to add appropriate SQL.
    See Edit unit test files for more information.
  6. Click the Debug DataBlade Module button.
  7. If you need to specify an executable file for the debugging session, the Executable For Debug Session dialog box will prompt you to do so. Use the Browse button to select %INFORMIXDIR%\bin\oninit.exe.
  8. If a dialog box appears, warning that oninit.exe does not have debugging information, click OK to begin debugging.
    The debugger runs until the first breakpoint.
  9. To resume debugging, choose Debug > Go from the Visual C++ menu bar.
    When you pass all breakpoints and all routines return, IfxQuery displays the SQL results in your default browser.
  10. If necessary, edit and compile the source code.
  11. Repeat the procedure, as necessary.

Results

Important: If you attempt to start or stop the database server with the Services dialog box of the Control Panel during debugging, you receive an error. When the add-in starts the database server attached to the debugger, the database server does not run as a Windows™ service. To stop the database server, shut down the debugger.