@@ -36,7 +36,7 @@ static void phpdbg_llist_breakfile_dtor(void *data) /* {{{ */
36
36
static void phpdbg_class_breaks_dtor (void * data ) /* {{{ */
37
37
{
38
38
phpdbg_breakmethod_t * bp = (phpdbg_breakmethod_t * ) data ;
39
-
39
+
40
40
efree ((char * )bp -> class_name );
41
41
efree ((char * )bp -> func_name );
42
42
} /* }}} */
@@ -92,13 +92,13 @@ void phpdbg_set_breakpoint_symbol(const char *name TSRMLS_DC) /* {{{ */
92
92
}
93
93
} /* }}} */
94
94
95
- void phpdbg_set_breakpoint_method (const char * class_name ,
95
+ void phpdbg_set_breakpoint_method (const char * class_name ,
96
96
size_t class_len ,
97
- const char * func_name ,
97
+ const char * func_name ,
98
98
size_t func_len TSRMLS_DC ) /* {{{ */
99
99
{
100
100
HashTable class_breaks , * class_table ;
101
-
101
+
102
102
if (zend_hash_find (& PHPDBG_G (bp )[PHPDBG_BREAK_METHOD ], class_name , class_len , (void * * )& class_table ) != SUCCESS ) {
103
103
zend_hash_init (
104
104
& class_breaks , 8 , NULL , phpdbg_class_breaks_dtor , 0 );
@@ -110,15 +110,15 @@ void phpdbg_set_breakpoint_method(const char* class_name,
110
110
111
111
if (!zend_hash_exists (class_table , func_name , func_len )) {
112
112
phpdbg_breakmethod_t new_break ;
113
-
113
+
114
114
PHPDBG_G (flags ) |= PHPDBG_HAS_METHOD_BP ;
115
-
115
+
116
116
new_break .class_name = class_name ;
117
117
new_break .class_len = class_len ;
118
118
new_break .func_name = func_name ;
119
119
new_break .func_len = func_len ;
120
120
new_break .id = PHPDBG_G (bp_count )++ ;
121
-
121
+
122
122
zend_hash_update (class_table , func_name , func_len , & new_break , sizeof (phpdbg_breakmethod_t ), NULL );
123
123
printf (
124
124
"[Breakpoint #%d added at %s::%s]\n" , new_break .id , class_name , func_name );
@@ -200,9 +200,9 @@ int phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */
200
200
if (fbc -> type != ZEND_USER_FUNCTION ) {
201
201
return FAILURE ;
202
202
}
203
-
203
+
204
204
ops = (zend_op_array * )fbc ;
205
-
205
+
206
206
if (ops -> scope ) {
207
207
/* find method breaks here */
208
208
return phpdbg_find_breakpoint_method (
@@ -235,9 +235,9 @@ int phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */
235
235
(void * * )& class_table ) == SUCCESS ) {
236
236
if (zend_hash_find (
237
237
class_table ,
238
- ops -> function_name ,
238
+ ops -> function_name ,
239
239
strlen (ops -> function_name ), (void * * )& bp ) == SUCCESS ) {
240
-
240
+
241
241
printf (
242
242
"[Breakpoint #%d in %s::%s() at %s:%u]\n" , bp -> id , bp -> class_name , bp -> func_name ,
243
243
zend_get_executed_filename (TSRMLS_C ),
@@ -272,7 +272,8 @@ void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */
272
272
zend_hash_clean (& PHPDBG_G (bp )[PHPDBG_BREAK_OPLINE ]);
273
273
zend_hash_clean (& PHPDBG_G (bp )[PHPDBG_BREAK_METHOD ]);
274
274
275
- PHPDBG_G (flags ) &= ~(PHPDBG_HAS_FILE_BP |PHPDBG_HAS_SYM_BP |PHPDBG_HAS_METHOD_BP |PHPDBG_HAS_OPLINE_BP );
275
+ PHPDBG_G (flags ) &= ~PHPDBG_BP_MASK ;
276
+
276
277
PHPDBG_G (bp_count ) = 0 ;
277
278
} /* }}} */
278
279
0 commit comments