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
- 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 .
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.
- The DBDK Visual C++ Add-In prompts you to configure the session for your new DataBlade® project. Click Yes to select a local server.
- Specify the project database server, database, and, optionally,
the SQL script to initialize your database.See Specify properties for a project for more information.
- Set appropriate breakpoints in one of the source code files.
See Setting breakpoints for instructions.
- Open the appropriate unit test file in Visual C++ and edit
it to add appropriate SQL.See Edit unit test files for more information.
- Click the Debug DataBlade® Module button.
- 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.
- 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.
- To resume debugging, choose
from the Visual C++ menu bar.When you pass all breakpoints and all routines return, IfxQuery displays the SQL results in your default browser.
- If necessary, edit and compile the source code.
- 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.