views:

42

answers:

1

When using Eclipse PDT with XDebug to debug a PHP web application, is there any way to open up a console window that will allow me to type in and see the value of arbitrary expressions in the current scope?

This would seem like an obvious element of the debugging environment, and I may be missing something, but the only thing resembling a console says "no consoles to display at this time"

+3  A: 

Here is the trick, start your PHP debugging session as normal and then when you reach a break-point, or while you are stepping through the code, follow these steps:

  • goto window -> show view
  • choose 'expressions'
  • when the expressions subwindow opens, click on the icon "create new watch expression"
    • [the icon looks like a little algebra equation x+y = ?]
  • enter any arbitrary expression in the dialog box that opens up
  • keep following the previous two steps until you have all the expressions you want to watch

From that point you can continue stepping through the code, add or remove expressions and so forth.

stepmoz
Note, you can also highlight a variable in the source file and right click, choose "watch" if you just want to watch a specific variable instead of a typed-in expression.
dreftymac