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:

Use Stack[_] to see complete expressions:

Notes

Wrap an expression with Trace to see the steps in its evaluation: