NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Unwanted Breakpoints (with "ArrayAccess" and "


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Hello.

When I debug (Php 5.0.5, DBG 2.18.5, Nusphere 4, WinXp) a class that implemens the "ArrayAccess" or "Iterator" interface, the debuger stops in every interface-method. But I haven't set any breakpoint. Here some samplecode:

Code:
class Test implements ArrayAccess
{
  public $m_arTest = array(1,2,3);
 
 
  public function offsetExists ($par_offset)
  {
    return isSet($this->m_arTest[$par_offset]);
  }
 
  public function offsetGet ($par_offset)
  {
    return $this->m_arTest[$par_offset];
  }
 
  public function offsetSet($par_offset,$par_value)
  {
  }
 
  public function offsetUnset ($par_offset)
  {
  } 
 
}

$x = new Test();
$y = $x[1];


In the line "$y = $x[1]" the debuger stops in the method "offsetGet". Why?

Thanks.
View user's profileFind all posts by m.stiffelSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Probably you mean that there are blue dots on these lines and debugger stops on each of them when it's stepped with step-in or step-over command.

Debugger just has to stop on every executed line when you press F7 or F8 (step in, step over). All lines you meantioned are executed by php and PHP engine itself inserts these NOPs, debugger has very little to do with it. I'd recommend to use breakpoints. Just insert a breakpoint in code you're interested to debug and press F9 (Run) to reach it. Alternatively you may want to set debugger.ignore_nops=On in php.ini.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Hello.

Yes, I mean to go with F8 (step-over) over the line "$y = $x[1];". Then the debugger jumps into "offsetGet".
Thats not the expected behavior for "step-over". The "ignore_nops" setting doesn't change anything.
What can I do?

Thanks.
View user's profileFind all posts by m.stiffelSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
thanks I got it now.
Yes inneded there is a problem with DBG callstack.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 19 Oct 2004
Posts: 14
Reply with quote
I've found the same problem with the "autoload-function".
When these problems are solved?
View user's profileFind all posts by m.stiffelSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
I've found the same problem with the "autoload-function"

Could you please post a code sample that will replicate the problem?

Quote:
When these problems are solved?

In one week, hopefully.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Here it is:

Code:
 
function __autoload ($par_strClassName)
{
  switch ($par_strClassName)
  {
    case 'class1' : require('file.does.not.exist');   
  } 
}
 
$test = new class1();

By steping with F8 over "$test = new..." the debugger jumps into the autoload-function. I would expect this ony by using F7.

Thanks for your fast response.
View user's profileFind all posts by m.stiffelSend private message


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Hello.

I have the newes PhpEd & DBG version (PhpED 4.5, DBG 2.20.2) but the problem still occurs.
Should it be solved?

Bye.
View user's profileFind all posts by m.stiffelSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
problem with __autoload() is not solveable in dbg 2.x. Fix is scheduled for version 3.x where many major changes are to be done.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 19 Oct 2004
Posts: 14
Reply with quote
Ok, but when comes the 3.x version out?
I think the "one week" is almost over. Smile
View user's profileFind all posts by m.stiffelSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
One week was spend for finding the problem. This problem is not solvable in dbg 2.x and will remain as is in this version. Regarding version 3.x, it will come out with next version of PhpED. Personally I have no idea about timeframe.
What I'd recommend as workaround for 2.x is just move cursor to the line below "new class1();" statement and press F4 (run to cursor) instead of pressing F8 on that "new class1();" line.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Unwanted Breakpoints (with "ArrayAccess" and "
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic