Commit: c8145da0b24a7bd8cb589cb727499764003fb92c Author: krakjoe <joe.watk...@live.co.uk> Wed, 27 Nov 2013 13:15:52 +0000 Parents: 0deced5a7a3f89aeba321e90fa03ba89607ad271 Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c8145da0b24a7bd8cb589cb727499764003fb92c Log: reset hit counters implicitly on run Changed paths: M phpdbg_bp.c M phpdbg_bp.h M phpdbg_prompt.c Diff: diff --git a/phpdbg_bp.c b/phpdbg_bp.c index 2985080..333569b 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -56,6 +56,26 @@ static void phpdbg_class_breaks_dtor(void *data) /* {{{ */ efree((char*)bp->func_name); } /* }}} */ +PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D) /* {{{ */ +{ + if (zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP])) { + HashPosition position[2]; + HashTable **table = NULL; + + for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], &position[0]); + zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (void**)&table, &position[0]) == SUCCESS; + zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], &position[0])) { + phpdbg_breakbase_t *brake; + + for (zend_hash_internal_pointer_reset_ex((*table), &position[1]); + zend_hash_get_current_data_ex((*table), (void**)&brake, &position[1]) == SUCCESS; + zend_hash_move_forward_ex((*table), &position[1])) { + brake->hits = 0; + } + } + } +} /* }}} */ + PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */ { HashPosition position[2]; diff --git a/phpdbg_bp.h b/phpdbg_bp.h index ef1049e..9063539 100644 --- a/phpdbg_bp.h +++ b/phpdbg_bp.h @@ -104,6 +104,7 @@ phpdbg_breakbase_t* phpdbg_find_breakpoint(zend_execute_data* TSRMLS_DC); PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC); PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D); +PHPDBG_API void phpdbg_reset_breakpoints(TSRMLS_D); PHPDBG_API void phpdbg_hit_breakpoint(phpdbg_breakbase_t* brake, zend_bool output TSRMLS_DC); PHPDBG_API void phpdbg_print_breakpoint(phpdbg_breakbase_t* brake TSRMLS_DC); PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index b9c22b9..b5a93a6 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -573,6 +573,9 @@ PHPDBG_COMMAND(run) /* {{{ */ zend_hash_clean( &PHPDBG_G(seek)); + /* reset hit counters */ + phpdbg_reset_breakpoints(TSRMLS_C); + zend_try { php_output_activate(TSRMLS_C); PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php