views:

338

answers:

3
+1  Q: 

Delphi trace tool

I was wondering if there's a tool or a component for Delphi that can trace method execution line by line and create a log file. With this kind of tool it is easy to compare how method performs on two sets of input data by comparing two log files.

EDIT:

Let's say there is a function


10: function MyFunction(aInput: Integer): Integer;
11: begin
12:   if aInput > 10 then
13:     Result := 10
14:   else
15:     Result := 0;
16: end;

I'm looking for a tool that would give the log which whould be similar to the following:

When aInput parameter is 1:


Line 10: 'function MyFunction(aInput: Integer): Integer;'
Line 11: 'begin'
Line 12: 'if aInput > 10 then'
Line 15: 'Result := 0;'
Line 16: 'end;'

and when aInput parameter is 11:


Line 10: 'function MyFunction(aInput: Integer): Integer;'
Line 11: 'begin'
Line 12: 'if aInput > 10 then'
Line 13: 'Result := 10;'
Line 16: 'end;'

The only information that should be required by the tool is the function name.

It's like stepping through the method under debugger, but in an automatic manner with logging every line of code.

+2  A: 

SmartInspect and CodeSite

You can read this question for more review about those and others.

Mohammed Nasman
I'm familiar with those tools, but they only allow one to put trace statements manually. I need a tool which would produce trace log automatically, without adding any statements manually.
Max
+1  A: 

If you are looking for a free solution, I've used TraceTool before. The viewer is written in Delphi, and you can also use TraceTool with C#, C++, ActiveX, and Java. With Delphi, you simply include a couple of helper units and add the appropriate logging as you go. It supports logging text, as well as objects and their data.

You can download it from SourceForge here.

alt text

Or, if you want something simpler and lighter weight for just primarily string output, you can always use OutputDebugString and view the output with TraceTool's viewer or with DbgView from SysInternals.

Mick
very nice tool...thank you for telling us about it! i wish it had existed a couple of years ago!
X-Ray
Thanks. It seems to be a nice tool, but it is similar to SmartInspect and CodeSite. I've posted some clarifications to what I'm looking for
Max
A: 

After some time searching I can conclude that there's no such tool for Delphi.

Max