views:

330

answers:

3

I am debugging a large application distributed over many units. I ran into a compilation error in a low level unit and do not have the slightest idea in which part of the application this unit is referenced. Is there a way to use RAD studio 2010's IDE to create some kind of include-graph?

As most of the units used are not part of the project and spread over quite a branchy source tree, i can not simply use the 'find in files' option.

I am currently traversing through my tree using a search-in-files-utility, but this is cumbersome.

Do you know of amore elegant way? Development is in Embercadero RAD studio 2010, windows XP 32.

+6  A: 

I use very simple idea: I rename unit name from .pas to .pas_ and then build project. Compiler will report error in unit that uses the unit you are looking for. Simple and work very well but I will not name it "elegant" :(

I think Delphi instead of:

[Pascal Fatal Error] unit2.pas(31): F2063 Could not compile used unit 'unit2'

should report:

[Pascal Fatal Error] unit2.pas(31): F2063 Could not compile unit 'unit2' used by 'unit1'

(maybe some of Delphi maintainers read it: it will make our lives easier)

Michał Niklas
Keep it simple, eh? I like this and accept this answer.
sum1stolemyname
A QC Report could be a good start :)
Francis Lee
I did it :) Look at: http://qc.embarcadero.com/wc/qcmain.aspx?d=81934
Michał Niklas
+3  A: 

Peganza's Pascal Analyzer has an "Uses Report". Maybe this can help you.

Edit: You might also want to check out Icarus from the same company. It's free (as in beer :-)) (credits to Uwe).

Ulrich Gerhardt
Icarus from Peganza only does the uses thing and is free.
Uwe Raabe
+8  A: 

Have a look at the Modelmaker's unit dependeny analyzer. This may give you more than you want and its free.

Uwe Raabe
Thank you for the link. For what it's worth, if I hadn't already seleted an answer, you would get the credit.
sum1stolemyname
[META Ha, I can change my selected answer. Good for you
sum1stolemyname
+1; Also make sure you take a look at MMX (Modelmaker Code Explorer http://bit.ly/9r1qaV): it is great! I use it for every Delphi project. It makes me so much more productive, without ever getting in my way.
Jeroen Pluimers
+1 for the MMX suggestion. It is the first thing to install after installing Delphi/RAD Studio. Cannot live without it. And it includes the dependency analyzer.
Uwe Raabe