[xdebug-general] Re: Watch a PHP variable as XDebug Breakpoint

From: Derick Rethans <derick[@]xdebug.org>
Date: Tue, 11 Feb 2014 14:28:38 +0000 (GMT)

On Wed, 29 Jan 2014, Stefano D. Mtangoo wrote:

> On 28/01/2014 12:34 alasiri, Derick Rethans wrote:
> > On Sat, 25 Jan 2014, Stefano D. Mtangoo wrote:
> >
> > > Iam using DBGp protocol to communicate with XDebug and so far its
> > > great. I can break on specific line numbers with no difficulty. I
> > > tried to make a watch and got error |breakpoint "type is not
> > > supported"|, which is clear that XDebug currently does not
> > > implement it. What made me ask this is, I have seen many IDEs with
> > > this feature (Eclipse included) and wondered how do they implement
> > > it. I want to watch expression like
> > >
> > > |$criteria = new CDbCriteria(); |
> > >
> > > I want IDE to break there so that I can update a watch window with
> > > new value.
> >
> > I think what they do is to just use "property_get" for all the
> > watches whenever a breakpoint happens. You can similate this by
> > setting a breakpoint on the line (after the line of code), and then
> > calling property_get yourself.
>
> Now this is great Idea. But since am still learning the protocol I
> need help to understand it better. For the above case I will request
> property_get passing $criteria as requested property and it should
> work But what if the thing am watching is rather expression, something
> like $x = $y+$z*$r where I want to watch expression $y+$z*$r not $x.
> In such cases whats your advice?

You can use the eval command instead then to obtain its value, but that
would only allow you to show it after a breakpoint has already happened.
I think that's closer at what you're describing as "watch" would not
even cover your case with "$y+$z*$r" as Xdebug would need just a
variable location, and not three *if* I would implement this later.

cheers,
Derick

-- 
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
twitter: @derickr and @xdebug
Received on Tue Feb 11 2014 - 14:28:38 GMT

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