NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
context/scope switching doesn't update variable view


Joined: 18 Aug 2006
Posts: 10
Reply with quote
Hi.

I've been used to the Visual Studio C/C++, C# and (i think zend's php) debuggers and when I set a breakpoint in my app and the debugger stops at the breakpoint I can examine the variables/watch views and also hover over variable names in the editor window and have the values shown as tooltips.

Now, in php dbg this works for the function that was being called at the time the debugger stops at the breakpoint just fine and I can see the variables for the current scope.

however, if I use the callstack view to find the line of code in the function that called the function where the breakpoint was set, the scope of the debugger doesn't change and all the variables are still shown relating to the scope where the debugger stopped.

In Visual Studio the context would be switched to that of the calling function, so you would see variables in the scope of the calling function.

e.g. if you have a class instance calling a member function of another class's instance $this in the first class would releate to the first class and $this in the second class would relate to the second class, when php dbg $this always shows the value of $this in the scope of the second class (where the debugger stopped).

Note: i'm using $this as an example, but it could just as well be any local variable to a function, not just class instances.

Question, is this an intended behaviour or is it a limitation of php, php dbg or eclipse/php eclipse ?
View user's profileFind all posts by dominiccSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Quote:
change and all the variables are still shown relating to the scope where the debugger stopped


It's actually not debugger-dependant. Debugger supports scope switching, it's clear, but the IDE may not support it. What IDE are you using?

In PhpED it's works exactly as you're expecting it to work. Why not to try?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 18 Aug 2006
Posts: 10
Reply with quote
thanks for clearing that up. I'm using eclipse 3.1 + phpeclipse 1.1.9 (cvs). Eclipse 3.2 doesn't work with phpdbg, the debugger stops correctly but the ide doesn't open the file and show the breakpoint, and the variables view is empty in it too so I have to keep using eclipse 3.1.

I could give it a try sure, but it'd be hard to convince my manager to buy me a copy especially as we got licenses for zend studio and then moved to eclipse...

It's a shame your focus is with phped as eclipse is really nice and the php eclipse guys could do with some help when it comes to integrating your debugger but with the financial motivation to support phped and not eclipse I could understand why you might not want to do so. Still, it would be cool for you to take a look at php eclipse and fix up the debugger support if you get the chance. I'm sure there'd be a market for selling php dbg 3.x to eclipse users though, we'd buy 5 licenses right away!
View user's profileFind all posts by dominiccSend private message
context/scope switching doesn't update variable view
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