mirror of
https://github.com/php/php-src.git
synced 2026-03-30 12:13:02 +02:00
Added opcode break deleting
This commit is contained in:
16
phpdbg_bp.c
16
phpdbg_bp.c
@@ -170,6 +170,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len T
|
||||
return;
|
||||
}
|
||||
|
||||
new_break.hash = hash;
|
||||
new_break.name = estrndup(name, name_len);
|
||||
new_break.id = PHPDBG_G(bp_count)++;
|
||||
|
||||
@@ -548,6 +549,7 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */
|
||||
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], &position)) {
|
||||
if (brake->id == num) {
|
||||
zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], brake->opline);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -565,6 +567,20 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) {
|
||||
HashPosition position;
|
||||
phpdbg_breakop_t *brake;
|
||||
|
||||
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], &position);
|
||||
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], (void**) &brake, &position) == SUCCESS;
|
||||
zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], &position)) {
|
||||
if (brake->id == num) {
|
||||
zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], brake->hash);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */
|
||||
|
||||
@@ -64,6 +64,7 @@ typedef struct _phpdbg_breakline_t {
|
||||
* Breakpoint opcode based representation
|
||||
*/
|
||||
typedef struct _phpdbg_breakop_t {
|
||||
zend_ulong hash;
|
||||
const char *name;
|
||||
int id;
|
||||
} phpdbg_breakop_t;
|
||||
|
||||
Reference in New Issue
Block a user