com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg.c phpdbg_cmd.c phpdbg_info.c
| From: | Bob Weinand | Date: | Mon, 18 Nov 2013 22:04:36 +0000 |
| Subject: | com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg.c phpdbg_cmd.c phpdbg_info.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74826@lists.php.net to get a copy of this message | ||
Commit: 7b65a2947129917c06e4636409ddfe8dad781522
Author: krakjoe <joe.watkins@live.co.uk> Mon, 18 Nov 2013 22:04:36 +0000
Parents: a582d2793d490c02ae6ec9a53440363150f29cfc 89514066787a1201bc4c4474cf78f21225ca412c
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7b65a2947129917c06e4636409ddfe8dad781522
Log:
Merge branch 'master' of https://github.com/krakjoe/phpdbg
Changed paths:
MM phpdbg.c
MM phpdbg_cmd.c
MM phpdbg_info.c
Diff:
diff --cc phpdbg_cmd.c
index 6b5eed4,cff8c45..a166fc7
--- 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 4b77c61,e83c88a..e332fa0
--- 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;
} /* }}} */