@@ -203,6 +203,7 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char*
203
203
HashTable class_breaks , * class_table ;
204
204
size_t class_len = strlen (class_name );
205
205
size_t func_len = strlen (func_name );
206
+ char * lcname = zend_str_tolower_dup (func_name , func_len );
206
207
207
208
if (zend_hash_find (& PHPDBG_G (bp )[PHPDBG_BREAK_METHOD ], class_name ,
208
209
class_len , (void * * )& class_table ) != SUCCESS ) {
@@ -224,14 +225,16 @@ PHPDBG_API void phpdbg_set_breakpoint_method(const char* class_name, const char*
224
225
new_break .func_len = func_len ;
225
226
new_break .id = PHPDBG_G (bp_count )++ ;
226
227
227
- zend_hash_update (class_table , func_name , func_len ,
228
+ zend_hash_update (class_table , lcname , func_len ,
228
229
& new_break , sizeof (phpdbg_breakmethod_t ), NULL );
229
230
230
231
phpdbg_notice ("Breakpoint #%d added at %s::%s" ,
231
232
new_break .id , class_name , func_name );
232
233
} else {
233
234
phpdbg_notice ("Breakpoint exists at %s::%s" , class_name , func_name );
234
235
}
236
+
237
+ efree (lcname );
235
238
} /* }}} */
236
239
237
240
PHPDBG_API void phpdbg_set_breakpoint_opline (zend_ulong opline TSRMLS_DC ) /* {{{ */
@@ -408,27 +411,29 @@ int phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */
408
411
return FAILURE ;
409
412
} /* }}} */
410
413
411
- /*
412
- * @TODO(anyone) this is case sensitive
413
- */
414
414
int phpdbg_find_breakpoint_method (zend_op_array * ops TSRMLS_DC ) /* {{{ */
415
415
{
416
416
HashTable * class_table ;
417
417
phpdbg_breakmethod_t * bp ;
418
418
419
419
if (zend_hash_find (& PHPDBG_G (bp )[PHPDBG_BREAK_METHOD ], ops -> scope -> name ,
420
420
ops -> scope -> name_length , (void * * )& class_table ) == SUCCESS ) {
421
+ char * lcname = zend_str_tolower_dup (ops -> function_name , strlen (ops -> function_name ));
422
+ size_t lcname_len = strlen (lcname );
423
+
421
424
if (zend_hash_find (
422
425
class_table ,
423
- ops -> function_name ,
424
- strlen ( ops -> function_name ) , (void * * )& bp ) == SUCCESS ) {
425
-
426
+ lcname ,
427
+ lcname_len , (void * * )& bp ) == SUCCESS ) {
428
+ efree ( lcname );
426
429
phpdbg_notice ("Breakpoint #%d in %s::%s() at %s:%u" ,
427
430
bp -> id , bp -> class_name , bp -> func_name ,
428
431
zend_get_executed_filename (TSRMLS_C ),
429
432
zend_get_executed_lineno (TSRMLS_C ));
430
433
return SUCCESS ;
431
434
}
435
+
436
+ efree (lcname );
432
437
}
433
438
434
439
return FAILURE ;
0 commit comments