com php-src: Clean up information on watchpoint breaks: phpdbg_watch.c
| From: | Bob Weinand | Date: | Mon, 14 Apr 2014 08:46:52 +0000 |
| Subject: | com php-src: Clean up information on watchpoint breaks: phpdbg_watch.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76994@lists.php.net to get a copy of this message | ||
Commit: fdd9bc20507f04bdcdeb963a26a9334409885c5c
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 14 Apr 2014 10:46:52 +0200
Parents: 774a879e6522501f357e8a68278dc321ab118079
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fdd9bc20507f04bdcdeb963a26a9334409885c5c
Log:
Clean up information on watchpoint breaks
Changed paths:
M phpdbg_watch.c
Diff:
diff --git a/phpdbg_watch.c b/phpdbg_watch.c
index ef5881f..d7da10e 100644
--- a/phpdbg_watch.c
+++ b/phpdbg_watch.c
@@ -616,14 +616,21 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
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);
+ int show_value = memcmp(oldPtr, watch->addr.zv, sizeof(zvalue_value));
+ int show_ref = ((zval *)oldPtr)->refcount__gc != watch->addr.zv->refcount__gc ||
((zval *)oldPtr)->is_ref__gc != watch->addr.zv->is_ref__gc;
- phpdbg_write("Old value: ");
- if ((Z_TYPE_P((zval *)oldPtr) == IS_ARRAY || Z_TYPE_P((zval *)oldPtr) == IS_OBJECT) &&
removed) {
- phpdbg_write("Value inaccessible, HashTable already destroyed");
- } else {
- zend_print_flat_zval_r((zval *)oldPtr TSRMLS_CC);
+ if (removed || show_value) {
+ phpdbg_write("Old value: ");
+ if ((Z_TYPE_P((zval *)oldPtr) == IS_ARRAY || Z_TYPE_P((zval *)oldPtr) == IS_OBJECT)
&& removed) {
+ phpdbg_writeln("Value inaccessible, HashTable already destroyed");
+ } else {
+ zend_print_flat_zval_r((zval *)oldPtr TSRMLS_CC);
+ phpdbg_writeln("");
+ }
+ }
+ if (removed || show_ref) {
+ phpdbg_writeln("Old refcount: %d; Old is_ref: %d", ((zval
*)oldPtr)->refcount__gc, ((zval *)oldPtr)->is_ref__gc);
}
- phpdbg_writeln("\nOld refcount: %d; Old is_ref: %d", ((zval
*)oldPtr)->refcount__gc, ((zval *)oldPtr)->is_ref__gc);
/* check if zval was removed */
if (removed) {
@@ -639,9 +646,14 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
break;
}
- phpdbg_write("New value: ");
- zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC);
- phpdbg_writeln("\nNew refcount: %d; New is_ref: %d",
watch->addr.zv->refcount__gc, watch->addr.zv->is_ref__gc);
+ if (show_value) {
+ phpdbg_write("New value: ");
+ zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC);
+ phpdbg_writeln("");
+ }
+ if (show_ref) {
+ phpdbg_writeln("New refcount: %d; New is_ref: %d",
watch->addr.zv->refcount__gc, watch->addr.zv->is_ref__gc);
+ }
if ((Z_TYPE_P(watch->addr.zv) == IS_ARRAY && Z_ARRVAL_P(watch->addr.zv) !=
Z_ARRVAL_P((zval *)oldPtr)) || (Z_TYPE_P(watch->addr.zv) != IS_OBJECT &&
Z_OBJ_HANDLE_P(watch->addr.zv) == Z_OBJ_HANDLE_P((zval *)oldPtr))) {
/* add new watchpoints if necessary */