Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi - Reverse Lookup ' who includes this unit'

Tags:

delphi

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.

like image 935
sum1stolemyname Avatar asked Feb 08 '10 08:02

sum1stolemyname


3 Answers

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

like image 185
Uwe Raabe Avatar answered Nov 11 '22 03:11

Uwe Raabe


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)

like image 36
Michał Niklas Avatar answered Nov 11 '22 03:11

Michał Niklas


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).

like image 3
Uli Gerhardt Avatar answered Nov 11 '22 03:11

Uli Gerhardt