0

I have the following simple php test file:

<?php
$a = 1 ;
$debug = true ;

This file has two linked filenames: testa and testa.php

I have set both of these files with a breakpoint at the third line ($debug = ....)

If I now invoke php testa.php, the script stops at line 3 and a mouseover of line 1's $a will reveal the value of $a (which is of course 1 at that point).

But if I instead invoke php testa, the script stops at line 3 and a mouseover of line 1's $a reveals the attributes of $a (int, etc) - but not a value. However, if I type $a into the debug console, I get the expected value of 1. I can also see the $a = 1 value in the Variables window, just not on mouseover.

Is VSCode actually, as it seems, functioning differently depending upon the extension of a filename? (I don't think VSCode should be enforcing rules about script naming standards. And, anyway, it seems weird that all other debug capabilities except this seem to work fine.)

If VSCode is doing that, is there a setting that I can use to control this?

7
  • two linked filesnames: what kind of link? have you tried symbolic linking and vice-versa hardlinking? does it change anything? which operating system? "If VSCode is doing that, is there a setting that I can use to control this?" Obviously this is file-system related, not editor or debugger related. Most debuggers work with the inodes of the file entries, not the inodes of the link entries. Commented Oct 19 at 17:49
  • @hakre this is Ubuntu 24.04. You say: "Obviously this is filesystem related...." How so 'obviously?' Since the same exact file is loaded into the debugger regardless the filename, how can this be a filesystem problem? And since VSCODE responds differently although the scripts have no differences (and clearly cannot have differewnces), how can this not be a VSCODE problem? On a Ubuntu 24.04 system, testa was created vi editor. The other was created via "ln testa testa.php" command Commented Oct 19 at 18:21
  • Symlinks are a feature of the file-system. So when the debugger or editor gets the path of the file, they get either the symlink pathname or the pathname of the real file. As you have written, with the one pathname (that from the symbolic link IIRC) there is a problem, but not with the other one. Therefore it is clearly caused by the file-system, because if you would use real file pathnames only, you confirm it working. Commented Oct 19 at 18:44
  • Btw. have you tried using a hardlink instead? How does then VSCode inter-execute with the debugger? Do they still have this kind of "communication problem" or are they better playing together? Commented Oct 19 at 18:46
  • @hakre thanks for the link lesson. Here's one for you: ln file1 file2 creates a hard link Commented Oct 19 at 18:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.