diff options
Diffstat (limited to 'phpdbg_bp.c')
-rw-r--r-- | phpdbg_bp.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/phpdbg_bp.c b/phpdbg_bp.c index 48e5ca0d34..75d0918401 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -215,8 +215,9 @@ PHPDBG_API void phpdbg_set_breakpoint_symbol(const char *name, size_t name_len T PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* func_name TSRMLS_DC) /* {{{ */ { HashTable class_breaks, *class_table; - size_t class_len = strlen(class_name); - size_t func_len = strlen(func_name); + size_t class_len = strlen(class_name); + size_t func_len = strlen(func_name); + char *lcname = zend_str_tolower_dup(func_name, func_len); if (zend_hash_find(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], class_name, class_len, (void**)&class_table) != SUCCESS) { @@ -238,14 +239,16 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char* new_break.func_len = func_len; new_break.id = PHPDBG_G(bp_count)++; - zend_hash_update(class_table, func_name, func_len, + zend_hash_update(class_table, lcname, func_len, &new_break, sizeof(phpdbg_breakmethod_t), NULL); phpdbg_notice("Breakpoint #%d added at %s::%s", new_break.id, class_name, func_name); } else { phpdbg_notice("Breakpoint exists at %s::%s", class_name, func_name); - } + } + + efree(lcname); } /* }}} */ PHPDBG_API void phpdbg_set_breakpoint_opline(zend_ulong opline TSRMLS_DC) /* {{{ */ @@ -420,9 +423,6 @@ int phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */ return FAILURE; } /* }}} */ -/* -* @TODO(anyone) this is case sensitive -*/ int phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */ { HashTable *class_table; @@ -430,15 +430,22 @@ int phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */ if (zend_hash_find(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], ops->scope->name, ops->scope->name_length, (void**)&class_table) == SUCCESS) { - if (zend_hash_find(class_table, ops->function_name, - strlen(ops->function_name), (void**)&bp) == SUCCESS) { - - phpdbg_notice("Breakpoint #%d in %s::%s() at %s:%u", - bp->id, bp->class_name, bp->func_name, - zend_get_executed_filename(TSRMLS_C), - zend_get_executed_lineno(TSRMLS_C)); + char *lcname = zend_str_tolower_dup(ops->function_name, strlen(ops->function_name)); + size_t lcname_len = strlen(lcname); + + if (zend_hash_find( + class_table, + lcname, + lcname_len, (void**)&bp) == SUCCESS) { + efree(lcname); + phpdbg_notice("Breakpoint #%d in %s::%s() at %s:%u", + bp->id, bp->class_name, bp->func_name, + zend_get_executed_filename(TSRMLS_C), + zend_get_executed_lineno(TSRMLS_C)); return SUCCESS; } + + efree(lcname); } return FAILURE; |