[xdebug-general] Beginners problem: breakpoints don't work

From: Sebastian Bertho <ca-xdebug[@]bertho.de>
Date: Thu, 24 Jan 2008 14:45:52 +0100

Hello,

today I tried to install xdebug. So far everything worked fine. I use
wampserver2.0 (www.wampserver.com) (which means PHP 5.2.5, Apache 2.2.6,
Windows XPSP2) with php_xdebug-2.0.2-5.2.5.dll.
php.ini says:

[xdebug]
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
zend_extension_ts="c:/wamp/bin/php/php5.2.5/ext/php_xdebug-2.0.2-5.2.5.dll"
xdebug.remote_log="c:/wamp/logs/xdebug_log.txt"

Als Debug-Clients I tried PDT and a Notepad++-Plugin. In both cases
breakpoints that I set up using the debug-GUI do not work - the script
does not stop at these points.
However - if I use "xdebug_break()", the program stops and the debug-GUI
is working fine.

I tried to resolve the problem, but I'm not so familar with the
xdebug-protocol - as far as I understand, the breakpoints are send to
the xdebug extension. So is there a way to get some more information,
why the breakpoints are skipped?

My PHP-Application ist:
<?php
    for ($i=0; $i<2;$i++) {
        echo "Test $i\n";
        //sleep(1000);
// xdebug_break();
    }
    xdebug_break();
?>

Which leads to the following xdebug_log.txt:
Log opened at 2008-01-24 13:34:15
-> <init xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///C:/wamp/www/test.php" language="PHP"
protocol_version="1.0" appid="656" idekey="test"><engine
version="2.0.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick
Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright
(c) 2002-2007 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n max_depth -v 3
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set"
transaction_id="1" feature="max_depth" success="1"></response>

<- feature_set -i 2 -n max_children -v 15
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set"
transaction_id="2" feature="max_children" success="1"></response>

<- breakpoint_set -i 3 -t line -f file:///c:\wamp\www\test.php -n 3 -s
enabled -h 0 -o >=
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set"
transaction_id="3" state="enabled" id="6560007"></response>

<- breakpoint_list -i 4
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list"
transaction_id="4"><breakpoint type="line"
filename="file:///c:/wamp/www/test.php" lineno="3" state="enabled"
hit_count="0" hit_condition="&gt;=" hit_value="0"
id="6560007"></breakpoint></response>

<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into"
transaction_id="5" status="break" reason="ok"><xdebug:message
filename="file:///C:/wamp/www/test.php"
lineno="7"></xdebug:message></response>

<- stack_get -i 6
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get"
transaction_id="6"><stack where="xdebug_break" level="0" type="file"
filename="file:///C:/wamp/www/test.php" lineno="7"></stack><stack
where="{main}" level="1" type="file"
filename="file:///C:/wamp/www/test.php" lineno="7"></stack></response>

<- breakpoint_list -i 7
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_list"
transaction_id="7"><breakpoint type="line"
filename="file:///c:/wamp/www/test.php" lineno="3" state="enabled"
hit_count="0" hit_condition="&gt;=" hit_value="0"
id="6560007"></breakpoint></response>

<- context_get -i 8 -c 0
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get"
transaction_id="8" context="0"></response>

