Skip to content

Commit

Permalink
- Fixed bug xdebug#518: make CLASSNAME pseudo-property optional, not …
Browse files Browse the repository at this point in the history
…necessary.

SVN Rev: 3403
  • Loading branch information
derickr committed Feb 24, 2011
1 parent 3efe9b1 commit 481185a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tests/bug00421.phpt
Expand Up @@ -42,7 +42,7 @@ dbgpRun( str_replace( 'FILE', "\"$file\"", $data ), $commands );

-> context_get -i 5 -c 0
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="5" context="0"><property name="currentPageXML" fullname="$currentPageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="@attributes" fullname="$currentPageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$currentPageXML-&gt;@attributes[&apos;name&apos;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$currentPageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$currentPageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property></property><property name="1" fullname="$currentPageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property></property></property></property><property name="iterator" fullname="$iterator" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="page" fullname="$iterator-&gt;page" facet="public" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="@attributes" fullname="$iterator-&gt;page-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$iterator-&gt;page-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property></property><property name="name" fullname="$name" type="uninitialized"></property><property name="pageXML" fullname="$pageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="@attributes" fullname="$pageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$pageXML-&gt;@attributes[&apos;name&apos;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$pageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$pageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property></property><property name="1" fullname="$pageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property></property></property></property><property name="projectsIterator" fullname="$projectsIterator" address="" type="array" children="1" numchildren="3" page="0" pagesize="32"><property name="0" fullname="$projectsIterator[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="@attributes" fullname="$projectsIterator[0]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$projectsIterator[0]-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property><property name="1" fullname="$projectsIterator[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="@attributes" fullname="$projectsIterator[1]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property><property name="2" fullname="$projectsIterator[2]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[SimpleXMLIterator]]></property><property name="@attributes" fullname="$projectsIterator[2]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property></property><property name="siteXMLString" fullname="$siteXMLString" address="" type="string" size="161" encoding="base64"><![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNpdGU+CiAgICA8cGFnZSBuYW1lPSJwcm9qZWN0cyI+CiAgICAgICAgPHBhZ2UgbmFtZT0iUHJvamVjdCAxIiAvPgogICAgICAgIDxwYWdlIG5hbWU9IlByb2plY3QgMiIgLz4KICAgIDwvcGFnZT4KPC9zaXRlPgo=]]></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="5" context="0"><property name="currentPageXML" fullname="$currentPageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$currentPageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$currentPageXML-&gt;@attributes[&apos;name&apos;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$currentPageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$currentPageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property><property name="1" fullname="$currentPageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property></property></property><property name="iterator" fullname="$iterator" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="page" fullname="$iterator-&gt;page" facet="public" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$iterator-&gt;page-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$iterator-&gt;page-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property></property><property name="name" fullname="$name" type="uninitialized"></property><property name="pageXML" fullname="$pageXML" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$pageXML-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1" page="0" pagesize="32"><property name="name" fullname="$pageXML-&gt;@attributes[&apos;name&apos;]" address="" type="string" size="8" encoding="base64"><![CDATA[cHJvamVjdHM=]]></property></property><property name="page" fullname="$pageXML-&gt;page" facet="public" address="" type="array" children="1" numchildren="2" page="0" pagesize="32"><property name="0" fullname="$pageXML-&gt;page[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property><property name="1" fullname="$pageXML-&gt;page[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1"></property></property></property><property name="projectsIterator" fullname="$projectsIterator" address="" type="array" children="1" numchildren="3" page="0" pagesize="32"><property name="0" fullname="$projectsIterator[0]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="2" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[0]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property><property name="page" fullname="$projectsIterator[0]-&gt;page" facet="public" address="" type="array" children="1" numchildren="2"></property></property><property name="1" fullname="$projectsIterator[1]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[1]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property><property name="2" fullname="$projectsIterator[2]" address="" type="object" classname="SimpleXMLIterator" children="1" numchildren="1" page="0" pagesize="32"><property name="@attributes" fullname="$projectsIterator[2]-&gt;@attributes" facet="public" address="" type="array" children="1" numchildren="1"></property></property></property><property name="siteXMLString" fullname="$siteXMLString" address="" type="string" size="161" encoding="base64"><![CDATA[PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHNpdGU+CiAgICA8cGFnZSBuYW1lPSJwcm9qZWN0cyI+CiAgICAgICAgPHBhZ2UgbmFtZT0iUHJvamVjdCAxIiAvPgogICAgICAgIDxwYWdlIG5hbWU9IlByb2plY3QgMiIgLz4KICAgIDwvcGFnZT4KPC9zaXRlPgo=]]></property></response>

-> detach -i 6
<?xml version="1.0" encoding="iso-8859-1"?>
Expand Down
2 changes: 1 addition & 1 deletion tests/bug00494.phpt
Expand Up @@ -33,7 +33,7 @@ dbgpRun( $data, $commands );

-> property_get -i 4 -n o
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="o" fullname="$o" address="" type="object" classname="def" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[def]]></property><property name="arr" fullname="$o-&gt;arr" facet="private" address="" type="null"></property></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="4"><property name="o" fullname="$o" address="" type="object" classname="def" children="1" numchildren="2" page="0" pagesize="32"><property name="arr" fullname="$o-&gt;arr" facet="private" address="" type="null"></property></property></response>

-> detach -i 5
<?xml version="1.0" encoding="iso-8859-1"?>
Expand Down
6 changes: 3 additions & 3 deletions tests/bug00530.phpt
Expand Up @@ -42,15 +42,15 @@ dbgpRun( $data, $commands );

-> property_get -i 5 -n this
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="5"><property name="this" fullname="$this" address="" type="object" classname="MyClass" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[MyClass]]></property><property name="a" fullname="$this-&gt;a" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property><property name="b" fullname="$this-&gt;b" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="5"><property name="this" fullname="$this" address="" type="object" classname="MyClass" children="1" numchildren="2" page="0" pagesize="32"><property name="a" fullname="$this-&gt;a" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property><property name="b" fullname="$this-&gt;b" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property></property></response>

-> property_get -i 6 -n this -p 0
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="6"><property name="this" fullname="$this" address="" type="object" classname="MyClass" children="1" numchildren="2" page="0" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[MyClass]]></property><property name="a" fullname="$this-&gt;a" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property><property name="b" fullname="$this-&gt;b" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="6"><property name="this" fullname="$this" address="" type="object" classname="MyClass" children="1" numchildren="2" page="0" pagesize="32"><property name="a" fullname="$this-&gt;a" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property><property name="b" fullname="$this-&gt;b" facet="private" address="" type="string" size="1" encoding="base64"><![CDATA[Yg==]]></property></property></response>

-> property_get -i 7 -n this -p 1
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="7"><property name="this" fullname="$this" address="" type="object" classname="MyClass" children="1" numchildren="2" page="1" pagesize="32"><property name="CLASSNAME" type="string"><![CDATA[MyClass]]></property></property></response>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="7"><property name="this" fullname="$this" address="" type="object" classname="MyClass" children="1" numchildren="2" page="1" pagesize="32"></property></response>

-> detach -i 8
<?xml version="1.0" encoding="iso-8859-1"?>
Expand Down
11 changes: 0 additions & 11 deletions xdebug_var.c
Expand Up @@ -688,17 +688,6 @@ void xdebug_var_export_xml_node(zval **struc, char *name, xdebug_xml_node *node,
xdebug_xml_add_attribute_ex(node, "classname", xdstrdup(class_name), 0, 1);
xdebug_xml_add_attribute(node, "children", (myht && zend_hash_num_elements(myht))?"1":"0");

/** Temporary additional property **/
{
xdebug_xml_node *pnode;

pnode = xdebug_xml_node_init("property");
xdebug_xml_add_attribute(pnode, "name", "CLASSNAME");
xdebug_xml_add_attribute(pnode, "type", "string");
xdebug_xml_add_text(pnode, xdstrdup(class_name));
xdebug_xml_add_child(node, pnode);
}

if (myht) {
if (myht->nApplyCount < 1) {
xdebug_xml_add_attribute_ex(node, "numchildren", xdebug_sprintf("%d", zend_hash_num_elements(myht)), 0, 1);
Expand Down

0 comments on commit 481185a

Please sign in to comment.