com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_info.c phpdbg_info.h
| From: | Bob Weinand | Date: | Sun, 17 Nov 2013 18:57:34 +0000 |
| Subject: | com php-src: Merge branch 'master' of https://github.com/krakjoe/phpdbg: phpdbg_info.c phpdbg_info.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74875@lists.php.net to get a copy of this message | ||
Commit: 25d24f2ed987678142e063b7e4d165c47b6b78da
Author: krakjoe <joe.watkins@live.co.uk> Sun, 17 Nov 2013 18:57:34 +0000
Parents: 6acf069c58cec1c396dafea3013d6e3209b69227 2c9dbc6b62e8597379bb8928654dc9f687b8bd2a
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=25d24f2ed987678142e063b7e4d165c47b6b78da
Log:
Merge branch 'master' of https://github.com/krakjoe/phpdbg
Changed paths:
MM phpdbg_info.c
MM phpdbg_info.h
Diff:
diff --cc phpdbg_info.c
index 794abb4,057859a..0b72536
--- a/phpdbg_info.c
+++ b/phpdbg_info.c
@@@ -99,46 -140,6 +140,44 @@@ PHPDBG_INFO(classes) /* {{{ *
}
zend_hash_destroy(&classes);
-
+
return SUCCESS;
} /* }}} */
+
+PHPDBG_INFO(funcs) /* {{{ */
+{
+ HashPosition position;
+ zend_function *zf, **pzf;
+ HashTable functions;
+
+ zend_hash_init(&functions, 8, NULL, NULL, 0);
+
+ for (zend_hash_internal_pointer_reset_ex(EG(function_table), &position);
+ zend_hash_get_current_data_ex(EG(function_table), (void**)&zf, &position) == SUCCESS;
+ zend_hash_move_forward_ex(EG(function_table), &position)) {
+
+ if (zf->type == ZEND_USER_FUNCTION) {
+ zend_hash_next_index_insert(
+ &functions, (void**) &zf, sizeof(zend_function), NULL);
+ }
+ }
+
+ phpdbg_notice("User Functions (%d)",
+ zend_hash_num_elements(&functions));
+
+ for (zend_hash_internal_pointer_reset_ex(&functions, &position);
+ zend_hash_get_current_data_ex(&functions, (void**)&pzf, &position) == SUCCESS;
+ zend_hash_move_forward_ex(&functions, &position)) {
+ zend_op_array *op_array = &((*pzf)->op_array);
+
+ phpdbg_writeln(
+ "|-------- %s in %s on line %d",
+ op_array->function_name ? op_array->function_name : "{main}",
+ op_array->filename ? op_array->filename : "(no source code)",
+ op_array->line_start);
+ }
+
+ zend_hash_destroy(&functions);
+
+ return SUCCESS;
+} /* }}} */
-
-
diff --cc phpdbg_info.h
index 971008d7,5836276..87da3ce
--- a/phpdbg_info.h
+++ b/phpdbg_info.h
@@@ -38,12 -38,14 +38,16 @@@
PHPDBG_INFO(files);
PHPDBG_INFO(classes);
+PHPDBG_INFO(funcs);
+ PHPDBG_INFO(error);
+ PHPDBG_INFO(vars);
static const phpdbg_command_t phpdbg_info_commands[] = {
- PHPDBG_INFO_EX_D(files, "lists included files", 'F'),
- PHPDBG_INFO_EX_D(classes, "lists loaded user classes", 'c'),
- PHPDBG_INFO_EX_D(funcs, "lists loaded user functions", 'f'),
+ PHPDBG_INFO_EX_D(files, "lists included files", 'F'),
+ PHPDBG_INFO_EX_D(classes, "lists loaded classes", 'c'),
++ PHPDBG_INFO_EX_D(funcs, "lists loaded classes", 'f'),
+ PHPDBG_INFO_EX_D(error, "show the last error", 'e'),
+ PHPDBG_INFO_EX_D(vars, "show active variables", 'v'),
PHPDBG_END_COMAND
};