@@ -52,14 +52,14 @@ void phpdbg_set_breakpoint_file(const char *path, long line_num TSRMLS_DC) /* {{
52
52
53
53
PHPDBG_G (flags ) |= PHPDBG_HAS_FILE_BP ;
54
54
55
- if (zend_hash_find (& PHPDBG_G (bp_files ) ,
55
+ if (zend_hash_find (& PHPDBG_G (bp )[ PHPDBG_BREAK_FILE ] ,
56
56
new_break .filename , path_len , (void * * )& break_files_ptr ) == FAILURE ) {
57
57
zend_llist break_files ;
58
58
59
59
zend_llist_init (& break_files , sizeof (phpdbg_breakfile_t ),
60
60
phpdbg_llist_breakfile_dtor , 0 );
61
61
62
- zend_hash_update (& PHPDBG_G (bp_files ) ,
62
+ zend_hash_update (& PHPDBG_G (bp )[ PHPDBG_BREAK_FILE ] ,
63
63
new_break .filename , path_len , & break_files , sizeof (zend_llist ),
64
64
(void * * )& break_files_ptr );
65
65
}
@@ -75,15 +75,15 @@ void phpdbg_set_breakpoint_symbol(const char *name TSRMLS_DC) /* {{{ */
75
75
{
76
76
size_t name_len = strlen (name );
77
77
78
- if (!zend_hash_exists (& PHPDBG_G (bp_symbols ) , name , name_len )) {
78
+ if (!zend_hash_exists (& PHPDBG_G (bp )[ PHPDBG_BREAK_SYM ] , name , name_len )) {
79
79
phpdbg_breaksymbol_t new_break ;
80
80
81
81
PHPDBG_G (flags ) |= PHPDBG_HAS_SYM_BP ;
82
82
83
83
new_break .symbol = estrndup (name , name_len + 1 );
84
84
new_break .id = PHPDBG_G (bp_count )++ ;
85
85
86
- zend_hash_update (& PHPDBG_G (bp_symbols ) , new_break .symbol ,
86
+ zend_hash_update (& PHPDBG_G (bp )[ PHPDBG_BREAK_SYM ] , new_break .symbol ,
87
87
name_len , & new_break , sizeof (phpdbg_breaksymbol_t ), NULL );
88
88
89
89
printf ("[Breakpoint #%d added at %s]\n" , new_break .id , new_break .symbol );
@@ -99,12 +99,12 @@ void phpdbg_set_breakpoint_method(const char* class_name,
99
99
{
100
100
HashTable class_breaks , * class_table ;
101
101
102
- if (zend_hash_find (& PHPDBG_G (bp_methods ) , class_name , class_len , (void * * )& class_table ) != SUCCESS ) {
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 );
105
105
zend_hash_update (
106
- & PHPDBG_G (bp_methods ),
107
- class_name , class_len ,
106
+ & PHPDBG_G (bp )[ PHPDBG_BREAK_METHOD ],
107
+ class_name , class_len ,
108
108
(void * * )& class_breaks , sizeof (HashTable ), (void * * )& class_table );
109
109
}
110
110
@@ -132,7 +132,7 @@ void phpdbg_set_breakpoint_opline(const char *name TSRMLS_DC) /* {{{ */
132
132
{
133
133
zend_ulong opline = strtoul (name , 0 , 16 );
134
134
135
- if (!zend_hash_index_exists (& PHPDBG_G (bp_oplines ) , opline )) {
135
+ if (!zend_hash_index_exists (& PHPDBG_G (bp )[ PHPDBG_BREAK_OPLINE ] , opline )) {
136
136
phpdbg_breakline_t new_break ;
137
137
138
138
PHPDBG_G (flags ) |= PHPDBG_HAS_OPLINE_BP ;
@@ -141,7 +141,7 @@ void phpdbg_set_breakpoint_opline(const char *name TSRMLS_DC) /* {{{ */
141
141
new_break .opline = opline ;
142
142
new_break .id = PHPDBG_G (bp_count )++ ;
143
143
144
- zend_hash_index_update (& PHPDBG_G (bp_oplines ) , opline , & new_break , sizeof (phpdbg_breakline_t ), NULL );
144
+ zend_hash_index_update (& PHPDBG_G (bp )[ PHPDBG_BREAK_OPLINE ] , opline , & new_break , sizeof (phpdbg_breakline_t ), NULL );
145
145
146
146
printf ("[Breakpoint #%d added at %s]\n" , new_break .id , new_break .name );
147
147
} else {
@@ -151,7 +151,7 @@ void phpdbg_set_breakpoint_opline(const char *name TSRMLS_DC) /* {{{ */
151
151
152
152
void phpdbg_set_breakpoint_opline_ex (phpdbg_opline_ptr_t opline TSRMLS_DC ) /* {{{ */
153
153
{
154
- if (!zend_hash_index_exists (& PHPDBG_G (bp_oplines ) , (zend_ulong ) opline )) {
154
+ if (!zend_hash_index_exists (& PHPDBG_G (bp )[ PHPDBG_BREAK_OPLINE ] , (zend_ulong ) opline )) {
155
155
phpdbg_breakline_t new_break ;
156
156
157
157
PHPDBG_G (flags ) |= PHPDBG_HAS_OPLINE_BP ;
@@ -162,7 +162,7 @@ void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{
162
162
new_break .opline = (zend_ulong ) opline ;
163
163
new_break .id = PHPDBG_G (bp_count )++ ;
164
164
165
- zend_hash_index_update (& PHPDBG_G (bp_oplines ) , (zend_ulong ) opline , & new_break , sizeof (phpdbg_breakline_t ), NULL );
165
+ zend_hash_index_update (& PHPDBG_G (bp )[ PHPDBG_BREAK_OPLINE ] , (zend_ulong ) opline , & new_break , sizeof (phpdbg_breakline_t ), NULL );
166
166
167
167
printf ("[Breakpoint #%d added at %p]\n" , new_break .id , (zend_op * ) new_break .opline );
168
168
}
@@ -174,7 +174,7 @@ int phpdbg_find_breakpoint_file(zend_op_array *op_array TSRMLS_DC) /* {{{ */
174
174
zend_llist * break_list ;
175
175
zend_llist_element * le ;
176
176
177
- if (zend_hash_find (& PHPDBG_G (bp_files ) , op_array -> filename , name_len ,
177
+ if (zend_hash_find (& PHPDBG_G (bp )[ PHPDBG_BREAK_FILE ] , op_array -> filename , name_len ,
178
178
(void * * )& break_list ) == FAILURE ) {
179
179
return FAILURE ;
180
180
}
@@ -215,7 +215,7 @@ int phpdbg_find_breakpoint_symbol(zend_function *fbc TSRMLS_DC) /* {{{ */
215
215
fname = "main" ;
216
216
}
217
217
218
- if (zend_hash_find (& PHPDBG_G (bp_symbols ) , fname , strlen (fname ),
218
+ if (zend_hash_find (& PHPDBG_G (bp )[ PHPDBG_BREAK_SYM ] , fname , strlen (fname ),
219
219
(void * * )& bp ) == SUCCESS ) {
220
220
printf ("[Breakpoint #%d in %s() at %s:%u]\n" , bp -> id , bp -> symbol ,
221
221
zend_get_executed_filename (TSRMLS_C ),
@@ -231,7 +231,7 @@ int phpdbg_find_breakpoint_method(zend_op_array *ops TSRMLS_DC) /* {{{ */
231
231
HashTable * class_table ;
232
232
phpdbg_breakmethod_t * bp ;
233
233
234
- if (zend_hash_find (& PHPDBG_G (bp_methods ) , ops -> scope -> name , ops -> scope -> name_length ,
234
+ if (zend_hash_find (& PHPDBG_G (bp )[ PHPDBG_BREAK_METHOD ] , ops -> scope -> name , ops -> scope -> name_length ,
235
235
(void * * )& class_table ) == SUCCESS ) {
236
236
if (zend_hash_find (
237
237
class_table ,
@@ -253,7 +253,7 @@ int phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ *
253
253
{
254
254
phpdbg_breakline_t * bp ;
255
255
256
- if (zend_hash_index_find (& PHPDBG_G (bp_oplines ) , (zend_ulong ) opline ,
256
+ if (zend_hash_index_find (& PHPDBG_G (bp )[ PHPDBG_BREAK_OPLINE ] , (zend_ulong ) opline ,
257
257
(void * * )& bp ) == SUCCESS ) {
258
258
printf ("[Breakpoint #%d in %s at %s:%u]\n" , bp -> id , bp -> name ,
259
259
zend_get_executed_filename (TSRMLS_C ),
@@ -267,12 +267,13 @@ int phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t opline TSRMLS_DC) /* {{{ *
267
267
268
268
void phpdbg_clear_breakpoints (TSRMLS_D ) /* {{{ */
269
269
{
270
- zend_hash_clean (& PHPDBG_G (bp_files ) );
271
- zend_hash_clean (& PHPDBG_G (bp_symbols ) );
272
- zend_hash_clean (& PHPDBG_G (bp_oplines ) );
273
- zend_hash_clean (& PHPDBG_G (bp_methods ) );
274
-
270
+ zend_hash_clean (& PHPDBG_G (bp )[ PHPDBG_BREAK_FILE ] );
271
+ zend_hash_clean (& PHPDBG_G (bp )[ PHPDBG_BREAK_SYM ] );
272
+ zend_hash_clean (& PHPDBG_G (bp )[ PHPDBG_BREAK_OPLINE ] );
273
+ zend_hash_clean (& PHPDBG_G (bp )[ PHPDBG_BREAK_METHOD ] );
274
+
275
275
PHPDBG_G (flags ) &= ~PHPDBG_BP_MASK ;
276
+
276
277
PHPDBG_G (bp_count ) = 0 ;
277
278
} /* }}} */
278
279
0 commit comments