[xdebug-dev] xdebug xdebug/xdebug_superglobals.c

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Mon, 30 Aug 2004 09:03:11 +0200

Date: Mon Aug 30 09:03:11 CEST 2004
User: Derick Rethans
Directory: xdebug

Log Message:
- MFH: Fixed dumping of superglobals for numeric keys.

Modified files:
           xdebug/xdebug_superglobals.c (version: 1.10.2.1)

[FILE: /xdebug/xdebug_superglobals.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- xdebug/xdebug_superglobals.c:1.10 Sun Aug 31 08:54:06 2003 GMT
+++ xdebug/xdebug_superglobals.c Mon Aug 30 05:03:11 2004 GMT
@@ -28,12 +28,16 @@
         free(ptr);
 }
 
-static void dump_hash_elem(zval *z, char *name, char *elem, int html, int log TSRMLS_DC)
+static void dump_hash_elem(zval *z, char *name, long index, char *elem, int html, int log TSRMLS_DC)
 {
         char buffer[1024];
 
         if (html) {
- php_printf("<tr><td colspan='2' bgcolor='#ffffff'>$%s['%s']</td>", name, elem);
+ if (elem) {
+ php_printf("<tr><td colspan='2' align='right' bgcolor='#ffffff'>$%s['%s'] =</td>", name, elem);
+ } else {
+ php_printf("<tr><td colspan='2' align='right' bgcolor='#ffffff'>$%s[%ld] =</td>", name, index);
+ }
         }
 
         if (z != NULL) {
@@ -84,7 +88,11 @@
         tsrm_ls = va_arg(args, void ***);
 #endif
 
- dump_hash_elem(*((zval **) pDest), name, hash_key->arKey, html, log TSRMLS_CC);
+ if (hash_key->nKeyLength == 0) {
+ dump_hash_elem(*((zval **) pDest), name, hash_key->h, NULL, html, log TSRMLS_CC);
+ } else {
+ dump_hash_elem(*((zval **) pDest), name, 0, hash_key->arKey, html, log TSRMLS_CC);
+ }
 
         return SUCCESS;
 }
@@ -131,9 +139,9 @@
 
                         zend_hash_apply_with_arguments(ht, dump_hash_elem_va, X_DUMP_ARGS, name, html, log TSRMLS_CC);
                 } else if (ht && zend_hash_find(ht, elem->ptr, strlen(elem->ptr) + 1, (void **) &z) == SUCCESS) {
- dump_hash_elem(*z, name, elem->ptr, html, log TSRMLS_CC);
+ dump_hash_elem(*z, name, 0, elem->ptr, html, log TSRMLS_CC);
                 } else if(XG(dump_undefined)) {
- dump_hash_elem(NULL, name, elem->ptr, html, log TSRMLS_CC);
+ dump_hash_elem(NULL, name, 0, elem->ptr, html, log TSRMLS_CC);
                 }
 
                 elem = XDEBUG_LLIST_NEXT(elem);
Received on Mon Aug 30 2004 - 09:03:20 BST

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