Menu

#197 Xdebug and breakpoints

open
5
2010-06-06
2010-06-06
Anonymous
No

versions:
xDebug: 2.1.0rc1
Eclipse 3.5: Build ID - 20100218-1602
SimpleTest 1.01
PHP 5.3

Background:
Getting debugging to work in Eclipse and PHP 5.3 has been a major pain. Refactoring in PHP has seemed to have broken Zend Debugger and xDebug with their latest stable releases.
I was able to get debuggin to work (albeit a little crash prone) with xDebug the lateset release of xDebug.

Symtpoms:
Debugging in Eclipse normally works, running Debug As under simpletest ignores all breakpoints. The documentation on the website stated that 5.3 was supported with xDebug so I am assuming there is some sort of bug.

Any input would be fantastic. Not being able to hook into code and step through kills one of the major benefits of unittesting for me.

Discussion

  • Anonymous

    Anonymous - 2010-06-06

    I should add I am using the eclipse plugin for simpletest.

     

    Last edit: Anonymous 2014-03-22
  • Steven Balthazor

    The debugging in the simpletest plugin was always a hack that even I thought was slow. The real fix to make it run faster and better required rewriting the whole plugin which I never have had time to do.

    I personally have setup each of my simpletest tests to include the autorun.php; then I just right click and run the test using the eclipse php run as/debug as php script functionality - no need even for the plugin. You do lose the red/green bar and the ability to clickthrough to see where the failures are; however, I found it to be much faster especially for short tests (because the startup time is significantly reduced).

    If you are really intent on trying to make this work. The place to start is to analyze the string which gets dumped to the console (this is the commandline string which is getting run behind the scenes) - try running that manually from the commandline, you might see some errors that are getting absorbed by the background process. Off the top of my head I would guess there may be permission issues (Vista/Win7) opening the debug port (9000?).

    The problem could be caused by the php executable you are using (cli/cgi?) and maybe even changes to the switches which are passed to the executable (it looks like there is a -q and a -c.

    The problem could be that the simpletest php process is using a different php executable than eclipse; the simpletest php process could be using a different php.ini than eclipse. Either of which could result in a different version of Xdebug being used...

    This was the problem I had with adding debugging to the simpletest plugin - the problems come from the local configuration (8 times out of 10) and it is very difficult to troubleshoot. The plugin was written before there was even a thought of the PDT for eclipse. If the plugin were re-written it would use the built-in run/debug capabilities of the PDT.

    Regards,
    Steven Balthazor
    stevenbalthazor@gmail.com

     

Log in to post a comment.