Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse PDT debugging web application: evaluating expressions in a console

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"

like image 357
dreftymac Avatar asked Apr 02 '10 21:04

dreftymac


1 Answers

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.

like image 104
stepmoz Avatar answered Sep 18 '22 20:09

stepmoz