Hi!
I'm trying to make Xdebug up to date with master again, and after fixing
the static changes that Dmitry highlighted, I am still baffled by
something else.
My function traces now have an extra entry for each constructor - even
for classes that have no constructor, such as stdClass.
Code
<?php
$tf = xdebug_start_trace(sys_get_temp_dir() . '/'. uniqid('xdt', TRUE));
$a = new StdClass;
xdebug_stop_trace();
echo file_get_contents($tf);
?>
In PHP 7.1 (master) this generates:
=> $tf = '/tmp/xdt5724dfa31b3050.51884776.xt'
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:2
0.0017 386376 -> {main}()
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:0
=> $a = class stdClass { }
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:4
0.0017 386472 -> xdebug_stop_trace()
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:6
0.0018 386568
Where as in PHP 5.6 and 7.0, it generates:
TRACE START [2016-04-30 17:10:19]
=> $tf = '/tmp/xdt5724e6fb674b31.38510038.xt'
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:2
=> $a = class stdClass { }
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:4
0.0006 274008 -> xdebug_stop_trace()
/home/derick/dev/php/derickr-xdebug/tests/assignment-trace11.php:6
0.0006 274128
TRACE END [2016-04-30 17:10:19]
The master version has the extra {main}, which comes from an additional
call to zend_execute_internal.
When looking into this, I see that that extra frame is a handle
zend_pass_function / zif_pass. How has this changed recently, and more
importantly, how can I detect this? I can't do "edata.func ==
zend_pass_function" as neither zend_pass_function or zif_pass are
exported symbols.
Any hints on how to handle this?
cheers,
Derick
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php