Re: zend_pass_function/zif_pass
| From: | Joe Watkins | Date: | Wed, 04 May 2016 08:56:24 +0000 |
| Subject: | Re: zend_pass_function/zif_pass | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93063@lists.php.net to get a copy of this message | ||
Morning Dmitry,
Bob already exported it.
http://git.php.net/?p=php-src.git;a=commit;h=f59de7ea368da55f1f21ca82810febb3cdec06f0
Cheers
Joe
On Wed, May 4, 2016 at 7:28 AM, Dmitry Stogov <dmitry@zend.com> wrote:
> I don't see a big problem exporting zif_pass, if this's really necessary.
>
>
> Thanks. Dmitry.
>
> ________________________________
> From: Nikita Popov <nikita.ppv@gmail.com>
> Sent: Saturday, April 30, 2016 8:40:54 PM
> To: Derick Rethans
> Cc: Dmitry Stogov; PHP Developers Mailing List
> Subject: Re: [PHP-DEV] zend_pass_function/zif_pass
>
> On Sat, Apr 30, 2016 at 7:12 PM, Derick Rethans <derick@php.net<mailto:
> derick@php.net>> wrote:
> 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
>
> Hey Derick!
>
> This change is due to
> http://www.serverphorums.com/read.php?7,1439618,1439618 /
>
> https://github.com/php/php-src/commit/8e5b139732893d2a5f6ba3ae0a0b2b5cf6dba09f
> .
>
> I don't see a good way for you to handle this as things stand now. I think
> we should export the zend_pass_function symbol.
>
> Nikita
>