[xdebug-dev] xdebug xdebug/php_xdebug.h xdebug/xdebug.c - Added xdebug_debug_zval_stdout().

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 14 Jun 2005 09:41:18 +0200

Date: Tue Jun 14 09:41:17 CEST 2005
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Added xdebug_debug_zval_stdout().

Modified files:
           xdebug/php_xdebug.h (version: 1.89)
           xdebug/xdebug.c (version: 1.261)

[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- xdebug/php_xdebug.h:1.88 Sun Mar 06 20:55:31 2005 GMT
+++ xdebug/php_xdebug.h Tue Jun 14 05:41:16 2005 GMT
@@ -65,6 +65,7 @@
 
 PHP_FUNCTION(xdebug_var_dump);
 PHP_FUNCTION(xdebug_debug_zval);
+PHP_FUNCTION(xdebug_debug_zval_stdout);
 
 /* activation functions */
 PHP_FUNCTION(xdebug_enable);

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -r1.260 -r1.261
--- xdebug/xdebug.c:1.260 Tue May 03 12:34:28 2005 GMT
+++ xdebug/xdebug.c Tue Jun 14 05:41:16 2005 GMT
@@ -127,6 +127,7 @@
 
         PHP_FE(xdebug_var_dump, NULL)
         PHP_FE(xdebug_debug_zval, NULL)
+ PHP_FE(xdebug_debug_zval_stdout, NULL)
 
         PHP_FE(xdebug_enable, NULL)
         PHP_FE(xdebug_disable, NULL)
@@ -1698,7 +1699,7 @@
                         }
                 }
         }
- efree(buffer);
+// efree(buffer);
 
         /* Bail out if we can't recover */
         switch (type) {
@@ -1958,6 +1959,42 @@
 }
 /* }}} */
 
+/* {{{ proto void xdebug_debug_zval_stdout(mixed var [, ...] )
+ Outputs a fancy string representation of a variable */
+PHP_FUNCTION(xdebug_debug_zval_stdout)
+{
+ zval ***args;
+ int argc;
+ int i, len;
+ char *val;
+ zval *debugzval;
+
+ argc = ZEND_NUM_ARGS();
+
+ args = (zval ***)emalloc(argc * sizeof(zval **));
+ if (ZEND_NUM_ARGS() == 0 || zend_get_parameters_array_ex(argc, args) == FAILURE) {
+ efree(args);
+ WRONG_PARAM_COUNT;
+ }
+
+ for (i = 0; i < argc; i++) {
+ if (Z_TYPE_PP(args[i]) == IS_STRING) {
+ XG(active_symbol_table) = EG(active_symbol_table);
+ debugzval = xdebug_get_php_symbol(Z_STRVAL_PP(args[i]), Z_STRLEN_PP(args[i]) + 1);
+ if (debugzval) {
+ printf("%s: ", Z_STRVAL_PP(args[i]));
+ val = get_zval_value(debugzval, 1);
+ printf("%s(%d)", val, strlen(val));
+ xdfree(val);
+ printf("\n");
+ }
+ }
+ }
+
+ efree(args);
+}
+/* }}} */
+
 PHP_FUNCTION(xdebug_enable)
 {
         zend_error_cb = new_error_cb;
Received on Tue Jun 14 2005 - 09:41:20 BST

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