Browse Source

fix is_class_method (needs revision)

don't free last (needs revision)
pull/550/head
krakjoe 13 years ago
parent
commit
7acf88322b
  1. 2
      phpdbg_list.c
  2. 17
      phpdbg_print.c
  3. 8
      phpdbg_prompt.c
  4. 7
      phpdbg_utils.c

2
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)) {

17
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;
} /* }}} */

8
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(

7
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;

Loading…
Cancel
Save