]> granicus.if.org Git - php/commitdiff
fix is_class_method (needs revision)
authorkrakjoe <joe.watkins@live.co.uk>
Sat, 16 Nov 2013 14:55:53 +0000 (14:55 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Sat, 16 Nov 2013 14:55:53 +0000 (14:55 +0000)
don't free last (needs revision)

phpdbg_list.c
phpdbg_print.c
phpdbg_prompt.c
phpdbg_utils.c

index a4c3d1272d3ee2dbce63eac9ce292db185749bab..4d82d39ea267623fa7daabb9485d7bab3724d869 100644 (file)
@@ -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)) {
index 4d66e4a64481fe2afc2d0f4c8e07b9c79e70f307..92609089998636b83d79ca6902868eec7b17d791 100644 (file)
@@ -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;
 } /* }}} */
index ec5a7e780fb9db87df9cdb34746a9264514da13a..b0e2ff8b5ffe072b6d4b93926ce5591790ff5af8 100644 (file)
@@ -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(
index 1804fd977369c8caddffe7dce231e7be3d32c1de..a368f9fba66c5b05491eb0b65b4cda3e559b0448 100644 (file)
@@ -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;