diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-14 19:37:31 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-14 19:37:31 +0200 |
commit | 9b05f5d1327aff7f828ba21e705f6a1da306059e (patch) | |
tree | da322edb9f7cc969f491c585627b2dd64fe37241 /phpdbg_watch.c | |
parent | 2dad85ae61bbc2817798cb98680abfabd9e19d33 (diff) | |
download | php-git-9b05f5d1327aff7f828ba21e705f6a1da306059e.tar.gz |
Made refcount info switchable by set refcount on/off. Default: off
Diffstat (limited to 'phpdbg_watch.c')
-rw-r--r-- | phpdbg_watch.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/phpdbg_watch.c b/phpdbg_watch.c index 41c5788a19..fe161ab7a8 100644 --- a/phpdbg_watch.c +++ b/phpdbg_watch.c @@ -631,9 +631,16 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { /* Show to the user what changed and delete watchpoint upon removal */ if (memcmp(oldPtr, watch->addr.ptr, watch->size) != SUCCESS) { - PHPDBG_G(watchpoint_hit) = 1; + if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS || (watch->type == WATCH_ON_ZVAL && memcmp(oldPtr, watch->addr.zv, sizeof(zvalue_value))) || (watch->type == WATCH_ON_HASHTABLE +#if ZEND_DEBUG + && !watch->addr.ht->inconsistent +#endif + && zend_hash_num_elements((HashTable *)oldPtr) != zend_hash_num_elements(watch->addr.ht))) { + PHPDBG_G(watchpoint_hit) = 1; + + phpdbg_notice("Breaking on watchpoint %s", watch->str); + } - phpdbg_notice("Breaking on watchpoint %s", watch->str); switch (watch->type) { case WATCH_ON_ZVAL: { int removed = ((zval *)oldPtr)->refcount__gc != watch->addr.zv->refcount__gc && !zend_symtable_exists(watch->parent_container, watch->name_in_parent, watch->name_in_parent_len + 1); |