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

From: Derick Rethans <derick[@]xdebug.org>
Date: Sat, 15 Apr 2006 23:05:41 +0200 (CEST)

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?

> 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.

> 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.


Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Sat Apr 15 2006 - 23:06:38 BST

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