@@ -916,6 +916,7 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend
916
916
zend_function * function = (zend_function * ) execute_data -> function_state .function ;
917
917
918
918
switch (param -> type ) {
919
+ case NUMERIC_FUNCTION_PARAM :
919
920
case STR_PARAM : {
920
921
/* function breakpoint */
921
922
@@ -926,12 +927,12 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend
926
927
{
927
928
const char * str = NULL ;
928
929
size_t len = 0L ;
929
- zend_op_array * ops = (zend_op_array * )function ;
930
+ zend_op_array * ops = (zend_op_array * )function ;
930
931
str = ops -> function_name ? ops -> function_name : "main" ;
931
932
len = strlen (str );
932
933
933
- if (len == param -> len ) {
934
- return ( memcmp ( param -> str , str , len ) == SUCCESS ) ;
934
+ if (len == param -> len && memcmp ( param -> str , str , len ) == SUCCESS ) {
935
+ return param -> type == STR_PARAM || execute_data -> opline - ops -> opcodes == param -> num ;
935
936
}
936
937
}
937
938
} break ;
@@ -948,6 +949,7 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend
948
949
}
949
950
} break ;
950
951
952
+ case NUMERIC_METHOD_PARAM :
951
953
case METHOD_PARAM : {
952
954
if (function -> type != ZEND_USER_FUNCTION ) {
953
955
return 0 ;
@@ -957,18 +959,13 @@ static inline zend_bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend
957
959
zend_op_array * ops = (zend_op_array * ) function ;
958
960
959
961
if (ops -> scope ) {
960
- size_t lengths [2 ] = {
961
- strlen (param -> method .class ), ops -> scope -> name_length };
962
- if (lengths [0 ] == lengths [1 ]) {
963
- if (memcmp (param -> method .class ,
964
- ops -> scope -> name , lengths [0 ]) == SUCCESS ) {
965
- lengths [0 ] = strlen (param -> method .name );
966
- lengths [1 ] = strlen (ops -> function_name );
967
-
968
- if (lengths [0 ] == lengths [1 ]) {
969
- return (memcmp (param -> method .name ,
970
- ops -> function_name , lengths [0 ]) == SUCCESS );
971
- }
962
+ size_t lengths [2 ] = {strlen (param -> method .class ), ops -> scope -> name_length };
963
+ if (lengths [0 ] == lengths [1 ] && memcmp (param -> method .class , ops -> scope -> name , lengths [0 ]) == SUCCESS ) {
964
+ lengths [0 ] = strlen (param -> method .name );
965
+ lengths [1 ] = strlen (ops -> function_name );
966
+
967
+ if (lengths [0 ] == lengths [1 ] && memcmp (param -> method .name , ops -> function_name , lengths [0 ]) == SUCCESS ) {
968
+ return param -> type == METHOD_PARAM || (execute_data -> opline - ops -> opcodes ) == param -> num ;
972
969
}
973
970
}
974
971
}
@@ -1584,6 +1581,15 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
1584
1581
((phpdbg_breakbase_t * )brake )-> disabled ? " [disabled]" : "" );
1585
1582
break ;
1586
1583
1584
+ case NUMERIC_FUNCTION_PARAM :
1585
+ phpdbg_writeln ("#%d\t\tat %s#%ld if %s%s" ,
1586
+ brake -> id ,
1587
+ brake -> param .str ,
1588
+ brake -> param .num ,
1589
+ brake -> code ,
1590
+ ((phpdbg_breakbase_t * )brake )-> disabled ? " [disabled]" : "" );
1591
+ break ;
1592
+
1587
1593
case METHOD_PARAM :
1588
1594
phpdbg_writeln ("#%d\t\tat %s::%s if %s%s" ,
1589
1595
brake -> id ,
@@ -1593,6 +1599,16 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
1593
1599
((phpdbg_breakbase_t * )brake )-> disabled ? " [disabled]" : "" );
1594
1600
break ;
1595
1601
1602
+ case NUMERIC_METHOD_PARAM :
1603
+ phpdbg_writeln ("#%d\t\tat %s::%s#%ld if %s%s" ,
1604
+ brake -> id ,
1605
+ brake -> param .method .class ,
1606
+ brake -> param .method .name ,
1607
+ brake -> param .num ,
1608
+ brake -> code ,
1609
+ ((phpdbg_breakbase_t * )brake )-> disabled ? " [disabled]" : "" );
1610
+ break ;
1611
+
1596
1612
case FILE_PARAM :
1597
1613
phpdbg_writeln ("#%d\t\tat %s:%lu if %s%s" ,
1598
1614
brake -> id ,
0 commit comments