[xdebug-general] Re: xdebug and geben, property_get

From: Jörg Lenneis <lenneis[@]wu-wien.ac.at>
Date: Thu, 07 Jul 2011 18:49:40 +0200

On 07/07/2011 05:21 PM, Derick Rethans wrote:
> On Sun, 26 Jun 2011, lenneis wrote:
>
[...]
>>
>> Hm, why is "CLASSNAME" in there as a property but no other properties? Seems
>> to be a special "magic" property, maybe for display purposes.
>
> That has been fixed in the latest versions of Xdebug though (atleast in
> the 2.2/master branch).
>

OK, thanks.

>> When I try to get at the contents of $rec->data, geben issues the
>> following DBGB commands:
>>
>> property_get -i 30024 -d 0 -c 0 -n $rec->data -p 1
>> property_get -i 30025 -d 0 -c 0 -n $rec->data -p 2
>>
>> That does not seem to be the right command. xdebug answers with this:
>>
>> <response xmlns="urn:debugger_protocol_v1"
>> xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get"
>> transaction_id="30024">
>> <property name="$rec->data" fullname="$rec->data" address="-1257479416"
>> type="object" classname="stdClass" children="1" numchildren="3" page="1"
>> pagesize="32">
>> <property name="CLASSNAME" type="string">stdClass</property>
>> </property>
>> </response>
>>
>> The response is the same for both property_get commands, the only
>> difference is that page="1" changes to page="2" for the second reply.
>
> It should really be requesting page 0 (it's a 0-based index) with
> "-p 0".
>

OK, that should be easy enough to find and fix.

>> I then tried this manually (geben gives you a nice CLI window where
>> you can issue low level DBGP commands interspersed with regular geben
>> commands):

[...]

>
> -k is not used in Xdebug so it's a no-op. -p defaults to 0.
>
> -p is used in case there are more children available than fit in a page
> size (numchildren > page_size). So -p 0 will show the first page (first
> 32 children in your example, because of "-n max_children -v 32") and -p
> 1 will show you child 33-64 etc.
>

Oh so that is what a page is: The number of entries retrieved in one
property_get. And if the page number defaults to 0 that explains why it
suddenly seemed to "work" with -k 1. Does that apply to the same level
of children or recursivly as well, i.e. property_get will recursivly
retrieve entries up to max_depth until max_children is reached?

> Hope this helps!
>
> cheers,
> Derick
>

It certainly does, thanks.

-- 
Joerg Lenneis
Received on Thu Jul 07 2011 - 17:59:37 BST

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