Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / README.ZEND_VM
| From: | Sara Golemon | Date: | Fri, 01 Oct 2004 21:47:30 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / README.ZEND_VM | ||
| References: | 1 2 3 4 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-3066@lists.php.net to get a copy of this message | ||
> Okay, so I can call it alright and overriding with:
>
> zend_opcode_handlers[ZEND_EXIT] = xdebug_exit_handler;
>
> works too, but I've some troubles getting my code to work that is
> handling the exit handler:
>
> zend_exit_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
>
What about:
static void (*old_exit_handler)(ZEND_OPCODE_HANDLER_ARGS);
int xdebug_exit_handler(ZEND_OPCODE_HANDLER_ARGS)
{
/* blah blah blah */
return old_exit_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
PHP_MINIT_FUNCTION(xdebug) {
old_exit_handler = zend_opcode_handlers[ZEND_EXIT];
zend_opcode_handlers[ZEND_EXIT] = xdebug_exit_handler;
/* etc...etc...etc... */
return SUCCESS;
}
Of course, this won't work under the switch vm, and I havn't even looked at
the goto model, but the 5.0-esque call format should handle it fine....
-Sara