在python中获取pdb风格的调用者信息
假设我有以下方法(在类或模块中,我认为这并不重要):
def someMethod():
pass
我想在调用此方法时访问调用者的状态。
traceback.extract_stack
只是给我一些有关调用堆栈的字符串。
我想要类似 pdb
的东西,在其中我可以在 someMethod()
中设置断点,然后输入“u”进入调用堆栈,然后检查那么系统。
Let's say I have the following method (in a class or a module, I don't think it matters):
def someMethod():
pass
I'd like to access the caller's state at the time this method is called.
traceback.extract_stack
just gives me some strings about the call stack.
I'd like something like pdb
in which I can set a breakpoint in someMethod()
and then type 'u' to go up the call stack and then examine the state of the system then.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想到了:
I figured it out: