1

-GD Delphi compiler switch allows for an output of a detailed debug map. Such file contains e.g. an information about files that were compiled into an application.

Line numbers for UnitName(UnitName.pas) segment .text

    49 0001:001D27EC    50 0001:001D27F3    51 0001:001D27FC    52 0001:001D280A
    53 0001:001D2813    55 0001:001D2827    57 0001:001D2837    60 0001:001D283C
    ...

I would like to use a debug map to analyze application dependencies. Currently I got stuck on a problem with units having the same name but located in different folders, e.g.

SomeSourceFolder/NotUniqueUnitName.pas
SomeThirdPartyFolder/NotUniqueUnitName.pas

To determine which file is mentioned in a debug map, I would need a path, either absolute or relative, to the file.

Is there a way to force linker to output paths to source files? Or could you suggest any other approach to get this information?

Bartek
  • 169
  • 9

1 Answers1

0

Is there a way to force linker to output paths to source files?

No.

Currently I got stuck on a problem with units having the same name but located in different folders.

I don't believe that this can be the case. Unless I am very much mistaken, Delphi won't link two distinct units that have the same name.

But then maybe that's not the issue. Perhaps the issue is that you don't know which file is being linked. My recommendation is that you don't rely on search paths but instead include all the files that you need in the project. That way you can be sure which file is used.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 2
    "Unless I am very much mistaken, Delphi won't link two distinct units that have the same name." Delphi won't link both files in the same program, that's correct, but you still have the problem of finding out which is the one the compiler used. It depends on whether the files are listed in the dpr/dproj file and then on the order of the search paths. And to make things more complex, there is also the library path. IIRC the library path comes last. – dummzeuch Oct 09 '15 at 15:04