com php-src: fix is_class_method (needs revision) don't free last (needs revision): phpdbg _list.c phpdbg_print.c phpdbg_prompt.c phpdbg _utils.c
| From: | Bob Weinand | Date: | Sat, 16 Nov 2013 14:55:53 +0000 |
| Subject: | com php-src: fix is_class_method (needs revision) don't free last (needs revision): phpdbg _list.c phpdbg_print.c phpdbg_prompt.c phpdbg _utils.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74919@lists.php.net to get a copy of this message | ||
Commit: 7acf88322b1e78c50134b3c96f3cb6cbedbef4ff
Author: krakjoe <joe.watkins@live.co.uk> Sat, 16 Nov 2013 14:55:53 +0000
Parents: cf58c7cea376be23c81d2d3f6505a177cd811862
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7acf88322b1e78c50134b3c96f3cb6cbedbef4ff
Log:
fix is_class_method (needs revision)
don't free last (needs revision)
Changed paths:
M phpdbg_list.c
M phpdbg_print.c
M phpdbg_prompt.c
M phpdbg_utils.c
Diff:
diff --git a/phpdbg_list.c b/phpdbg_list.c
index a4c3d12..4d82d39 100644
--- a/phpdbg_list.c
+++ b/phpdbg_list.c
@@ -37,7 +37,7 @@ static inline void i_phpdbg_list_func(const char *str TSRMLS_DC)
zend_function* fbc;
const char *func_name = str;
size_t func_name_len = strlen(str);
-
+ printf("i_phpdbg_list_func(%s)\n", str);
/* search active scope if begins with period */
if (func_name[0] == '.') {
if (EG(scope)) {
diff --git a/phpdbg_print.c b/phpdbg_print.c
index 4d66e4a..9260908 100644
--- a/phpdbg_print.c
+++ b/phpdbg_print.c
@@ -130,8 +130,6 @@ PHPDBG_PRINT(class) /* {{{ */
PHPDBG_PRINT(method) /* {{{ */
{
- int result = SUCCESS;
-
if (param->type == METHOD_PARAM) {
zend_class_entry **ce;
@@ -149,28 +147,23 @@ PHPDBG_PRINT(method) /* {{{ */
} else {
phpdbg_error(
"The method %s could not be found", param->method.name);
- result = FAILURE;
}
efree(lcname);
} else {
phpdbg_error(
"Failed to find the requested class %s", param->method.class);
- result = FAILURE;
}
} else {
phpdbg_error(
"Unsupported parameter type (%s) for command", phpdbg_get_param_type(param
TSRMLS_CC));
- result = FAILURE;
}
- return result;
+ return SUCCESS;
} /* }}} */
PHPDBG_PRINT(func) /* {{{ */
{
- int result = SUCCESS;
-
if (param->type == STR_PARAM) {
HashTable *func_table = EG(function_table);
zend_function* fbc;
@@ -186,12 +179,12 @@ PHPDBG_PRINT(func) /* {{{ */
func_table = &EG(scope)->function_table;
} else {
phpdbg_error("No active class");
- return FAILURE;
+ return SUCCESS;
}
} else if (!EG(function_table)) {
phpdbg_error(
"No function table loaded");
- return FAILURE;
+ return SUCCESS;
} else {
func_table = EG(function_table);
}
@@ -209,7 +202,6 @@ PHPDBG_PRINT(func) /* {{{ */
} else {
phpdbg_error(
"Function %s not found", func_name);
- result = FAILURE;
}
efree(lcname);
@@ -217,8 +209,7 @@ PHPDBG_PRINT(func) /* {{{ */
} else {
phpdbg_error(
"Unsupported parameter type (%s) for command", phpdbg_get_param_type(param
TSRMLS_CC));
- result = FAILURE;
}
- return result;
+ return SUCCESS;
} /* }}} */
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index ec5a7e7..b0e2ff8 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -711,10 +711,12 @@ int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t
cmd_le
phpdbg_param_t *param = emalloc(sizeof(phpdbg_param_t));
PHPDBG_G(last) = (phpdbg_command_t*) command;
+
+ /* urm ... */
if (PHPDBG_G(lparam)) {
- phpdbg_clear_param(
- PHPDBG_G(lparam) TSRMLS_CC);
- efree(PHPDBG_G(lparam));
+ //phpdbg_clear_param(
+ // PHPDBG_G(lparam) TSRMLS_CC);
+ //efree(PHPDBG_G(lparam));
}
phpdbg_parse_param(
diff --git a/phpdbg_utils.c b/phpdbg_utils.c
index 1804fd9..a368f9f 100644
--- a/phpdbg_utils.c
+++ b/phpdbg_utils.c
@@ -63,7 +63,12 @@ int phpdbg_is_addr(const char *str) /* {{{ */
int phpdbg_is_class_method(const char *str, size_t len, char **class, char **method) /* {{{ */
{
- const char *sep = strstr(str, "::");
+ char *sep = NULL;
+
+ if (strstr(str, " ") != NULL)
+ return 0;
+
+ sep = strstr(str, "::");
if (!sep || sep == str || sep+2 == str+len-1) {
return 0;