I’m trying to use a debugger to view the internal functioning of a program. It has
14 files total. I tried to use Wing debugger, which seems pretty nice, but with heavy reliance on
external modules, the stack frames get lost in the weeds. Is there a debugger I can set to limit
stepping hits to only files that are part of the project?
Personally i do not find debuggers useful for learning a code base.
I tend to add logging to the code to show me the interesting flow and variable values.
If you do want to use a debugger then set break points on interesting function to cut down on the stepping.
Beware of the trap of single stepping 100s or 1000s of lines of code.
It takes a long time and you tend to lose focus.
Hi @whiffee,
You can skip modules you don’t want to step into by adding a skip
argument to Pdb
.
For example, define and use the following function instead of builtins.breakpoint
:
import sys
from pdb import Pdb
def breakpoint(skip=None):
pdb = Pdb(skip=skip)
pdb.set_trace(sys._getframe().f_back)
Usage:
breakpoint(skip={
'warnings', 'textwrap', "<your-module>", ...
})
See also:
In relation to the above post, seeing that you are a Wing user (as am I), you can put the Debug tools to good use:
Step Into F7
Step Over Instruction Ctrl+F6
Step Over Statement F6
Step Out F8
… to skip single stepping any module.
Given the tools that Wing provide, I see no need for any other Debugger.
@whiffee Which Version of Wing are you running with?