[xdebug-dev] xdebug xdebug/php_xdebug.h xdebug/xdebug.c xdebug/tests/scream.phpt - Added scream support (xdebug.scream) that makes the @ operator to be ignored.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Thu, 5 Mar 2009 15:38:52 +0100

Date: Thu Mar 5 15:38:52 CET 2009
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Added scream support (xdebug.scream) that makes the @ operator to be ignored.

Modified files:
           xdebug/php_xdebug.h (version: 1.146)
           xdebug/xdebug.c (version: 1.442)
Added files:
           xdebug/tests/scream.phpt (new version: 1.1)

[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- xdebug/php_xdebug.h:1.145 Mon Jan 05 16:24:34 2009 GMT
+++ xdebug/php_xdebug.h Thu Mar 05 13:38:52 2009 GMT
@@ -247,6 +247,8 @@
         HashTable aggr_calls;
         zend_bool profiler_aggregate;
 
+ /* scream */
+ zend_bool do_scream;
 ZEND_END_MODULE_GLOBALS(xdebug)
 
 #ifdef ZTS

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.441
retrieving revision 1.442
diff -u -r1.441 -r1.442
--- xdebug/xdebug.c:1.441 Mon Jan 05 16:24:34 2009 GMT
+++ xdebug/xdebug.c Thu Mar 05 13:38:52 2009 GMT
@@ -295,6 +295,9 @@
         STD_PHP_INI_ENTRY("xdebug.var_display_max_children", "128", PHP_INI_ALL, OnUpdateLong, display_max_children, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.var_display_max_data", "512", PHP_INI_ALL, OnUpdateLong, display_max_data, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.var_display_max_depth", "3", PHP_INI_ALL, OnUpdateLong, display_max_depth, zend_xdebug_globals, xdebug_globals)
+
+ /* Scream support */
+ STD_PHP_INI_BOOLEAN("xdebug.scream", "0", PHP_INI_ALL, OnUpdateBool, do_scream, zend_xdebug_globals, xdebug_globals)
 PHP_INI_END()
 
 static void php_xdebug_init_globals (zend_xdebug_globals *xg TSRMLS_DC)
@@ -420,6 +423,15 @@
         xdebug_arg_dtor(parts);
 }
 
+static int xdebug_silence_handler(ZEND_OPCODE_HANDLER_ARGS)
+{
+ if (XG(do_scream)) {
+ execute_data->opline++;
+ return ZEND_USER_OPCODE_CONTINUE;
+ }
+ return ZEND_USER_OPCODE_DISPATCH;
+}
+
 /* Needed for code coverage as Zend doesn't always add EXT_STMT when expected */
 #define XDEBUG_SET_OPCODE_OVERRIDE(f,oc) \
         zend_set_user_opcode_handler(oc, xdebug_##f##_handler);
@@ -651,6 +663,9 @@
         XDEBUG_SET_OPCODE_OVERRIDE(switch_free, ZEND_SWITCH_FREE);
         XDEBUG_SET_OPCODE_OVERRIDE(qm_assign, ZEND_QM_ASSIGN);
 
+ XDEBUG_SET_OPCODE_OVERRIDE(silence, ZEND_BEGIN_SILENCE);
+ XDEBUG_SET_OPCODE_OVERRIDE(silence, ZEND_END_SILENCE);
+
         if (zend_xdebug_initialised == 0) {
                 zend_error(E_WARNING, "Xdebug MUST be loaded as a Zend extension");
         }

[FILE: /xdebug/tests/scream.phpt]

--TEST--
Test for scream support.
--SKIPIF--
<?php if (!extension_loaded("xdebug")) print "skip"; ?>
--INI--
xdebug.enable=1
xdebug.auto_trace=0
xdebug.scream=0
error_reporting(E_ALL);
--FILE--
<?php
echo @strstr(), "\n";
ini_set('xdebug.scream', 1);
echo @strstr(), "\n";
ini_set('xdebug.scream', 0);
echo @strstr(), "\n";
?>
--EXPECTF--
Warning: Wrong parameter count for strstr() in %sscream.php on line 4
Received on Thu Mar 05 2009 - 15:46:48 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST