When an Error Occurs...

Click the More information icon () to the left of an error message and select Show Stack Trace to get a stack trace showing where the error occurred:

In Program Code...

Insert Print[Stack[]] into program code at the point where you want to see a stack trace:

Out[2]=

Use Stack[_] to see complete expressions:

Out[3]=

Notes

Wrap an expression with Trace to see the steps in its evaluation:
In[4]:=
Click for copyable input
Out[4]=