Dear Derick,
thank you for the reminder that data needs to be base64 encoded.
However, this doesn't solve the problem. Here is the output from the command as you suggest it:
eval -i 1 -- NDI=
<?xml version="1.0" encoding="utf-8"?><response xmlns="urn:debugger_protocol_v1" command="eval" transaction_id="1"><error code="3"><message><![CDATA[required argument [l:length] missing]]></message></error></response>
(Btw, also the Eclipse DLTK Python Debugger, connected to the Komodo Engine, shows "required argument [l:length] missing".)
Why is the -l argument required? It is not documented. Do I have to give the length of the original string ("42") or of the encoded string ("NDI=")?
The more serious problem is still the 'context_id', after adding the -l argument:
eval -i 1 -l 2 -- NDI=
<?xml version="1.0" encoding="utf-8"?><response xmlns="urn:debugger_protocol_v1" command="eval" transaction_id="1"><error code="998"><message><![CDATA[global name 'context_id' is not defined]]></message></error></response>
The error appears to come from the lines 2938,2939 in do_eval() in dbgp/client.py:
prop = Property(None, None, value, self._data_encoding,
self._show_hidden, hiddenContextTypes[context_id])
I have no idea what I am doing wrong. Do I have to send other commands before the above "eval" so that the debug engine enters a state where "context_id" is known? Do I have to pass a context_id to "eval" using the -c option? If yes, how? Sending "eval -i 1 -l 2 -c 0 -- NDI=" fails, because "0 -- NDI=" seems to be interpreted as base64 data.
Can you tell me the sequence of commands that should succeed to evaluate a simple expression like "42", or maybe how to evaluate a variable in a short example python script? Any help is much appreciated!
Thanks
Ronaldo
________________________________
Von: Derick Rethans <derick@xdebug.org>
An: Ronaldo Ronaldino <ronaldo_ronaldino@ymail.com>
CC: xdebug-general@lists.xdebug.org
Gesendet: Freitag, den 27. März 2009, 12:34:33 Uhr
Betreff: [xdebug-general] Re: eval command returns "global name 'context_id' is not defined"
On Thu, 26 Mar 2009, Ronaldo Ronaldino wrote:
> Hello,
> I try to write a simple program that communicates with pydbgp from Komodo-PythonRemoteDebugging-5.0.3-25622-linux-x86.tar.gz.
>
> How do I evaluate a simple expression like for example "42"?
> Sending this command:
> eval -i 1 -l 2 -- 42
> returns the error:
> <?xml version="1.0" encoding="utf-8"?><response xmlns="urn:debugger_protocol_v1" command="eval" transaction_id="1"><error code="998"><message><![CDATA[global name 'context_id' is not defined]]></message></error></response>
>
> How do I define the global 'context_id' or what else do I have to change?
I've no idea where that error message comes from, but all expressions
should be encoded in base64 encoding, like:
eval -i 1 -- NDI=
regards,
Derick
--
Like Xdebug? Send a postcard: http://derickrethans.nl/xdebug_2_released.php
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
twitter: derickrethans
Received on Sat Mar 28 2009 - 11:13:45 GMT
This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST