com php-src: Reduce variabledetails+variable to just one variable tag: phpdbg_info.c xml.md
| From: | Bob Weinand | Date: | Thu, 09 Oct 2014 09:47:52 +0000 |
| Subject: | com php-src: Reduce variabledetails+variable to just one variable tag: phpdbg_info.c xml.md | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82591@lists.php.net to get a copy of this message | ||
Commit: 96de7c4b0ad30ad41983fa0786aeaf0418d82c7b
Author: Bob Weinand <bobwei9@hotmail.com> Thu, 9 Oct 2014 11:47:52 +0200
Parents: 9db6a93b69edf154934c768dab0a70d3b8ef6b47
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=96de7c4b0ad30ad41983fa0786aeaf0418d82c7b
Log:
Reduce variabledetails+variable to just one variable tag
Changed paths:
M phpdbg_info.c
M xml.md
Diff:
diff --git a/phpdbg_info.c b/phpdbg_info.c
index 9c17e42...a854842 100644
--- a/phpdbg_info.c
+++ b/phpdbg_info.c
@@ -184,29 +184,29 @@ static int phpdbg_print_symbols(zend_bool show_globals TSRMLS_DC) {
phpdbg_try_access {
if (!(invalid_data = !*data)) {
- phpdbg_writeln("variable", "address=\"%p\" refcount=\"%d\"
type=\"%s\"", "%p\t%d\t(%s)", *data, Z_REFCOUNT_PP(data),
zend_zval_type_name(*data));
+#define VARIABLEINFO(attrs, msg, ...) phpdbg_writeln("variable",
"address=\"%p\" refcount=\"%d\" type=\"%s\"
refstatus=\"%s\" name=\"%s\" " attrs, "%p\t%d\t(%s)\n%s$%s",
*data, Z_REFCOUNT_PP(data), zend_zval_type_name(*data), Z_ISREF_PP(data) ? "&":
"", var, ##__VA_ARGS__)
if (Z_TYPE_PP(data) == IS_RESOURCE) {
phpdbg_try_access {
int type;
- phpdbg_writeln("variabledetails", "refstatus=\"%s\"
name=\"%s\" type=\"%s\"", "%s$%s\n|-------(typeof)------>
(%s)\n", Z_ISREF_PP(data) ? "&": "", var,
zend_list_find(Z_RESVAL_PP(data), &type) ? zend_rsrc_list_get_rsrc_type(type TSRMLS_CC) :
"unknown");
+ VARIABLEINFO("type=\"%s\"", "\n|-------(typeof)------>
(%s)\n", zend_list_find(Z_RESVAL_PP(data), &type) ? zend_rsrc_list_get_rsrc_type(type
TSRMLS_CC) : "unknown");
} phpdbg_catch_access {
- phpdbg_writeln("variabledetails", "refstatus=\"%s\"
name=\"%s\" type=\"unknown\"", "%s$%s\n|-------(typeof)------>
(unknown)\n", Z_ISREF_PP(data) ? "&": "", var);
+ VARIABLEINFO("type=\"unknown\"", "\n|-------(typeof)------>
(unknown)\n");
} phpdbg_end_try_access();
} else if (Z_TYPE_PP(data) == IS_OBJECT) {
phpdbg_try_access {
- phpdbg_writeln("variabledetails", "refstatus=\"%s\"
name=\"%s\" instanceof=\"%s\"", "%s$%s\n|-----(instanceof)---->
(%s)\n", Z_ISREF_PP(data) ? "&": "", var, Z_OBJCE_PP(data)->name);
+ VARIABLEINFO("instanceof=\"%s\"", "\n|-----(instanceof)---->
(%s)\n", Z_OBJCE_PP(data)->name);
} phpdbg_catch_access {
- phpdbg_writeln("variabledetails", "refstatus=\"%s\"
name=\"%s\" instanceof=\"unknown\"",
"%s$%s\n|-----(instanceof)----> (unknown)\n", Z_ISREF_PP(data) ? "&":
"", var);
+ VARIABLEINFO("instanceof=\"%s\"", "\n|-----(instanceof)---->
(unknown)\n");
} phpdbg_end_try_access();
} else {
- phpdbg_writeln("variabledetails", "refstatus=\"%s\"
name=\"%s\"", "%s$%s", Z_ISREF_PP(data) ? "&": "",
var);
+ VARIABLEINFO("", "");
}
}
} phpdbg_end_try_access();
if (invalid_data) {
- phpdbg_writeln("variabledetails", "name=\"%s\"",
"n/a\tn/a\tn/a\t$%s", var);
+ phpdbg_writeln("variable", "name=\"%s\"",
"n/a\tn/a\tn/a\t$%s", var);
}
}
}
diff --git a/xml.md b/xml.md
index bd3adc7..5cf4553 100644
--- a/xml.md
+++ b/xml.md
@@ -260,11 +260,11 @@ info (subcommands)
- file
- opline
- for each variable there is a <variable> followed by a <variabledetails>
element
-- <variable address="" refcount="" type="" />
+- <variable address="" refcount="" type="" name=""
/>
- address: pointer to zval (hexadecimal)
- refcount: refcount of zval
- type: the variable type (long, string, ...). If the value is "unknown", the other
attributes are meaningless
-- <variabledetails name="" /> with name the name of the variable, optional args
are:
+ - name: the name of the variable
- refstatus: empty if the zval is not a reference
- class: the class the object in the zval is an instance of
- resource: the type of the resource in the zval