I tried debugging Eclipse to understand what was going on in my Mac OS X.
First find the currently running Eclipse process:
$ ps -ef | grep eclipse 501 15160 373 0 4:21PM ?? 2:57.19 /Users/myuser/apps/eclipse/Eclipse.app/Contents/MacOS/eclipse -psn_0_651423
Then trace the Eclipse system calls:
$ sudo dtruss -fp 15160 [... omissis ...] accept(0xA0, 0x1224C37E8, 0x1224C37E4) = 103 0 setsockopt(0x67, 0xFFFF, 0x1002) = 0 0 setsockopt(0x67, 0xFFFF, 0x1001) = 0 0 read(0x67, "4\0", 0x1) = 1 0 read(0x67, "7\0", 0x1) = 1 0 read(0x67, "7\0", 0x1) = 1 0 read(0x67, "\0", 0x1) = 1 0 read(0x67, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<init xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"http://xdebug.org/dbgp/xdebug\" fileuri=\"file:///opt/local/var/db/php5/pear/pear-ini.php\" language=\"PHP\" protocol_version=\"1.0\" appid=\"14961\" idekey=\"ECLIPSE_DB", 0x1DD) = 477 0 read(0x67, "\0", 0x1) = 1 0 [... omissis ...]
Here I caught the first line sent from xdebug.
This is the line where eclipse reads the XML fragment. I suppose this is part of DBGp.
<?xml version="1.0" encoding="iso-8859-1"?> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///opt/local/var/db/php5/pear/pear-ini.php" language="PHP" protocol_version="1.0" appid="14961" idekey="ECLIPSE_DB
Looking at fileuri I found that Xdebug is trying to start a debugging session using /opt/local/var/db/php5/pear/pear-ini.php . The pear-ini.php does not exist in my Eclipse projects.
So I create a new project in my Eclipse workspace, and here I copied the file /opt/local/var/db/php5/pear/pear-ini.php
This works, the Eclipse PDT now finds the file that it was looking for, and the debugger finally starts correctly. He even asks me if I want to switch to the debugging perspective.
Conclusion
If you come across this strange error: "The corresponding file was not found or the file was not selected." This means what is written. Well, my Eclipse could not find the file, but it also meant that it was trying to find a file that was outside its workspace. There may be a file that is being downloaded from the PHP engine for some strange reason. In my case, pear-ini.php added automatically using pear.ini
$ cat pear.ini ; Do not edit this file; it is automatically generated by MacPorts. ; Any changes you make will be lost if you upgrade or uninstall php5-pear. ; To configure PHP, edit /opt/local/etc/php5/php.ini. auto_prepend_file = '/opt/local/var/db/php5/pear/pear-ini.php'