Skip to content

Commit 754fe82

Browse files
committed
export opcode breakpoints
1 parent ba37fd2 commit 754fe82

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

phpdbg_bp.c

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,20 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */
8888
handle, "break %s\n", brake->symbol);
8989
}
9090
}
91-
91+
9292
if (PHPDBG_G(flags) & PHPDBG_HAS_METHOD_BP) {
9393
HashTable *class;
9494
phpdbg_breakmethod_t *brake;
9595
HashPosition mposition;
9696
zend_bool noted = 0;
97-
97+
9898
table = &PHPDBG_G(bp)[PHPDBG_BREAK_METHOD];
99-
99+
100100
for (zend_hash_internal_pointer_reset_ex(table, &position);
101101
zend_hash_get_current_data_ex(table, (void**) &class, &position) == SUCCESS;
102102
zend_hash_move_forward_ex(table, &position)) {
103103
noted = 0;
104-
104+
105105
for (zend_hash_internal_pointer_reset_ex(class, &mposition);
106106
zend_hash_get_current_data_ex(class, (void**) &brake, &mposition) == SUCCESS;
107107
zend_hash_move_forward_ex(class, &mposition)) {
@@ -118,6 +118,23 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */
118118
}
119119
}
120120

121+
if (PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) {
122+
phpdbg_breakop_t *brake;
123+
124+
table = &PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE];
125+
126+
phpdbg_notice(
127+
"Exporting opcode breakpoints (%d)", zend_hash_num_elements(table));
128+
129+
for (zend_hash_internal_pointer_reset_ex(table, &position);
130+
zend_hash_get_current_data_ex(table, (void**) &brake, &position) == SUCCESS;
131+
zend_hash_move_forward_ex(table, &position)) {
132+
133+
fprintf(
134+
handle, "break op %s\n", brake->name);
135+
}
136+
}
137+
121138
/* export other types here after resolving errors from source command */
122139

123140
} /* }}} */
@@ -245,6 +262,8 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len T
245262
zend_ulong hash = zend_hash_func(name, name_len);
246263

247264
if (zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], hash)) {
265+
phpdbg_notice(
266+
"Breakpoint exists for %s", name);
248267
return;
249268
}
250269

0 commit comments

Comments
 (0)