Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipdb how to bring the python debugger up to the frame which called the third-party code

In my python code, I have several levels of call stacks like this:

f1:user_func1 
  f2:**user_func2**
    f3:third_party_func1
      f4:third_party_func2
          f5:exception happens here. 

An exception happens somewhere in the third-party code (frame f5). I use ipdb to go the frame where the exception happened, and use the up command "u" to bring the debugger back to the frame where my code calls the third party code (frame f2).

Sometimes there are many level in the third-party code so I need to press u many times. Is there way to quickly bring the debugger to the frame of your code that calls the third-party code?

like image 683
motam79 Avatar asked Aug 05 '16 14:08

motam79


1 Answers

From ipdb command line:

ipdb> help up
u(p) [count]
    Move the current frame count (default one) levels up in the
    stack trace (to an older frame).
like image 195
Kleag Avatar answered Oct 16 '22 17:10

Kleag