Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63301 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72083 invoked from network); 9 Oct 2012 11:45:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2012 11:45:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.215.42 mail-la0-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:32817] helo=mail-la0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/D7-23861-B3E04705 for ; Tue, 09 Oct 2012 07:45:00 -0400 Received: by mail-la0-f42.google.com with SMTP id e6so2994153lah.29 for ; Tue, 09 Oct 2012 04:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KvSD3q3qBi19EPv0p1Dre//7/s3xdlp2SFvznKoD93s=; b=Nk85SIERzrWjqYT66fX+fvMUTQkjNFeBc683/Fr9PTomQBivQfmlJ20JE45+dJSocl UYu9CMVDeCNIg1EzkIPIT2lnvgZ5uydvxfQ2VorPaioDWFhxWrypCTsx9WqWbKjCbRBd 3i0NxMxOnRyNQbH1l83WgZUn+IuGs5Q0OxKKfDrlXrr3ASOab+vXmiPTRLIZPP7QO17L wHiwobqn9MoCGRAzfv5UY1mDzZtFTDBzMtAXl3wZlPU+O1tGxKGDFxVpJdTeunHyzfZs A/F+cpy85hSSyB8bxAf6lTsD/MSuvjlsgIYFKbYD/mZHZyirM+W8d4F4YT9TTxeB9BbE dTXw== MIME-Version: 1.0 Received: by 10.152.106.162 with SMTP id gv2mr16124691lab.14.1349783096958; Tue, 09 Oct 2012 04:44:56 -0700 (PDT) Received: by 10.112.83.100 with HTTP; Tue, 9 Oct 2012 04:44:56 -0700 (PDT) In-Reply-To: References: <50691A4F.70702@sugarcrm.com> Date: Tue, 9 Oct 2012 13:44:56 +0200 Message-ID: To: Derick Rethans Cc: Stas Malyshev , PHP Internals , "nikic@php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] generators & php tools From: nikita.ppv@gmail.com (Nikita Popov) On Thu, Oct 4, 2012 at 9:45 AM, Derick Rethans wrote: > On Sun, 30 Sep 2012, Stas Malyshev wrote: > >> I was looking into generators topic and I couldn't find answer to this >> question: how generators are supposed to interact with PHP tools, such >> as debuggers, profilers, etc.? Specifically, how calls to generator >> are handled? Usually, the tool overrides zend_execute and >> zend_execute_internal and every function call goes through there. But >> generator does not use these - it uses execute_ex instead. So can >> generator be debugged/profiled? What happens if I say "step out" >> inside generator - would that work? > > It won't work with Xdebug right now, as it indeed overrides just > zend_execute and zend_execute_internal --- we should definitely look at > fixing generators that they go through those as well. It's related to > the zend_execute_internal hook missing from the other email that I just > replied to (and your PR 178). > > cheers, > Derick Generators won't be able to go through zend_execute, because they need to work on an existing execution context and not create a new one on every resume. So instead we will probably need an additional hook for execute_ex (in which case the existing execute hook isn't really necessary anymore). Would that be okay? Nikita XDebug execute and execute_internal: https://github.com/derickr/xdebug/blob/master/xdebug.c#L1215 https://github.com/derickr/xdebug/blob/master/xdebug.c#L1442