summaryrefslogtreecommitdiff
path: root/phpdbg_bp.c
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2013-11-26 15:58:27 +0000
committerkrakjoe <joe.watkins@live.co.uk>2013-11-26 15:58:27 +0000
commit6d95449e0a0f5ceb326a6fe7df9c2764ca4722e5 (patch)
tree550387d0ab9a35274540ff0f2e4ac7ddda36d272 /phpdbg_bp.c
parentbc7df607ab2d7771a3c2226b46598645e67e053f (diff)
downloadphp-git-6d95449e0a0f5ceb326a6fe7df9c2764ca4722e5.tar.gz
fix #27
Diffstat (limited to 'phpdbg_bp.c')
-rw-r--r--phpdbg_bp.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/phpdbg_bp.c b/phpdbg_bp.c
index 40a3a50fc7..792ac99873 100644
--- a/phpdbg_bp.c
+++ b/phpdbg_bp.c
@@ -203,6 +203,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char*
HashTable class_breaks, *class_table;
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) {
@@ -224,7 +225,7 @@ 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",
@@ -232,6 +233,8 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char*
} 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) /* {{{ */
@@ -408,9 +411,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;
@@ -418,17 +418,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) {
+ 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,
- ops->function_name,
- strlen(ops->function_name), (void**)&bp) == SUCCESS) {
-
+ 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;