View Issue Details

IDProjectCategoryView StatusLast Update
0001638XdebugStep Debuggingpublic2019-02-21 21:44
Reporterzb3_got_no_mail Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
Product Version2.7.0RC2 
Summary0001638: Can't change string variable contents, property_set with string type has no effect
Description

property_set with -t string seems to have no effect even though no error returned. I am using php 7.3.2 and the latest xdebug (2.7.0RC2). Eclipse includes -t string when changing string variable contents.

Attached below are the example file and a textual representation of the packet dump.
Note: xdebug_do_eval is not called if -t used[0], Eclipse doesn't use -t for non string variables[1], so that works

[0] - https://github.com/xdebug/xdebug/blob/f0073b28dc1f7392f991001590b10f6b204a9931/xdebug_handler_dbgp.c#L1484
[1] - https://github.com/eclipse/pdt/blob/60c4dff8790a78f1f540141e220d12e2ce9e1ead/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java#L1512

TagsNo tags attached.
Attached Files
repro.php (272 bytes)   
<?php

echo("Insert breakpoint here\n");

$intvariable = 1;
$thevariable = "";

// now try to change the value
// of both variables

echo("Let's check...\n");

if ($intvariable !== 1 && $thevariable === "") {
  echo("xdebug bug!\n");
} else {
  echo("xdebug works\n");
}

