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

1

11

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?

Annals answered 5/8, 2016 at 14:1 Comment(0)
R
13

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).
Recife answered 1/9, 2016 at 13:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.