com php-src: Fixed deleting watchpoints (plus error in btree_delete): phpdbg_btree.c phpdbg_watch.c
| From: | Bob Weinand | Date: | Thu, 03 Apr 2014 19:34:08 +0000 |
| Subject: | com php-src: Fixed deleting watchpoints (plus error in btree_delete): phpdbg_btree.c phpdbg_watch.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77011@lists.php.net to get a copy of this message | ||
Commit: fcacee059599bb2ac147bc4e4c48f1300cdd04f9
Author: Bob Weinand <bobwei9@hotmail.com> Thu, 3 Apr 2014 19:34:08 +0000
Parents: c86ba551ac4011dd8320ba6b620ab3bcca0821c7
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fcacee059599bb2ac147bc4e4c48f1300cdd04f9
Log:
Fixed deleting watchpoints (plus error in btree_delete)
Changed paths:
M phpdbg_btree.c
M phpdbg_watch.c
Diff:
diff --git a/phpdbg_btree.c b/phpdbg_btree.c
index 9eba982..8fc2561 100644
--- a/phpdbg_btree.c
+++ b/phpdbg_btree.c
@@ -202,7 +202,7 @@ check_branch_existence:
if (last_dual_branch->branches[last_dual_branch_branch] == last_dual_branch + 1) {
phpdbg_btree_branch *original_branch = last_dual_branch->branches[!last_dual_branch_branch];
- memcpy(last_dual_branch + 1, last_dual_branch->branches[!last_dual_branch_branch],
i_last_dual_branch * sizeof(phpdbg_btree_branch));
+ memcpy(last_dual_branch + 1, last_dual_branch->branches[!last_dual_branch_branch],
(i_last_dual_branch + 1) * sizeof(phpdbg_btree_branch));
efree(last_dual_branch->branches[!last_dual_branch_branch]);
last_dual_branch->branches[!last_dual_branch_branch] = last_dual_branch + 1;
diff --git a/phpdbg_watch.c b/phpdbg_watch.c
index 6b1a42d..50fa392 100644
--- a/phpdbg_watch.c
+++ b/phpdbg_watch.c
@@ -208,12 +208,12 @@ static int phpdbg_create_recursive_watchpoint(phpdbg_watchpoint_t *watch
TSRMLS_
return SUCCESS;
}
-static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch TSRMLS_DC) {
+static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch, zend_bool user_request
TSRMLS_DC) {
if (watch->type == WATCH_ON_HASHTABLE || (watch->type == WATCH_ON_ZVAL &&
(Z_TYPE_P(watch->addr.zv) == IS_ARRAY || Z_TYPE_P(watch->addr.zv) == IS_OBJECT))) {
HashTable *ht;
phpdbg_btree_result *result;
- if (watch->type == WATCH_ON_HASHTABLE) {
+ if (watch->type == WATCH_ON_HASHTABLE && user_request) {
HashPosition position;
zval **zv;
zval key;
@@ -235,7 +235,7 @@ static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch TSRMLS_
}
if (zend_hash_find(&PHPDBG_G(watchpoints), str, str_len, (void **) &watchpoint) ==
SUCCESS) {
- phpdbg_delete_watchpoint_recursive(*watchpoint TSRMLS_CC);
+ phpdbg_delete_watchpoint_recursive(*watchpoint, 1 TSRMLS_CC);
}
}
} else {
@@ -249,7 +249,7 @@ static int phpdbg_delete_watchpoint_recursive(phpdbg_watchpoint_t *watch TSRMLS_
}
if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) ht))) {
- phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr TSRMLS_CC);
+ phpdbg_delete_watchpoint_recursive((phpdbg_watchpoint_t *) result->ptr, user_request
TSRMLS_CC);
}
}
}
@@ -269,7 +269,7 @@ static int phpdbg_delete_watchpoint(phpdbg_watchpoint_t *tmp_watch TSRMLS_DC) {
watch = result->ptr;
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
- ret = phpdbg_delete_watchpoint_recursive(watch TSRMLS_CC);
+ ret = phpdbg_delete_watchpoint_recursive(watch, 1 TSRMLS_CC);
} else {
ret = zend_hash_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len);
}
@@ -447,7 +447,7 @@ void phpdbg_watch_HashTable_dtor(zval **zv) {
phpdbg_notice("%.*s was removed, removing watchpoint%s", (int)watch->str_len,
watch->str, (watch->flags & PHPDBG_WATCH_RECURSIVE)?"
recursively":"");
if (watch->flags & PHPDBG_WATCH_RECURSIVE) {
- phpdbg_delete_watchpoint_recursive(watch TSRMLS_CC);
+ phpdbg_delete_watchpoint_recursive(watch, 0 TSRMLS_CC);
} else {
zend_hash_del(&PHPDBG_G(watchpoints), watch->str, watch->str_len);
}