Introduction
CodeSite 2, from Raize Software , is a powerful debugging tool for Borland Delphi and C++Builder. The problem? Often not all of the logic in your application is contained in Delphi or C++Builder code. Some logic is often contained in Stored Procedures and Triggers. However, by itself, CodeSite will only let you trace the flow of execution to the boundary of your Delphi or C++Builder code. What goes on inside your database is pretty much a mystery to CodeSite.
Well, IBSite tries to fix that. IBSite is a free extension to CodeSite 2 which allows CodeSite messages to be sent from Interbase Stored Procedures and Triggers. It comes as a collection of UDF's (User Defined Functions), which once installed into Interbase, can be called like any other statement from Interbase SQL.
Requirements
IBSite has been tested with CodeSite 2 Professional and Interbase v6.0 on Windows. I don't think I'm taking advantage of any of the features not present in CodeSite 2 Standard, so I believe it should also work with the Standard Edition, but let me know if you strike any issues. Additionally, Interbase has had UDF support for a number of versions, so I believe it should also work with any Interbase version on Windows which supports UDF's. As I, or others, try it out with more versions, we'll post the results.
Example
As an example, the following test Stored Procedure:
| |
set term # ;
create procedure TestCS
AS
begin
execute procedure csClear;
execute procedure csCategoryColor 'clWhite';
execute procedure csEnterMethod 'TestCS';
execute procedure csCategory 'IBSite Test';
execute procedure csAddCheckPoint;
execute procedure csResetCheckpoint;
execute procedure csAddCheckPoint;
execute procedure csAddSeparator;
execute procedure csSendMemoryStatus;
execute procedure csSendMsg 'Msg';
execute procedure csDisable;
execute procedure csSendMsg 'Should not see this';
execute procedure csEnable;
execute procedure csCategoryColor 'clYellow';
if (csEnabled() = 1) then
execute procedure csSendMsg 'CodeSite Already Enabled';
else
begin
execute procedure csEnable;
execute procedure csSendMsg 'Just Enabled CodeSite';
end
execute procedure csSendMsg 'Should see this';
execute procedure csSendString 'String', 'Value';
execute procedure csSendInteger 'Integer', 1;
execute procedure csSendFloat 'Float', 1.1;
execute procedure csSendNote 'This is a test note';
execute procedure csWriteInteger 'First', 'Integer', 1;
execute procedure csWriteFloat 'Second', 'Float', 1.1;
execute procedure csWriteString 'Third', 'String', 'Value';
execute procedure csWriteMsg 'Fourth', 'Msg';
execute procedure csExitMethod 'TestCS';
end #
set term ; #
|
produces the following output in the CodeSite 2 viewer:
Click image for larger screenshot
Currently, IBSite supports the following CodeSite 2 calls, inside your Interbase SQL code. This seems to cover most requirements, but let me know if you simply can't live without support for something else.
| |
CodeSite |
IBSite Equivalent |
| |
CodeSite.Category |
csCategory |
| |
CodeSite.CategoryColor |
csCategoryColor |
| |
CodeSite.AddSeparator |
csAddSeparator |
| |
CodeSite.AddCheckpoint |
csAddCheckpoint |
| |
CodeSite.ResetCheckpoint |
csResetCheckpoint |
| |
CodeSite.SendMemoryStatus |
csSendMemoryStatus |
| |
CodeSite.Clear |
csClear |
| |
CodeSite.Enabled := True |
csEnable |
| |
CodeSite.Enabled := False |
csDisable |
| |
CodeSite.Enabled |
csEnabled |
| |
CodeSite.DestinationDetails |
csDestinationDetails |
| |
CodeSite.EnterMethod |
csEnterMethod |
| |
CodeSite.ExitMethod |
csExitMethod |
| |
CodeSite.SendMsg |
csSendMsg |
| |
CodeSite.SendString |
csSendString |
| |
CodeSite.SendInteger |
csSendInteger |
| |
CodeSite.SendFloat |
csSendFloat |
| |
CodeSite.SendNote |
csSendNote |
| |
CodeSite.WriteInteger |
csWriteInteger |
| |
CodeSite.WriteFloat |
csWriteFloat |
| |
CodeSite.WriteString |
csWriteString |
| |
CodeSite.WriteMsg |
csWriteMsg |
CodeSite is a trademark of Raize Software .
Interbase is a trademark of Borland Software Corporation
|