repro.php (272 bytes)   
dump (11,558 bytes)   
497
<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///home/zb3/uni/repro.php" language="PHP" xdebug:language_version="7.3.2" protocol_version="1.0" appid="13229" idekey="session_name"><engine version="2.7.0RC2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
feature_set -i 1 -n show_hidden -v 1
219
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
feature_set -i 2 -n extended_properties -v 1
227
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="extended_properties" success="1"></response>
feature_set -i 3 -n max_depth -v 3
217
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_depth" success="1"></response>
feature_set -i 4 -n max_children -v 51
220
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="max_children" success="1"></response>
feature_set -i 5 -n max_data -v 1024
216
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="max_data" success="1"></response>
feature_get -i 6 -n encoding
245
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="6" feature_name="encoding" supported="1"><![CDATA[iso-8859-1]]></response>
feature_get -i 7 -n supports_async
242
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="7" feature_name="supports_async" supported="1"><![CDATA[0]]></response>
stdout -i 8 -c 1
192
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="8" success="1"></response>
stderr -i 9 -c 1
192
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stderr" transaction_id="9" success="0"></response>
breakpoint_set -i 10 -t line -f file:///home/zb3/uni/rcmail/index.php -n 39
204
<?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="10" id="132290001"></response>
breakpoint_set -i 11 -t line -f file:///home/zb3/uni/rcmail/index.php -n 118
204
<?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="11" id="132290002"></response>
breakpoint_set -i 12 -t line -f file:///home/zb3/uni/repro.php -n 3
204
<?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="12" id="132290003"></response>
step_into -i 13
297
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="13" status="break" reason="ok"><xdebug:message filename="file:///home/zb3/uni/repro.php" lineno="3"></xdebug:message></response>
stack_get -i 14
289
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="14"><stack where="{main}" level="0" type="file" filename="file:///home/zb3/uni/repro.php" lineno="3"></stack></response>
context_get -i 15 -c 1
8214
[censored]
context_get -i 16 -d 0
370
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="16" context="0"><property name="$intvariable" fullname="$intvariable" type="uninitialized"></property><property name="$thevariable" fullname="$thevariable" type="uninitialized"></property></response>
step_over -i 17
216
<?xml version="1.0" encoding="iso-8859-1"?>
<stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[SW5zZXJ0IGJyZWFrcG9pbnQgaGVyZQo=]]></stream>
297
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="17" status="break" reason="ok"><xdebug:message filename="file:///home/zb3/uni/repro.php" lineno="5"></xdebug:message></response>
stack_get -i 18
289
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="18"><stack where="{main}" level="0" type="file" filename="file:///home/zb3/uni/repro.php" lineno="5"></stack></response>
context_get -i 19 -c 1
8214
[censored]
context_get -i 20 -d 0
370
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="20" context="0"><property name="$intvariable" fullname="$intvariable" type="uninitialized"></property><property name="$thevariable" fullname="$thevariable" type="uninitialized"></property></response>
step_over -i 21
297
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="21" status="break" reason="ok"><xdebug:message filename="file:///home/zb3/uni/repro.php" lineno="6"></xdebug:message></response>
stack_get -i 22
289
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="22"><stack where="{main}" level="0" type="file" filename="file:///home/zb3/uni/repro.php" lineno="6"></stack></response>
context_get -i 23 -c 1
8214
[censored]
context_get -i 24 -d 0
373
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="24" context="0"><property name="$intvariable" fullname="$intvariable" type="int"><![CDATA[1]]></property><property name="$thevariable" fullname="$thevariable" type="uninitialized"></property></response>
step_over -i 25
298
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="25" status="break" reason="ok"><xdebug:message filename="file:///home/zb3/uni/repro.php" lineno="11"></xdebug:message></response>
stack_get -i 26
290
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="26"><stack where="{main}" level="0" type="file" filename="file:///home/zb3/uni/repro.php" lineno="11"></stack></response>
context_get -i 27 -c 1
8214
[censored]
context_get -i 28 -d 0
405
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="28" context="0"><property name="$intvariable" fullname="$intvariable" type="int"><![CDATA[1]]></property><property name="$thevariable" fullname="$thevariable" type="string" size="0" encoding="base64"><![CDATA[]]></property></response>
property_set -i 29 -n $intvariable -d 0 -l 4 -- Mg==
199
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_set" transaction_id="29" success="1"></response>
property_set -i 30 -t string -n $thevariable -d 0 -l 8 -- dGVzdA==
199
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_set" transaction_id="30" success="1"></response>
step_over -i 31
204
<?xml version="1.0" encoding="iso-8859-1"?>
<stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[TGV0J3MgY2hlY2suLi4K]]></stream>
298
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="31" status="break" reason="ok"><xdebug:message filename="file:///home/zb3/uni/repro.php" lineno="13"></xdebug:message></response>
stack_get -i 32
290
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="32"><stack where="{main}" level="0" type="file" filename="file:///home/zb3/uni/repro.php" lineno="13"></stack></response>
context_get -i 33 -c 1
8214
[censored]
context_get -i 34 -d 0
405
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="34" context="0"><property name="$intvariable" fullname="$intvariable" type="int"><![CDATA[2]]></property><property name="$thevariable" fullname="$thevariable" type="string" size="0" encoding="base64"><![CDATA[]]></property></response>
step_over -i 35
298
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="35" status="break" reason="ok"><xdebug:message filename="file:///home/zb3/uni/repro.php" lineno="14"></xdebug:message></response>
stack_get -i 36
290
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="36"><stack where="{main}" level="0" type="file" filename="file:///home/zb3/uni/repro.php" lineno="14"></stack></response>
context_get -i 37 -c 1
8214
[censored]
context_get -i 38 -d 0
405
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="38" context="0"><property name="$intvariable" fullname="$intvariable" type="int"><![CDATA[2]]></property><property name="$thevariable" fullname="$thevariable" type="string" size="0" encoding="base64"><![CDATA[]]></property></response>
step_over -i 39
200
<?xml version="1.0" encoding="iso-8859-1"?>
<stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[eGRlYnVnIGJ1ZyEK]]></stream>
214
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="39" status="stopping" reason="ok"></response>
dump (11,558 bytes)   
Operating SystemLinux
PHP Version7.3.2-7.3.4

Relationships

duplicate of 0001488 closedderick Rewrite property_set to use eval 

Activities

derick

2019-02-21 21:44

administrator   ~0004918

Hi!

Thanks for your report.

This is a duplicate of 0001488. After doing the refactoring of accessing variables, just using property_set with it's old (internal) logic no longer works. Instead, the internals need to be rewritten to use "eval" as is illustrated in 0001488.

cheers,
Derick

Issue History

Date Modified Username Field Change
2019-02-21 17:21 zb3_got_no_mail New Issue
2019-02-21 17:21 zb3_got_no_mail File Added: repro.php
2019-02-21 17:21 zb3_got_no_mail File Added: dump
2019-02-21 21:44 derick Assigned To => derick
2019-02-21 21:44 derick Status new => resolved
2019-02-21 21:44 derick Resolution open => duplicate
2019-02-21 21:44 derick Note Added: 0004918
2019-02-21 21:44 derick Relationship added duplicate of 0001488
2020-03-12 16:33 derick Category Remote Debugging => Step Debugging