View Issue Details

IDProjectCategoryView StatusLast Update
0002049XdebugStep Debuggingpublic2022-02-01 16:34
ReporterZobo Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version3.1.2 
Fixed in Version3.1.3 
Summary0002049: evaling broken code (still) causes unhandled exception in PHP 7.4
Description

This issue is directly related https://bugs.xdebug.org/view.php?id=1993 .
The fix works well on PHP 8, but not on PHP 7.4 and before.
Specifically placing the text "namespace" in VS Code watch - thus executing eval namespace breaks following step operation.

Steps To Reproduce

Crate file

<?php

xdebug_break();
echo "1";
echo "2";

Stop execution on breakpoint and run eval. Step next and it sould

eval -i 17 -- bmFtZXNwYWNl
<?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="17" status="break" reason="ok"><error code="206"><message><![CDATA[error evaluating code]]></message></error></response>

step_over -i 21
<?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="stopping" reason="ok"></response>

Additional Information

Fix tested on PHP 7.4.3

Provided https://github.com/xdebug/xdebug/pull/811
Related https://github.com/xdebug/vscode-php-debug/issues/692

TagsNo tags attached.
Operating SystemWin, Linux...
PHP Version7.4.20-7.4.29

Activities

derick

2021-12-08 17:47

administrator   ~0006173

I can't reproduce this with the information provided: https://github.com/xdebug/xdebug/pull/812 — Can you provide the full xdebug log and script that you use please?

Zobo

2021-12-08 21:42

reporter   ~0006174

Here is the, code, xd2.log that show stepping through it without executing evaluate, and xd3.log that adds the eval command in the middle. See the lineno in stack, how it jumps to 0.

derick

2021-12-15 11:29

administrator   ~0006175

https://github.com/xdebug/xdebug/pull/812

derick

2021-12-15 15:31

administrator   ~0006176

Fixed for Xdebug 3.1.3. I've removed the version define check altogether, as it was needed for PHP 7.2 and up, but also had to adjust the patch due to a new compiler warning.