[xdebug-general] Re: DBGp - Eval, property_get, & property_value

From: <jared[@]sharingds.org>
Date: Sat, 15 Apr 2006 18:19:12 -0500

Quoting Derick Rethans <derick[@]xdebug.org>:

> On Sat, 15 Apr 2006, Jared Phelps wrote:
>
>> First and foremost, AMAZING work on this extension and the DBGp
>> protocol Derick. All hail.
>
> You're welcome :)
>
>> I'm writing a PHP IDE using XDebug and the DBGp protocol.
>
> Might I inquire which IDE this is, and whether it will be open/free?
It doesn't have a name yet (the working name is PH POO (PHP Object-Oriented),
but I hope to come up with something a bit more tasteful :)

I haven't yet decided whether this will be a commercial or free project. I
expect to have a free version and a commercial version, but who knows.
I doubt
it will be open source...Nobody would want to look at my code.

I started the project because no commercial IDEs really support complex object
models and real "type inference" capability, so that is my "niche". That part
is done, and now I'm adding the other functionality (CVS, debugging, project
management, etc.)

>
>> I have the basic start, stop, and set breakpoints working, and am
>> currently implementing a "watch window" feature. I just can't seem to
>> get the behavior I'm looking for. I get the feeling that "eval" is a
>> bit better suited to the functionality of a watch window (since in
>> some IDEs you can do things like $x = 1 via watch). But that only
>> sends me back a property address. Then I can't get at the property
>> contents because I don't have a long name to ask for, only the
>> address.
>
> eval is basically a one-shot call without any state... so you can only
> use it to get basic return types. eval isn't meant for retrieving
> variables or data. You should use property_get/property_value for that.
>
>>
>> So given the code below, I set the breakpoint at the line "$y = 7".
>> <?php
>> $z = new Test();
>> $x = 3;
>> $y = 7;
>> class Test
>> {
>> var $y = 2,$x = 3;
>> }
>> ?>
>>
>> How can I get the value of $z, and all its children? In the debug
>> client, property_value gives me this:
>>
>> <response command="property_value" transaction_id="jared"
>> type="object" children="1" classname="test"
>> numchildren="2"></response>
>>
>> Useful stuff, but how would I get the rest of the children?
>
> This was a bug which I fixed 2 or 3 days ago. This bug would prevent
> from any children of an object to show up.
> (http://bugs.activestate.com/show_bug.cgi?id=45484)
>
Excellent. I will give the latest snapshot a try.
>> Similarly, how would I do function calls, assignments, and so-on with
>> "watch window like" functionality? The dbgp documentation is pretty
>> good, but a little lacking on these points. Sorry if it's in there
>> and I missed it somehow.
>
> You'll have to clarify this a bit better, as I'm not sure what you're
> trying to do here.
>
Sorry for not being clear...While in "break" mode, I would like the user to be
able to enter any arbitrary expression (function calls, assignments,
etc), have
PHP evaluate it, and display the result. Is there a command I'm
missing in dbgp
that will provide that functionality?

For example, I would like to send a command to the debugger engine like:
eval_expression -e "get_user($x + 3)" -i transaction_id, and have it
return some
xml representation of what get_user returned. Make sense?
> regards,
> Derick
> --
> Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Sun Apr 16 2006 - 01:20:03 BST

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