Home » Language IDEs » PHP Development Tools (PDT) » create_function and step-into (xdebug)
|
Re: create_function and step-into (xdebug) [message #55975 is a reply to message #55914] |
Sat, 29 September 2007 11:42 |
Eclipse User |
|
|
|
Originally posted by: Martin.eisengardt.de
IMHO this is a bug. Stepping into dynamic functions/ eval would be nice but
I think it is not possible inside PDT. Because create function compiles this
code and the debugger does not have any source file it could start with.
Source can be located in some strings read from database. The only way is to
display disassembly (zend opcodes). That would be a nice feature at all ;-)
> Would it be possible to disable the "step into" button when reaching lines
> that contain such calls?
Disabling would be nice or simply step over instead of displaying any error
message. Eclipse (JDT with native functions and PDT with built in or c
methods) already ignores every step into non debuggable code.
|
|
| |
Re: create_function and step-into (xdebug) [message #56057 is a reply to message #55914] |
Sun, 30 September 2007 15:54 |
Eclipse User |
|
|
|
Originally posted by: dkel50.hotnospmail.com
Sorry, forgot to add, to get the message improved you will need to raise
a bugzilla about it and quote the example you gave in the append to show
how it doesn't cover this.
Cheers
Dave Kelsey
Ali B. wrote:
> Debug the the below breaking at the fist line:
>
> <?php
> $newfunc = create_function('$a,$b', 'return "Avarage=" . ($a+$b)/2;');
> echo "functio name: $newfunc\n";
> echo $newfunc(7,5) . "\n";
> ?>
>
> Now if you reach the 3rd line and try to "step into" it to execute the
> anonymous function, the debugger would give you an error stating that it
> cannot reach the file where the function exists, which osofcourse normal
> since there is not file where this function is defined.
>
> I don't know if this would be a bug or just a new feature (new feature
> is more like it). Would it be possible to disable the "step into" button
> when reaching lines that contain such calls? Or at least, give a more
> informative error message?
>
> Cheers,
> Ali
|
|
|
Re: create_function and step-into (xdebug) [message #56082 is a reply to message #56057] |
Sun, 30 September 2007 20:31 |
Ali B. Messages: 66 Registered: July 2009 |
Member |
|
|
Dave,
Thanks. But can't it just handles this case the same way it does to
bultin functions for example (as Martin suggested)?
Cheers,
Ali
Dave wrote:
> Sorry, forgot to add, to get the message improved you will need to raise
> a bugzilla about it and quote the example you gave in the append to show
> how it doesn't cover this.
>
> Cheers
> Dave Kelsey
>
>
> Ali B. wrote:
>> Debug the the below breaking at the fist line:
>>
>> <?php
>> $newfunc = create_function('$a,$b', 'return "Avarage=" . ($a+$b)/2;');
>> echo "functio name: $newfunc\n";
>> echo $newfunc(7,5) . "\n";
>> ?>
>>
>> Now if you reach the 3rd line and try to "step into" it to execute the
>> anonymous function, the debugger would give you an error stating that
>> it cannot reach the file where the function exists, which osofcourse
>> normal since there is not file where this function is defined.
>>
>> I don't know if this would be a bug or just a new feature (new feature
>> is more like it). Would it be possible to disable the "step into"
>> button when reaching lines that contain such calls? Or at least, give
>> a more informative error message?
>>
>> Cheers,
>> Ali
|
|
|
Re: create_function and step-into (xdebug) [message #56182 is a reply to message #56082] |
Mon, 01 October 2007 10:21 |
D Kelsey Messages: 232 Registered: July 2009 |
Senior Member |
|
|
It would not be possible to gray out the step into buttons (note they aren't grayed out
when you are about to execute a built-in or extension function). As built-in
and extension functions are c code, not php, xdebug won't be able to interrupt
the execution of them (so to xdebug these are atomic). PDT won't know what the next
line will do, even PHP doesn't know what the next line will do until it actually
executes it so PHP+Xdebug isn't able to tell PDT that the next line should not
support step into.
As you have created an anonymous php function which can be interrupted
by xdebug it will be able to step into it like any other function. Xdebug would have to
be to determine it was in an anonymous function and to not allow stepping
into it (a step_into request would be interpreted as step_over). There isn't anything
PDT can do about this except provide a better error message.
You could try raising an enhancement on xdebug itself at http://www.xdebug.org which
would then have some sort of configurable option to allow it to behave the way you want, then
it will be upto Derick to assess the feasibility of this.
Cheers
Dave Kelsey
Ali B. wrote:
> Dave,
>
> Thanks. But can't it just handles this case the same way it does to
> bultin functions for example (as Martin suggested)?
>
> Cheers,
> Ali
>
> Dave wrote:
>> Sorry, forgot to add, to get the message improved you will need to raise
>> a bugzilla about it and quote the example you gave in the append to
>> show how it doesn't cover this.
>>
>> Cheers
>> Dave Kelsey
>>
>>
>> Ali B. wrote:
>>> Debug the the below breaking at the fist line:
>>>
>>> <?php
>>> $newfunc = create_function('$a,$b', 'return "Avarage=" . ($a+$b)/2;');
>>> echo "functio name: $newfunc\n";
>>> echo $newfunc(7,5) . "\n";
>>> ?>
>>>
>>> Now if you reach the 3rd line and try to "step into" it to execute
>>> the anonymous function, the debugger would give you an error stating
>>> that it cannot reach the file where the function exists, which
>>> osofcourse normal since there is not file where this function is
>>> defined.
>>>
>>> I don't know if this would be a bug or just a new feature (new
>>> feature is more like it). Would it be possible to disable the "step
>>> into" button when reaching lines that contain such calls? Or at
>>> least, give a more informative error message?
>>>
>>> Cheers,
>>> Ali
|
|
|
Re: create_function and step-into (xdebug) [message #56254 is a reply to message #56182] |
Mon, 01 October 2007 13:14 |
Ali B. Messages: 66 Registered: July 2009 |
Member |
|
|
Dave,
You made that crystal clear.. Thanks.
Cheers
Ali
Dave Kelsey wrote:
> It would not be possible to gray out the step into buttons (note they
> aren't grayed out
> when you are about to execute a built-in or extension function). As
> built-in
> and extension functions are c code, not php, xdebug won't be able to
> interrupt
> the execution of them (so to xdebug these are atomic). PDT won't know
> what the next
> line will do, even PHP doesn't know what the next line will do until it
> actually
> executes it so PHP+Xdebug isn't able to tell PDT that the next line
> should not
> support step into.
>
> As you have created an anonymous php function which can be interrupted
> by xdebug it will be able to step into it like any other function.
> Xdebug would have to
> be to determine it was in an anonymous function and to not allow stepping
> into it (a step_into request would be interpreted as step_over). There
> isn't anything
> PDT can do about this except provide a better error message.
>
> You could try raising an enhancement on xdebug itself at
> http://www.xdebug.org which
> would then have some sort of configurable option to allow it to behave
> the way you want, then
> it will be upto Derick to assess the feasibility of this.
>
> Cheers
> Dave Kelsey
>
>
> Ali B. wrote:
>> Dave,
>>
>> Thanks. But can't it just handles this case the same way it does to
>> bultin functions for example (as Martin suggested)?
>>
>> Cheers,
>> Ali
>>
>> Dave wrote:
>>> Sorry, forgot to add, to get the message improved you will need to raise
>>> a bugzilla about it and quote the example you gave in the append to
>>> show how it doesn't cover this.
>>>
>>> Cheers
>>> Dave Kelsey
>>>
>>>
>>> Ali B. wrote:
>>>> Debug the the below breaking at the fist line:
>>>>
>>>> <?php
>>>> $newfunc = create_function('$a,$b', 'return "Avarage=" . ($a+$b)/2;');
>>>> echo "functio name: $newfunc\n";
>>>> echo $newfunc(7,5) . "\n";
>>>> ?>
>>>>
>>>> Now if you reach the 3rd line and try to "step into" it to execute
>>>> the anonymous function, the debugger would give you an error stating
>>>> that it cannot reach the file where the function exists, which
>>>> osofcourse normal since there is not file where this function is
>>>> defined.
>>>>
>>>> I don't know if this would be a bug or just a new feature (new
>>>> feature is more like it). Would it be possible to disable the "step
>>>> into" button when reaching lines that contain such calls? Or at
>>>> least, give a more informative error message?
>>>>
>>>> Cheers,
>>>> Ali
|
|
|
Goto Forum:
Current Time: Sat Apr 27 04:42:13 GMT 2024
Powered by FUDForum. Page generated in 0.03340 seconds
|