Xdebug ignores breakpoints

不问归期 提交于 2019-11-27 13:12:51
Jeroen Fiege

It looks like there is something wrong with the path to the file containing the breakpoint.

<- breakpoint_set -i 452 -t line -s enabled 
   -f file:///http:/development.xxx.de/users/itsame/index.php -n 15 ->

I've had a similar problem with Eclipse. Only my breakpoints in the index file were accepted and breakpoints in other files—that were included in the index—were ignored.

I looked in the remote_log file and saw the following:

<- breakpoint_set -i 260 -t line 
   -f file:///~jeroen/workspace/fieg/wp-content/plugins/fieg/fieg.php -n 22-> 
<response xmlns="urn:debugger_protocol_v1" 
   xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" 
   transaction_id="260" id="48060002"></response>

I noticed that the path for the breakpoint was all wrong. It turned out that I had to setup Port Mapping in Eclipse. After setting the correct mapping the breakpoints started working. Also my remote_log now shows the correct path:

<- breakpoint_set -i 333 -t line 
   -f file:///Users/jeroen/Workspace/fieg/wp-content/plugins/fieg/fieg.php -n 12->     
<response xmlns="urn:debugger_protocol_v1" 
   xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" 
   transaction_id="333" id="48080005"></response>

I'm not sure if there is an equivalent of the Eclipse Port Mapping configuration in Netbeans, but hopefully I pointed you in the good direction.

For me the problem was "Project properties > Source > Web Root:" was not set (it had a default " as its value).

After setting it to be my web root on disk, the breakpoints started working.

dajibs

In your php.ini file, set this directive:

report_zend_debug = 1

I hope this help someone?

Go to: Project > Properties > Run Configuration > Advanced (button)

Remove all the mappings from the "Path Mapping" if you are not using Xdebug for remote debugging. This would help to fix this issue.

The question mentioned that the xdebug.ini file exists, but does not report its contents. My default installation's file only included:

zend_extension=/usr/lib/php5/20100525/xdebug.so

But in order for debugging to actually happen, it must be enabled. Add this line:

xdebug.remote_enable=1

Then phpinfo() will report a functioning xdebug:

I came across this post trying to solve my xdebug problem in eclipse not breaking at break points for a web application. I found the comments herein very useful. Also, this post http://www.devside.net/wamp-server/netbeans-waiting-for-connection-netbeans-xdebug-issue came in very handy to solve my issue. I just had to set the following flag in my relevant php.ini.

xdebug.remote_enable=1

xdebug would continuously wait on the session but after setting the remote debug flag the session wait issue, breaking point issue as well the xdebug log file that I had defined also started logging transactions.

Yet another possible solution, the only one that worked for me, after trying everything in this post and in many others...

I'm debugging a PHP project through XDEBUG on Eclipse Neon on Windows. The source is remote Linux, mounted locally as a drive through SFTP. It's probably my own fault that this isn't set up correctly...

In Eclipse, right-click your project, then select Configure, then Add PHP Support. Immediately, the DLTK indexing started; before that it wouldn't start no matter what.

Then I had to open my source and set the breakpoints through Remote File Explorer. I hope this helps someone.

I had the same problem: Eclipse breakpoints did not work, xdebug_break() did work. My problem were spaces in the path:

<- breakpoint_set -i 1323 -t line -f file:///Users/admin/Documents/projects/something/path%2520with%2520space/web/index.php -n 223
-> 
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1323" id="385680235"></response>

After changing the path to something without spaces the breakpoints in Eclipse worked fine.

Solved! When creating a new project in NetBeans, I first set the root folder of the project to the WordPress theme folder of my WordPress site. So instead, I created a new project with the root of it being the root of the entire WordPress site rather than just its theme, and the breakpoints started to work. Woohoo!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!