Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14836 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1261 invoked by uid 1010); 11 Feb 2005 21:52:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1236 invoked from network); 11 Feb 2005 21:52:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2005 21:52:29 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.4/2.6 Received: from ([80.74.107.235:51532] helo=mail.zend.com) by pb1.pair.com (ecelerity 1.2.11 (r4403)) with SMTP id 10/A4-38127-6192D024 for ; Fri, 11 Feb 2005 16:52:23 -0500 Received: (qmail 16446 invoked from network); 11 Feb 2005 20:52:18 -0000 Received: from localhost (HELO andi-notebook.zend.com) (127.0.0.1) by localhost with SMTP; 11 Feb 2005 20:52:18 -0000 Message-ID: <5.1.0.14.2.20050211125111.020305f0@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 11 Feb 2005 12:52:09 -0800 To: Derick Rethans Cc: George Schlossnagle ,Sara Golemon , internals@lists.php.net In-Reply-To: References: <5.1.0.14.2.20050210183341.01d3eb00@localhost> <20050209155704.61669.qmail@lists.php.net> <20050209055745.928.qmail@web50206.mail.yahoo.com> <20050209155704.61669.qmail@lists.php.net> <5.1.0.14.2.20050210183341.01d3eb00@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Re: intercepting function calls From: andi@zend.com (Andi Gutmans) OK you got a point. It doesn't really hurt to keep it so I'll leave it all in. I can think of cases where using those opcodes might be easier to use at runtime than overloading zend_execute. Andi At 09:09 AM 2/11/2005 +0100, Derick Rethans wrote: >On Thu, 10 Feb 2005, Andi Gutmans wrote: > > > At 11:01 AM 2/9/2005 -0500, George Schlossnagle wrote: > > > > >On Feb 9, 2005, at 10:57 AM, Sara Golemon wrote: > > > > > >>>Is it possible to intercept a function call (user > > >>>space or built-in) in the Zend Engine and execute user > > >>>space code before/after the function call? > > >>Yes, you can do this by way of a Zend extension (not a PHP extension mind > > >>you). > > >> > > >>The parts of Zend/zend_extensions.h you'll want to pay attention to are: > > > > > >You can also do this by directly wrapping zend_execute. This is the > > >preferred method if you're writing a profiler or such. > > > > Yeah. Actually I thought we already nuked the old way. > > Is anyone using it? > >I'm using: >ZEND_DLEXPORT zend_extension zend_extension_entry = { > XDEBUG_NAME, > XDEBUG_VERSION, > XDEBUG_AUTHOR, > XDEBUG_URL, > "Copyright (c) 2002, 2003, 2004", > xdebug_zend_startup, > xdebug_zend_shutdown, > NULL, /* activate_func_t */ > NULL, /* deactivate_func_t */ > NULL, /* message_handler_func_t */ > NULL, /* op_array_handler_func_t */ > xdebug_statement_call, /* statement_handler_func_t */ > NULL, /* fcall_begin_handler_func_t */ > NULL, /* fcall_end_handler_func_t */ > NULL, /* op_array_ctor_func_t */ > NULL, /* op_array_dtor_func_t */ > STANDARD_ZEND_EXTENSION_PROPERTIES >}; > >I really need the statement call callback for single stepping through >code. > >regards, >Derick > >-- >Derick Rethans >http://derickrethans.nl | http://ez.no | http://xdebug.org