NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
JIT debugging


Joined: 30 Jun 2009
Posts: 79
Reply with quote
Hi,

It looks like there's a bug in dbg JIT settings. My php.ini [debugger] section is as follows:

Code:

[debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_deny=ALL
debugger.hosts_allow=dev
debugger.ports=7777, 10000/16
debugger.JIT.enabled=on
debugger.JIT.host=i7
debugger.JIT.port=7777, 10000/16
debugger.JIT.trig_errors=Error
debugger.JIT.trig_exceptions=Exception


For some reason JIT debugging always trying to connect to port 7869 on dev:

Warning: Failed to start DBG session, reason: "failed to connect to the client at 192.168.25.25:7869, please make sure that IDE is running"

Phpinfo JIT section:
Code:

debugger.JIT.enabled   On   On
debugger.JIT.host   dev   dev
debugger.JIT.ignore_exceptions   no value   no value
debugger.JIT.port   7777, 10000/16   7777, 10000/16
debugger.JIT.trig_errors   Error   Error
debugger.JIT.trig_exceptions   Exception   Exception


To fix it I have to change my PHPEd debugger port to 7869 and modify non-JIT port setting as follows:
Code:

debugger.ports=7869,7777, 10000/16


Obviously, I still want to use port 7777.

ALSO, I have to point out that JIT documentation at http://www.nusphere.com/products/php_debugger_advanced.htm is incorrect:

Code:
debugger.JIT_enabled=on

should be
Code:
debugger.JIT.enabled=on


And finally, a question. What are the valid values of the following directives:
Code:

debugger.JIT.trig_errors=Error
debugger.JIT.trig_exceptions=Exception


Thanks,
Temuri
View user's profileFind all posts by temuriSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
debugger.JIT.port=7777, 10000/16
^^^^^^^^^^^^^^^^^^^^^^^
this is wrong, you need a single number here, not a range.

Quote:
And finally, a question. What are the valid values of the following directives

list of exception classes that will trigger JIT.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2009
Posts: 79
Reply with quote
dmitri,

I did try debugger.JIT.port=7777 but the result is still the same. Looks like a bug to me. How can I file it?

For everyone else: valid value of "debugger.JIT.trig_errors" is one of PHP reporting errors: for example, E_ALL. Make sure that your PHP reporting error is not lower than the value of that directive.

Thanks,
Temuri
View user's profileFind all posts by temuriSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Looks like you forgot to restart web server or php-cgi daemon (whichever you use)
All settings from php.ini are picked during startup only. Make sure you see changes in phpinfo.
Also, take into account that JIT_port works only if there is NO regular DBGSESSID request(s), otherwise port will be taken from it and default port will be used in DBGSESSID does not specify any. Run debug against a script with phpinfo() call, and check the output to see if there is DBGSESSID.
Finally, JIT_port does not work if you use DebugBreak() to trigger debugger. In this case you have to call this function with the same argument as used in DBGSESSID line.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2009
Posts: 79
Reply with quote
dmitri,

I did restart the web server and all settings DO show in php.ini dbg section. That is 100% a bug. I've been using PHPEd debugging since very early versions, so you can trust me I didn't make any silly mistake.

And I understand what you're saying about DBGSESSID requests and debugbreak, I assure you that it is not the case. I understand what JIT is and how it is supposed to work. It just goes to the wrong port, regardless of configuration, simple as that.

Looking forward to have it fixed.

Thanks,
Temuri
View user's profileFind all posts by temuriSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
It works fine with 8888 or 7777 or whatever else JIT port. Just nothing to fix. Most probably you don't get how it works. Read below:

Note: JIT is JIT, it means that debug session is not started by IDE (with DBGSESSID in environment or in the arguments for CLI) and you don't call DebugBreak() function. It triggers by itself just-in-time when an error or another event happens - any error that matches debugger.JIT.trig_errors mask or exception with allowed class listed in debugger.JIT.trig_exceptions.
It works fine this way. Moreoever, if you call DebugBreak() _without_ an argument it also uses JIT host and port. If you put any non-empty argument, it tries to find host and port in it or falls back to localhost and 7869 by default.

If you see that debugger uses 7869 and ignores JIT port, it means that you have DBGSESSID and or DebugBreak() is called with parameters. Run phpinfo() in this script to check for DBGSESSID. You can also shutdown dbglistener and check debugger output to see what triggered it. It shows this info in REASON line.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2009
Posts: 79
Reply with quote
dmitri,

First of all, let me assure you that I know what JIT is. Everything you said above is not new to me. I know the difference between JIT and debugbreak.

Do you mind pasting here the php.ini section that is working for you and triggers JIT on port 7777. That will answer my questions.

Thanks.
View user's profileFind all posts by temuriSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
no problems.

/etc/php.d/dbg.ini
===============

extension=dbg-php-5.3.so

[debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.ports=7777, 10000/16
debugger.JIT.enabled=on
debugger.JIT.host=192.168.159.1
debugger.JIT.port=7777
debugger.JIT.trig_errors=E_ALL
debugger.JIT.trig_exceptions=Exception


script.php
======
<?php
include "a non existing script to include";
?>

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Jul 2006
Posts: 70
Reply with quote
Do the JIT settings get used if I just want to omit the @Host:port part in a DBGSESSID= parameter at the command line?

I have for php -i:
debugger.JIT.enabled => Off => Off
debugger.JIT.host => 127.0.0.1 => 127.0.0.1
debugger.JIT.ignore_exceptions => no value => no value
debugger.JIT.port => 7870 => 7870
debugger.JIT.trig_errors => no value => no value
debugger.JIT.trig_exceptions => Exception => Exception

Yet when I do `command DBGSESSID=2\;d=0,p=1,c=0`

I get:
DBG 5.0.8
Failed to start DBG session


Reason: connection to the client at ::1:7869 is not allowed in php configuration

Not sure what it means? Visit http://www.nusphere.com/dbg/?err=-100 for troubleshooting.

Debugger request: "2;d=0,p=1,c=0"
Request found in: "$_SERVER['argv']"
Target PHP version: "5.5.x"
Server API: "Command Line Interface"
Extensions API: "220121212"
Modules API: "20121212"
PHP API: "20121113"

Not that it's a huge deal, but tired of typing in the 127.0.0.1:7870 all the time, can it pick those up from the JIT settings or can I specify the "default host / default port" when not specified for DBGSESSID= parameters?
View user's profileFind all posts by cpriestSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
debugger.JIT.host is really used if hostname to connect to is not found anywhere else (incl. GET/POST/COOKIE/argv)
as of "connection to the client at ::1:7869 is not allowed in php configuration", you may want to add ::1 address to debugger.hosts_allow

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Jul 2006
Posts: 70
Reply with quote
Okay, I'll give that a try, thanks dmitri
View user's profileFind all posts by cpriestSend private message
JIT debugging
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic