summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_watch.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg/phpdbg_watch.c')
-rw-r--r--sapi/phpdbg/phpdbg_watch.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index 62fb65a67e..784ab3a999 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -1404,6 +1404,8 @@ void phpdbg_setup_watchpoints(void) {
zend_hash_init(PHPDBG_G(watchlist_mem), phpdbg_pagesize / (sizeof(Bucket) + sizeof(uint32_t)), NULL, NULL, 1);
PHPDBG_G(watchlist_mem_backup) = malloc(phpdbg_pagesize > sizeof(HashTable) ? phpdbg_pagesize : sizeof(HashTable));
zend_hash_init(PHPDBG_G(watchlist_mem_backup), phpdbg_pagesize / (sizeof(Bucket) + sizeof(uint32_t)), NULL, NULL, 1);
+
+ PHPDBG_G(watch_tmp) = NULL;
}
void phpdbg_destroy_watchpoints(void) {
@@ -1431,3 +1433,13 @@ void phpdbg_destroy_watchpoints(void) {
zend_hash_destroy(PHPDBG_G(watchlist_mem_backup));
free(PHPDBG_G(watchlist_mem_backup));
}
+
+void phpdbg_purge_watchpoint_tree(void) {
+ phpdbg_btree_position pos;
+ phpdbg_btree_result *res;
+
+ pos = phpdbg_btree_find_between(&PHPDBG_G(watchpoint_tree), 0, -1);
+ while ((res = phpdbg_btree_next(&pos))) {
+ phpdbg_deactivate_watchpoint(res->ptr);
+ }
+}