Is it possible to output paths to source files in Delphi debug map?

200 Views Asked by At

-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?

1

There are 1 best solutions below

1
David Heffernan On

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.