ipdb 如何将 python 调试器带到调用第三方代码的框架
ipdb how to bring the python debugger up to the frame which called the third-party code
在我的 python 代码中,我有几个级别的调用堆栈,如下所示:
f1:user_func1
f2:**user_func2**
f3:third_party_func1
f4:third_party_func2
f5:exception happens here.
第三方代码某处出现异常(帧f5)。我使用 ipdb 转到发生异常的帧,并使用 up 命令 "u" 将调试器带回我的代码调用第三方代码的帧(帧 f2)。
有时候第三方代码的关卡很多,需要按很多次u。有没有办法快速将调试器带到你调用第三方代码的代码框架中?
来自 ipdb 命令行:
ipdb> help up
u(p) [count]
Move the current frame count (default one) levels up in the
stack trace (to an older frame).
在我的 python 代码中,我有几个级别的调用堆栈,如下所示:
f1:user_func1
f2:**user_func2**
f3:third_party_func1
f4:third_party_func2
f5:exception happens here.
第三方代码某处出现异常(帧f5)。我使用 ipdb 转到发生异常的帧,并使用 up 命令 "u" 将调试器带回我的代码调用第三方代码的帧(帧 f2)。
有时候第三方代码的关卡很多,需要按很多次u。有没有办法快速将调试器带到你调用第三方代码的代码框架中?
来自 ipdb 命令行:
ipdb> help up
u(p) [count]
Move the current frame count (default one) levels up in the
stack trace (to an older frame).