7

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.

Kara
  • 6,115
  • 16
  • 50
  • 57
sum1stolemyname
  • 4,506
  • 3
  • 26
  • 44

3 Answers3

9

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

Uwe Raabe
  • 45,288
  • 3
  • 82
  • 130
  • Thank you for the link. For what it's worth, if I hadn't already seleted an answer, you would get the credit. – sum1stolemyname Feb 08 '10 at 08:48
  • [META Ha, I can change my selected answer. Good for you – sum1stolemyname Feb 08 '10 at 08:52
  • 1
    +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 Wiert Pluimers Feb 08 '10 at 12:33
  • +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 Feb 08 '10 at 13:09
7

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
  • 53,067
  • 18
  • 70
  • 114
3

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

Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83