From: krakjoe Date: Sat, 16 Nov 2013 14:55:53 +0000 (+0000) Subject: fix is_class_method (needs revision) X-Git-Tag: php-5.6.0alpha1~110^2~286 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7acf88322b1e78c50134b3c96f3cb6cbedbef4ff;p=php fix is_class_method (needs revision) don't free last (needs revision) --- diff --git a/phpdbg_list.c b/phpdbg_list.c index a4c3d1272d..4d82d39ea2 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 4d66e4a644..9260908999 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 ec5a7e780f..b0e2ff8b5f 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 1804fd9773..a368f9fba6 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;