Skip to content
Permalink
Browse files

Merge branch 'xdebug_2_8'

  • Loading branch information...
derickr committed Oct 7, 2019
2 parents 4686302 + 25dabdf commit c51a7a8117c3cde6cbec5d5658912738a7ce2c6c
Showing with 52 additions and 1 deletion.
  1. +3 −1 src/lib/var.c
  2. +9 −0 tests/debugger/bug01708.inc
  3. +40 −0 tests/debugger/bug01708.phpt
@@ -1990,7 +1990,9 @@ static int xdebug_object_element_export_xml_node(xdebug_object_item *item_nptr,

check_if_extended_properies_are_needed(options, tmp_name, tmp_fullname, (*item)->zv);
add_xml_attribute_or_element(options, node, "name", 4, tmp_name);
add_xml_attribute_or_element(options, node, "fullname", 8, tmp_fullname);
if (tmp_fullname) {
add_xml_attribute_or_element(options, node, "fullname", 8, tmp_fullname);
}

xdebug_xml_add_attribute_ex(node, "facet", xdebug_sprintf("%s%s", (*item)->type == XDEBUG_OBJECT_ITEM_TYPE_STATIC_PROPERTY ? "static " : "", modifier), 0, 1);
xdebug_xml_add_child(parent, node);
@@ -0,0 +1,9 @@
<?php
class Bar {
public $baz = 0;
}
$a = new Bar();
echo "!"; // put breakpoint here
?>
@@ -0,0 +1,40 @@
--TEST--
Test for bug #1708: Crash on evaluating object with properties
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('dbgp');
?>
--FILE--
<?php
require 'dbgp/dbgpclient.php';
$filename = dirname(__FILE__) . '/bug01708.inc';
$commands = array(
"breakpoint_set -t line -f file://{$filename} -n 8",
'run',
'eval -- JGE=',
'detach',
);
dbgpRunFile( $filename, $commands );
?>
--EXPECT--
<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file://bug01708.inc" language="PHP" xdebug:language_version="" protocol_version="1.0" appid="" idekey=""><engine version=""><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2099 by Derick Rethans]]></copyright></init>

-> breakpoint_set -i 1 -t line -f file://bug01708.inc -n 8
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="1" id=""></response>

-> run -i 2
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="2" status="break" reason="ok"><xdebug:message filename="file://bug01708.inc" lineno="8"></xdebug:message></response>

-> eval -i 3 -- JGE=
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="3"><property type="object" classname="Bar" children="1" numchildren="1" page="0" pagesize="32"><property name="baz" facet="public" type="int"><![CDATA[0]]></property></property></response>

-> detach -i 4
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="detach" transaction_id="4" status="stopping" reason="ok"></response>

0 comments on commit c51a7a8

Please sign in to comment.
You can’t perform that action at this time.