com php-src: Fixed opcodes printing.: sapi/phpdbg/phpdbg_prin t.c
| From: | Xinchen Hui | Date: | Wed, 22 Jul 2015 11:13:26 +0000 |
| Subject: | com php-src: Fixed opcodes printing.: sapi/phpdbg/phpdbg_prin t.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88111@lists.php.net to get a copy of this message | ||
Commit: f56b89b0affebc916ec3c8f3275d31933dc76841
Author: Xinchen Hui <laruence@php.net> Wed, 22 Jul 2015 19:13:26 +0800
Parents: c274e2397d27e5fb7d212b7b68b85a2bf82ceb3a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f56b89b0affebc916ec3c8f3275d31933dc76841
Log:
Fixed opcodes printing.
-p"function"
-p"class::"
-p"class::method"
Changed paths:
M sapi/phpdbg/phpdbg_print.c
Diff:
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 4a00189..5e485b3 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -377,8 +377,6 @@ void phpdbg_print_opcodes_class(const char *class) {
PHPDBG_API void phpdbg_print_opcodes(char *function)
{
- char *method_name = strtok(function, ":");
-
if (function == NULL) {
phpdbg_print_opcodes_main();
} else if (function[0] == '*' && function[1] == 0) {
@@ -402,11 +400,14 @@ PHPDBG_API void phpdbg_print_opcodes(char *function)
phpdbg_print_opcodes_ce(ce);
}
} ZEND_HASH_FOREACH_END();
- } else if (method_name == NULL) {
+ } else if (strstr(function, "::") == NULL) {
phpdbg_print_opcodes_function(function, strlen(function));
- } else if ((method_name = strtok(NULL, ":")) == NULL) {
- phpdbg_print_opcodes_class(function);
} else {
- phpdbg_print_opcodes_method(function, method_name);
+ char *method_name, *class_name = strtok(function, "::");
+ if ((method_name = strtok(NULL, "::")) == NULL) {
+ phpdbg_print_opcodes_class(class_name);
+ } else {
+ phpdbg_print_opcodes_method(class_name, method_name);
+ }
}
}