[fpc-pascal] fpc in symlinked directory
Michael Van Canneyt
michael at freepascal.org
Wed Mar 26 21:57:38 CET 2014
On Wed, 26 Mar 2014, Jonas Maebe wrote:
> On 26/03/14 19:07, Michael Van Canneyt wrote:
>
>>
>> On Wed, 26 Mar 2014, Jonas Maebe wrote:
>>
>>> Specifying the directories in a
>>> relative way means that you can easily copy over a debug binary and
>>> all related source code from one system to another (or move things
>>> around) without breaking anything. For that reason, we explicitly add
>>> relative directory names to the DWARF debug info rather than absolute
>>> ones.
>>
>> As I wrote to Tomas:
>> This assumes that the directory structure on the other system is identical.
>>
>> An assumption that doesn't hold between e.g. 64-bit debian and fedora.
>
> The global directory structure of a system is irrelevant. Surely the
> directory structure of the lazarus or fpc source tree itself is identical on
> both systems. Those lazarus and fpc source directories themselves can be
> located anywhere, exactly because all paths to source files are relative to
> base directories rather than absolute.
Correct, UNLESS you use symlinks.
>
>> But I am not asking to change the way things are done unconditionally,
>> I understand your reasoning.
>
> I don't understand yours :)
There is only a problem in the case of symlinks.
>
>> During debugging, Lazarus consistently opens a file twice (or doesn't
>> find it at all) when symlinks are used in the path to the project file,
>> because there is a mismatch
>> between the relative path as lazarus sees it (logical), and the relative
>> path as FPC sees it (physical), and lazarus uses the debug info to open
>> the file.
>
> Well, it's the first I've heard about this problem and I don't remember
> seeing any bug reports about it either. I never use Lazarus to debug though.
If you don't use symlinks, there will not be a problem.
But I have first complained about the problem in lazarus already many years ago.
That there still is a problem should be clear from the screenshot I sent in my other mail.
>
>> I'm advocating to make this behaviour configurable:
>
> File a bug report/feature request :) I also don't know by heart the
> ramifications for Stabs and/or Stabx. And e.g. for the JVM target, adding any
> kind of directory information is forbidden by the specifications.
Well, I have been playing with GDB and bash/tcsh on the command-line.
I cannot reproduce the problem using command-line tools, which reinforces my belief that
FPC is right in using physical (and not logical) paths. That in turn means to me that the
IDE should simply also resolve the directories of projects to physical directories.
(unless Mattias can still make a convincing case for another solution...)
Michael.
More information about the fpc-pascal
mailing list