[fpc-pascal] fpc in symlinked directory

Michael Van Canneyt michael at freepascal.org
Wed Mar 26 19:32:09 CET 2014



On Wed, 26 Mar 2014, Michael Van Canneyt wrote:

>
> The problem is easy to reproduce, as Mattias demonstrated.
>
> 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.

To demonstrate that the problem is real:

Attached is a screenshot. Remark that the same files are opened twice.

How did I get there ? Simple:

I have /home/michael/FPC/trunk as my copy of FPC trunk.

I have a symlink /home/michael/fpc pointing to the trunk directory.

I opened a project /home/michael/fpc/utils/pas2js/pas2js.lpr (used the symlink), 
with all files in /home/michael/fpc/packages/fcl-js/src opened in the ide. 
I put a breakpoint in jsparser.pp.

I hit run, and when hitting the breakpoints, Lazarus opens the source files AGAIN,
but now with base path /home/michael/FPC/trunk, and appends a (2) after the filename.

Extremely annoying, and since I do a lot of work in trunk, I stopped using the 
symlinked directories when opening files.

Just to show that this is not some freak occurrence, but a major PITA.

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error.png
Type: image/png
Size: 31122 bytes
Desc: 
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140326/5bba56c0/attachment.png>


More information about the fpc-pascal mailing list