From: krakjoe Date: Mon, 18 Nov 2013 22:04:36 +0000 (+0000) Subject: Merge branch 'master' of https://github.com/krakjoe/phpdbg X-Git-Tag: php-5.6.0alpha1~110^2~223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b65a2947129917c06e4636409ddfe8dad781522;p=php Merge branch 'master' of https://github.com/krakjoe/phpdbg --- 7b65a2947129917c06e4636409ddfe8dad781522 diff --cc phpdbg_cmd.c index 6b5eed43bb,cff8c452b9..a166fc7fb0 --- a/phpdbg_cmd.c +++ b/phpdbg_cmd.c @@@ -132,10 -129,9 +132,7 @@@ int phpdbg_do_cmd( const phpdbg_command while (command && command->name && command->handler) { if ((command->name_len == expr_len && memcmp(cmd, command->name, expr_len) == 0) || (expr_len == 1 && command->alias && command->alias == cmd_line[0])) { -- - phpdbg_param_t lparam, - param; + phpdbg_param_t param = {0}; phpdbg_parse_param( expr, diff --cc phpdbg_info.c index 4b77c61ea5,e83c88a39a..e332fa07d2 --- a/phpdbg_info.c +++ b/phpdbg_info.c @@@ -65,8 -64,9 +65,9 @@@ PHPDBG_INFO(vars) /* {{{ * return SUCCESS; } } + - phpdbg_notice("Variables"); + zend_hash_init(&vars, 8, NULL, NULL, 0); - + zend_hash_internal_pointer_reset_ex(EG(active_symbol_table), &pos); while (zend_hash_get_current_key_ex(EG(active_symbol_table), &var, NULL, NULL, 0, &pos) == HASH_KEY_IS_STRING) { @@@ -77,34 -81,7 +78,33 @@@ } zend_hash_move_forward_ex(EG(active_symbol_table), &pos); } - + + phpdbg_notice("Variables: %d", + zend_hash_num_elements(&vars)); - phpdbg_writeln("Refs\tName\t\t"); ++ phpdbg_writeln("Refs\tName"); + + for (zend_hash_internal_pointer_reset_ex(&vars, &pos); + zend_hash_get_current_data_ex(&vars, (void**) &data, &pos) == SUCCESS; + zend_hash_move_forward_ex(&vars, &pos)) { + char *var; - zend_uint var_len; - zend_ulong var_idx; - zend_hash_get_current_key_ex(&vars, &var, &var_len, &var_idx, 0, &pos); ++ ++ zend_hash_get_current_key_ex(&vars, &var, NULL, NULL, 0, &pos); + + if (*data) { + phpdbg_write( - "%d\t%s$%s\t", ++ "%d\t%s$%s\t\t", + Z_REFCOUNT_PP(data), + Z_ISREF_PP(data) ? "&" : "", var); + + zend_print_flat_zval_r(*data TSRMLS_CC); + } else { + phpdbg_write("0\t$%s", var); + } + phpdbg_writeln(EMPTY); + } + + zend_hash_destroy(&vars); + return SUCCESS; } /* }}} */