Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Watching get_included_files()
Watching get_included_files() [message #76134] Thu, 17 July 2008 07:49 Go to next message
Eclipse UserFriend
Originally posted by: christian.wolf.sedo.de

Hello everybody,

I'm currently (remotely) debugging a bigger Typo3 module project. Due to
class redeclaration, I tried to monitor all included classes with PHP's
get_included_files(). Adding it to the watch list showed me the total items
(70) and the first array chunk (items 0 - 31), but the following two chunks
aren't displayed at all. The expanding crosses for the chunks 2 and 3 show
up when I start the debug session, but the expansion itself doesn't work.
However, when adding the line

$includedFiles = get_included_files();

to the PHP file, inspection works as expected. But that's not the proper way
of debugging, of course.

Does anybody experience the same problem and has a solution?

Thanks,
Christian


Eclipse 3.3.2, Debian 4.0, Apache 2.2.3, PHP 4.4.4, XDebug 2.0.2
Re: Watching get_included_files() [message #76150 is a reply to message #76134] Thu, 17 July 2008 09:52 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
I am guessing you are using xdebug ?

The problem you are describing is due to the way watch expressions work and the amount of data
xdebug returns as default.

As you know watches are expressions not variables so when you watch something like
get_include_files(), there is no variable defined to hold the results in PHP. xdebug by default
returns only the 1st 32 elements of the array which is why you can see this information in the
watch. However when you try to expand the next set of elements it needs a way to query the next set
of elements, and there is no way to do that as there is no variable in PHP which is holding the
results. It is also not possible to re-evaluate the expression and get it to pass the next set of
elements.

A solution would be to enhance PDT to allow you to specify the max children property of xdebug. This
would control the amount of information xdebug would send back when querying information about
arrays/objects such that if you set this value to say 100 it would transfer 100 elements back on
each request (and that show up as array chunks of [0-99] [100-199] etc, and in the watch expression
it would contain everything you need in the first chunk). The alternative is to do as you have done
by creating a variable to hold the information.

I have raised an enhancement https://bugs.eclipse.org/bugs/show_bug.cgi?id=241219 to record this and
if you are interested, please register your vote.

Regards
Dave Kelsey


Christian A. Wolf wrote:
> Hello everybody,
>
> I'm currently (remotely) debugging a bigger Typo3 module project. Due to
> class redeclaration, I tried to monitor all included classes with PHP's
> get_included_files(). Adding it to the watch list showed me the total items
> (70) and the first array chunk (items 0 - 31), but the following two chunks
> aren't displayed at all. The expanding crosses for the chunks 2 and 3 show
> up when I start the debug session, but the expansion itself doesn't work.
> However, when adding the line
>
> $includedFiles = get_included_files();
>
> to the PHP file, inspection works as expected. But that's not the proper way
> of debugging, of course.
>
> Does anybody experience the same problem and has a solution?
>
> Thanks,
> Christian
>
>
> Eclipse 3.3.2, Debian 4.0, Apache 2.2.3, PHP 4.4.4, XDebug 2.0.2
>
>
Re: Watching get_included_files() [message #76166 is a reply to message #76150] Thu, 17 July 2008 12:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.wolf.sedo.de

Hello Dave,

>I am guessing you are using xdebug ?

you guessed right, sorry.

> The problem you are describing is due to the way watch expressions work
> and the amount of data xdebug returns as default.
>
> As you know watches are expressions not variables so when you watch
> something like get_include_files(), there is no variable defined to hold
> the results in PHP. xdebug by default returns only the 1st 32 elements of
> the array which is why you can see this information in the watch. However
> when you try to expand the next set of elements it needs a way to query
> the next set of elements, and there is no way to do that as there is no
> variable in PHP which is holding the results. It is also not possible to
> re-evaluate the expression and get it to pass the next set of elements.

Ok, I didn't know about the limitation of XDebug to the first 32 elements
when debugging remotely, thank you. I found no public documentation how to
raise this parameter's default value.

> A solution would be to enhance PDT to allow you to specify the max
> children property of xdebug. This would control the amount of information
> xdebug would send back when querying information about arrays/objects such
> that if you set this value to say 100 it would transfer 100 elements back
> on each request (and that show up as array chunks of [0-99] [100-199] etc,
> and in the watch expression it would contain everything you need in the
> first chunk). The alternative is to do as you have done by creating a
> variable to hold the information.
>
> I have raised an enhancement
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=241219 to record this and if
> you are interested, please register your vote.

This is a very nice enhancement; I will vote for it when I found my Eclipse
Bugzilla login.

I'm curious, how would PDT raise that value? Would it send special commands
to XDebug, or would it repeat the default queries? Or don't you know that by
now?

Thanks,
Christian


Eclipse 3.3.2, Debian 4.0, Apache 2.2.3, PHP 4.4.4, XDebug 2.0.2
Re: Watching get_included_files() [message #76182 is a reply to message #76166] Thu, 17 July 2008 14:00 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
Christian A. Wolf wrote:
> This is a very nice enhancement; I will vote for it when I found my Eclipse
> Bugzilla login.
>
> I'm curious, how would PDT raise that value? Would it send special commands
> to XDebug, or would it repeat the default queries? Or don't you know that by
> now?
PDT can do it via the "feature set" command for the max_children feature, and this works. What is
needed is a way for the user to set the value. This is likely to be a global preference set in the
debugger specific preferences for xdebug.

Regards
Dave Kelsey
Re: Watching get_included_files() [message #76213 is a reply to message #76182] Thu, 17 July 2008 15:54 Go to previous message
Christian Wolf is currently offline Christian WolfFriend
Messages: 1
Registered: July 2009
Junior Member
Hello Dave,

> PDT can do it via the "feature set" command for the max_children
> feature, and this works. What is needed is a way for the user to set the
> value. This is likely to be a global preference set in the debugger
> specific preferences for xdebug.

ah, very interesting, thank you.

By the way: PDT is a great plugin. I'm currently establishing it in my
company as the main IDE, especially the comfortable debugging is a
strong argument. Thanks (of course to the whole team) for all your good
work!

Regards,
Christian
Previous Topic:[PDT installation] Cannot find a solution satisfying the following requirements
Next Topic:Code Assist Fail
Goto Forum:
  


Current Time: Wed Apr 24 15:52:31 GMT 2024

Powered by FUDForum. Page generated in 0.03778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top