If I use the debugger, most of the times I just want to see what the interpreter does in my code. I want to step over all code of the framework and libraries I use.
AFAIK this is called Black Boxing.
How can I do this with Python ipdb or an other Python debugger?
Imagine this:
I use a orm framework which I trust, and don't want to debug.
cut_hair_method(orm_object.user)
The method cut_hair_method()
is mine, and I want to debug it.
The orm_object
is from the framework I use. The debugger will step into the orm-code and do some special things, which I don't care about. I have no way to tell the debugger: Don't jump into the orm code!
Update
For my case it would be very easy to decide which code should be in the black box and which code not: Code in $VIRTUAL_ENV/src/
is not in the black box, all other code is. Except I explicitly tell the debugger something else.
Update2
I have the name "Black Boxing" from this article: https://hacks.mozilla.org/2013/08/new-features-of-firefox-developer-tools-episode-25/
r
to return from the ORM call. It is really not that hard.s
intoorm_object.user
,r
step out again and straight intocut_hair_method()
. – Setscrewstep into
vsstep over
depending on what current point is. Perhaps it by module, perhaps something else. Most debuggers are scriptable, attach a test to current frame after step and finish/return if you don't like it. – Childbed