diff options
author | krakjoe <joe.watkins@live.co.uk> | 2013-11-24 12:18:00 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2013-11-24 12:18:00 +0000 |
commit | 4eb63d996de7a57981850a202a8d008635e15f1e (patch) | |
tree | 03be9ea00f5b4705d4dd1e051db457180e790583 | |
parent | 682164ae992c50fc075fad294de040fb60ff6529 (diff) | |
parent | fcdae5867fa6905b25de29dae69e2d3bdcc8e60d (diff) | |
download | php-git-4eb63d996de7a57981850a202a8d008635e15f1e.tar.gz |
Merge branch 'master' of https://github.com/krakjoe/phpdbg
-rw-r--r-- | phpdbg_bp.c | 16 | ||||
-rw-r--r-- | phpdbg_bp.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/phpdbg_bp.c b/phpdbg_bp.c index fdb191b736..2547e39f13 100644 --- a/phpdbg_bp.c +++ b/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) /* {{{ */ diff --git a/phpdbg_bp.h b/phpdbg_bp.h index f23904f412..661962c45f 100644 --- a/phpdbg_bp.h +++ b/phpdbg_bp.h @@ -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; |