Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I'm stopped at a breakpoint in Workbench, say at one of the y = ... lines in:

foo[a_] := Block[{y}, 
    If[Sin[a] > 0,
        y = -1,
        y = 1

How can I find out what Sin[a] is? Or more generally do some other evaluation using the current state of my program?

share|improve this question
up vote 12 down vote accepted

You can enter arbitrary expressions in the Expressions debugging view:

screenshot of Wolfram Workbench debugger

The function VariableValue must be used in such expressions in order to access any active variables.

If the Expressions view is not visible, you can open it from the Workbench main menu using Window / Show View... / Expressions.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.