NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Constants during debugging
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
Hi,
how to see the value of the constants (defined with define()) during the debug session?
View user's profileFind all posts by blackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
You may use either Watch or Immediate windows.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
it seems not possible to add a costant to the watch window
in immediate I don't find them too
View user's profileFind all posts by blackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Watch window always contains an empty line at the bottom. It's where you can click and edit (F2) an expression to evaluate. Just enter constant name there and the IDE will re-evaluate its value each time it stops on a breakpoint or on a next debugger step.
Immediate window is rather a simple editor where you can enter an expression and press Enter to evaluate it. Of course, it works while the IDE is in debug session.

If in stead of a particular constant you need to see all defined constants, just put get_defined_constants() function call in the Watch or Immediate. It's not that hard, is it? Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
yes ddmitrie; maybe you could add the item "add (CONSTANT_NAME) to watch list" in the contextual help for the constants too; now there is for the normal variables.

Isn't possible to have the value of the constants in the "Locals" view or better "Globals" during the debug?
View user's profileFind all posts by blackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
maybe you could add the item "add (CONSTANT_NAME)" to watch list

Instead of variables, it's hardly possible to distinguish constant names in the source code.

Quote:
Isn't possible to have the value of the constants in the "Locals" view or better "Globals" during the debug?

Right, it's possible to have them in the Globals, but would make very little sense:
a) constants are not variables and should not be mixed together Smile
b) they would waste a lot of space. Even without user-defined constants, there are too many extension-defined ones.
c) network traffic would increase dramatically, it's important for remote debugging.
On the other hand, it could be made with an option to turn them off Cool
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 28 Nov 2005
Posts: 144
Reply with quote
maybe you could show just constants defined from the user with the function "define()"; it should be easy to detect them

about other:

a) yes sure, you could create a node "Constants" and show them inside
b) I would suggest to show just user defined constants
c) yes sure Smile I hope you gzip it Smile
View user's profileFind all posts by blackSend private message


Joined: 21 Jun 2006
Posts: 5
Location: UK
Reply with quote
Hi,

I’ve just bumped into the same problem as black: ddmitrie`s tip with get_defined_constants() works well BUT it is quite hard to comfortably navigate through the jungle of all defined constants instead just yours ones. As far as I can see there was no further comment of ddmitrie on that issue - is it possible to have this future in a near release? (Maybe my post is a feature request already? Very Happy )

Cheers,
Szymon Bakowski
View user's profileFind all posts by gpsoftSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Yes, there is a jungle but how would php distinguish your constants from other' ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
highlighter has no relation to debugger Smile and they are working on the different sides.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Jun 2006
Posts: 5
Location: UK
Reply with quote
ddmitrie wrote:
highlighter has no relation to debugger Smile and they are working on the different sides.


Well, in that context it has because it makes debugging much easier when we know which constants have been defined by us. So there is a way to distinguish it....
View user's profileFind all posts by gpsoftSend private message
Constants during debugging
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