<- context_get -i 9 -c 1
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get"
transaction_id="9" context="1"><property name="_COOKIE"
fullname="$_COOKIE" address="118270240" type="array" children="1"
numchildren="1"><property name="XDEBUG_SESSION"
fullname="$_COOKIE[&apos;XDEBUG_SESSION&apos;]" address="118270552"
type="string" size="4"
encoding="base64"><![CDATA[dGVzdA==]]></property></property><property
name="_ENV" fullname="$_ENV" address="118275648" type="array"
children="0" numchildren="0"></property><property name="_FILES"
fullname="$_FILES" address="118270888" type="array" children="0"
numchildren="0"></property><property name="_GET" fullname="$_GET"
address="118269704" type="array" children="1" numchildren="1"><property
name="XDEBUG_SESSION_START"
fullname="$_GET[&apos;XDEBUG_SESSION_START&apos;]" address="118270152"
type="string" size="4"
encoding="base64"><![CDATA[dGVzdA==]]></property></property><property
name="_POST" fullname="$_POST" address="118270424" type="array"
children="0" numchildren="0"></property><property name="_REQUEST"
fullname="$_REQUEST" address="118290552" type="array" children="1"
numchildren="2"><property name="XDEBUG_SESSION_START"
fullname="$_REQUEST[&apos;XDEBUG_SESSION_START&apos;]"
address="118270152" type="string" size="4"
encoding="base64"><![CDATA[dGVzdA==]]></property><property
name="XDEBUG_SESSION" fullname="$_REQUEST[&apos;XDEBUG_SESSION&apos;]"
address="118270552" type="string" size="4"
encoding="base64"><![CDATA[dGVzdA==]]></property></property><property
name="_SERVER" fullname="$_SERVER" address="118278552" type="array"
children="1" numchildren="33" page="0" pagesize="15"><property
name="HTTP_HOST" fullname="$_SERVER[&apos;HTTP_HOST&apos;]"
address="118278928" type="string" size="9"
encoding="base64"><![CDATA[bG9jYWxob3N0]]></property><property
name="HTTP_USER_AGENT" fullname="$_SERVER[&apos;HTTP_USER_AGENT&apos;]"
address="118279288" type="string" size="85"
encoding="base64"><![CDATA[TW96aWxsYS81LjAgKFdpbmRvd3M7IFU7IFdpbmRvd3MgTlQgNS4xOyBkZTsgcnY6MS45YjIpIEdlY2tvLzIwMDcxMjExMjAgRmlyZWZveC8zLjBiMg==]]></property><property
name="HTTP_ACCEPT" fullname="$_SERVER[&apos;HTTP_ACCEPT&apos;]"
address="118279528" type="string" size="63"
encoding="base64"><![CDATA[dGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksKi8qO3E9MC44]]></property><property
name="HTTP_ACCEPT_LANGUAGE"
fullname="$_SERVER[&apos;HTTP_ACCEPT_LANGUAGE&apos;]"
address="118279768" type="string" size="35"
encoding="base64"><![CDATA[ZGUtZGUsZGU7cT0wLjgsZW4tdXM7cT0wLjUsZW47cT0wLjM=]]></property><property
name="HTTP_ACCEPT_ENCODING"
fullname="$_SERVER[&apos;HTTP_ACCEPT_ENCODING&apos;]"
address="118279992" type="string" size="12"
encoding="base64"><![CDATA[Z3ppcCxkZWZsYXRl]]></property><property
name="HTTP_ACCEPT_CHARSET"
fullname="$_SERVER[&apos;HTTP_ACCEPT_CHARSET&apos;]" address="118280248"
type="string" size="30"
encoding="base64"><![CDATA[SVNPLTg4NTktMSx1dGYtODtxPTAuNywqO3E9MC43]]></property><property
name="HTTP_KEEP_ALIVE" fullname="$_SERVER[&apos;HTTP_KEEP_ALIVE&apos;]"
address="118280448" type="string" size="3"
encoding="base64"><![CDATA[MzAw]]></property><property
name="HTTP_CONNECTION" fullname="$_SERVER[&apos;HTTP_CONNECTION&apos;]"
address="118280672" type="string" size="10"
encoding="base64"><![CDATA[a2VlcC1hbGl2ZQ==]]></property><property
name="HTTP_COOKIE" fullname="$_SERVER[&apos;HTTP_COOKIE&apos;]"
address="118280944" type="string" size="19"
encoding="base64"><![CDATA[WERFQlVHX1NFU1NJT049dGVzdA==]]></property><property
name="HTTP_CACHE_CONTROL"
fullname="$_SERVER[&apos;HTTP_CACHE_CONTROL&apos;]" address="118281240"
type="string" size="9"
encoding="base64"><![CDATA[bWF4LWFnZT0w]]></property><property
name="PATH" fullname="$_SERVER[&apos;PATH&apos;]" address="118281976"
type="string" size="269"
encoding="base64"><![CDATA[YzpccnVieVxiaW47QzpcUHJvZ3JhbW1lXFRoaW5rUGFkXFV0aWxpdGllcztDOlxXSU5ET1dTXHN5c3RlbTMyO0M6XFdJTkRPV1M7QzpcV0lORE9XU1xTeXN0ZW0zMlxXYmVtO0M6XFByb2dyYW1tZVxJbnRlbFxXaXJlbGVzc1xCaW5cO0M6XFByb2dyYW1tZVxBVEkgVGVjaG5vbG9naWVzXEFUSSBDb250cm9sIFBhbmVsO0M6XFByb2dyYW1tZVxBVEkgVGVjaG5vbG9naWVzXEFUSS5BQ0VcQ29yZS1TdGF0aWM7QzpcUHJvZ3JhbW1lXFRoaW5rUGFkXENvbm5lY3RVdGlsaXRpZXM=]]></property><property
name="SystemRoot" fullname="$_SERVER[&apos;SystemRoot&apos;]"
address="118282200" type="string" size="10"
encoding="base64"><![CDATA[QzpcV0lORE9XUw==]]></property><property
name="COMSPEC" fullname="$_SERVER[&apos;COMSPEC&apos;]"
address="118282336" type="string" size="27"
encoding="base64"><![CDATA[QzpcV0lORE9XU1xzeXN0ZW0zMlxjbWQuZXhl]]></property><property
name="PATHEXT" fullname="$_SERVER[&apos;PATHEXT&apos;]"
address="118282640" type="string" size="57"
encoding="base64"><![CDATA[LkNPTTsuRVhFOy5CQVQ7LkNNRDsuVkJTOy5WQkU7LkpTOy5KU0U7LldTRjsuV1NIOy5SQjsuUkJX]]></property><property
name="WINDIR" fullname="$_SERVER[&apos;WINDIR&apos;]"
address="118282848" type="string" size="10"
encoding="base64"><![CDATA[QzpcV0lORE9XUw==]]></property></property></response>

<- run -i 10
-> <response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run"
transaction_id="10" status="stopped" reason="ok"></response>

<- run -i 11
Log closed at 2008-01-24 13:34:23

Thanks in advance,
   Sebastian Bertho
Received on Thu Jan 24 2008 - 15:15:46 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST