[xdebug-general] Re: eval seems to always give "error evaluating code"

From: <jared[@]sharingds.org>
Date: Wed, 19 Apr 2006 10:41:58 -0500

I just barely got eval working OK with the latest xdebug dev snapshot,
and I was
able to call a function while at a breakpoint with it and see what it
returned. But two things that stick out to me with your code are:

1. I don't think you need or want the semicolon after the echo statement.
2. I would try it with the "print" function instead, since it will actually
return a value that you'll be able to see in the response. Echo returns void,
so I don't know what you could expect to see even if it wasn't erroring out.

I don't know if either of these things will do anything for you, but I
guess you
might as well try.

eval -i 1 -- cHJpbnQgImhlbGxvIg==

Good luck,
-Jared

Quoting Ben Dilts <beandog[@]gmail.com>:

> I very much appreciate the fast response. Unfortunately, I'm getting
> the same result, even with the exact string you specified:
>
> DBG: <init fileuri="file:///C%3A%5CApache2%5Chtdocs%5Cindex.php"
> language="PHP" protocol_version="1.0" appid="2448" idekey="test"> ...
> etc ...</init>
> IDE: eval -i 1 -- ZWNobyAnaGVsbG8nOw==
> DBG: <response command="eval" transaction_id="1" status="starting"
> reason="ok"><error code="206"><message><![CDATA[error evaluating
> code]]></message></error></response>
>
> I've tested the eval() function in a php script, just in case I had
> somehow disabled it in the .ini file, but it works fine. I manually
> inspected the actual 34 bytes of the string (counting \0) to make sure
> I was sending that exact data, and I am. And again, I tested this
> farther along during script execution, during a breakpoint, with the
> same result.
>
> An excerpt from my php.ini file:
>
> zend_extension_ts="c:/php/ext/php_xdebug-5.0.5-2.0.0beta5.dll"
>
> [xdebug]
> xdebug.remote_enable=On
> xdebug.remote_host=localhost
> xdebug.remote_port=9000
> xdebug.remote_autostart=On
> xdebug.remote_handler=dbgp
>
> Am I missing a required setting there? Other commands work fine (Run,
> step into, over, property_get, etc.). It's funny that property_get
> works fine, because as I understand it, that is done internally using
> eval.
>
> Thanks again for your help,
>
>
>
> Ben Dilts
>
> On 4/18/06, Derick Rethans <derick[@]xdebug.org> wrote:
>> On Mon, 17 Apr 2006, Ben Dilts wrote:
>>
>> > Unless I'm mistaken (that's happened once before), if I simply do
>> eval("echo
>> > 'hello';") in PHP, it executes that code and sends the string
>> 'hello' to the
>> > HTTP response. I think I must be misreading the documentation, but the
>> > format is given as this:
>> >
>> > eval -i transaction_id -- {DATA}
>>
>> Section 6 says that all data should be base64 encoded, which means you
>> should call eval like this:
>>
>> eval -i 42 -- ZWNobyAnaGVsbG8nOw==
>>
>> where "ZWNobyAnaGVsbG8nOw==" is
>>
>> echo 'hello';
>>
>> encoded with base64.
>>
>> The reason for this is that you need to be able to send all kinds of
>> binary data.
>>
>> regards,
>> Derick
>>
>> --
>> Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
>>
>
>
>
Received on Wed Apr 19 2006 - 17:42:11 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST