As I know, %debug magic can do debug within one cell.
%debug magic
However, I have function calls across multiple cells.
For example,
In[1]:
After you get an error, in the next cell just run %debug and that's it.
%debug