Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93065 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89541 invoked from network); 4 May 2016 09:28:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 May 2016 09:28:46 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Received: from [82.113.146.227] ([82.113.146.227:45056] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/02-08540-AC0C9275 for ; Wed, 04 May 2016 05:28:43 -0400 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 6B38710C7A1; Wed, 4 May 2016 10:28:39 +0100 (BST) Date: Wed, 4 May 2016 10:28:39 +0100 (BST) X-X-Sender: derick@whisky.home.derickrethans.nl To: Dmitry Stogov cc: Nikita Popov , PHP Developers Mailing List In-Reply-To: Message-ID: References: , User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [PHP-DEV] zend_pass_function/zif_pass From: derick@php.net (Derick Rethans) On Wed, 4 May 2016, Dmitry Stogov wrote: > I don't see a big problem exporting zif_pass, if this's really necessary. Bob already committed that, and I've a PR for Xdebug too: https://github.com/xdebug/xdebug/pull/271/commits/c4a539d75f0d2546e9d0cb0dbc06f5a7a31f447e cheers, Derick > ________________________________ > From: Nikita Popov > 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 > 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 > > $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 > -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine