[xdebug-dev] xdebug xdebug/xdebug.c xdebug/xdebug_var.c - Fixed showing local variables in case the top most frame was a PHP function.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Mon, 16 Aug 2004 09:59:27 +0200

Date: Mon Aug 16 09:59:26 CEST 2004
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Fixed showing local variables in case the top most frame was a PHP function.
- Fixed showing referenced objects, they missed the classname.
- Nullify some globals after freeing them.

Modified files:
           xdebug/xdebug.c (version: 1.233)
           xdebug/xdebug_var.c (version: 1.50)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -r1.232 -r1.233
--- xdebug/xdebug.c:1.232 Mon Aug 09 04:27:58 2004 GMT
+++ xdebug/xdebug.c Mon Aug 16 05:59:26 2004 GMT
@@ -580,6 +580,7 @@
 
         if (XG(ide_key)) {
                 xdfree(XG(ide_key));
+ XG(ide_key) = NULL;
         }
 
         XG(level) = 0;
@@ -1289,10 +1290,16 @@
                         }
 
                         if (XG(show_local_vars) && XG(stack) && XDEBUG_LLIST_TAIL(XG(stack))) {
+ int scope_nr = XG(stack)->size;
+
                                 i = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack)));
+ if (i->user_defined == XDEBUG_INTERNAL && XDEBUG_LLIST_VALP(XDEBUG_LLIST_PREV(XDEBUG_LLIST_TAIL(XG(stack))))) {
+ i = XDEBUG_LLIST_VALP(XDEBUG_LLIST_PREV(XDEBUG_LLIST_TAIL(XG(stack))));
+ scope_nr--;
+ }
                                 if (i->used_vars && i->used_vars->size) {
                                         if (html) {
- php_printf("<tr><th colspan='3' bgcolor='#33aa33'>Variables in local scope</th></tr>\n");
+ php_printf("<tr><th colspan='3' bgcolor='#33aa33'>Variables in local scope (#%d)</th></tr>\n", scope_nr);
                                                 php_printf("<tr><th colspan='2' bgcolor='#55cc55'>Variable</th><th bgcolor='#55cc55'>Value</th></tr>\n");
                                         } else {
                                                 php_printf("\n\nVariables in local scope:\n");
@@ -1862,6 +1869,7 @@
         }
         if (XG(tracefile_name)) {
                 efree(XG(tracefile_name));
+ XG(tracefile_name) = NULL;
         }
 }
 

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- xdebug/xdebug_var.c:1.49 Tue Aug 03 18:46:06 2004 GMT
+++ xdebug/xdebug_var.c Mon Aug 16 05:59:26 2004 GMT
@@ -657,7 +657,7 @@
 #endif
                                 zend_hash_apply_with_arguments(myht, (apply_func_args_t) xdebug_object_element_export_fancy, 2, level, str);
                         } else {
- xdebug_str_addl(str, "<i>&</i><b>object</b>", 21, 0);
+ xdebug_str_add(str, xdebug_sprintf("<i>&</i><b>object</b>(<i>%s</i>)", Z_OBJCE_PP(struc)->name), 1);
 #ifdef ZEND_ENGINE_2
                                 xdebug_str_add(str, xdebug_sprintf("[<i>%d</i>]\n", Z_OBJ_HANDLE_PP(struc)), 1);
 #else
Received on Mon Aug 16 2004 - 09:59:33 BST

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