I would like to save the commands for the breakpoint at .pdbrc, something like:
b 81
commands 1
pp foo.attr1
pp foo.attr2
end
b 108
commands 2
pp bar.attr1
pp bar.attr2
end
This automates the setup of the environment for the debugging session. However, this does not work with python -m pdb script.py, because the commands 1pdb prompt is launched on the line and requests commands for the first breakpoint, ignoring what I wrote in .pdbrc; In addition, it calls NameErrorafter entering the type endat the pdb prompt because foo.attr1, foo.attr2and even end. The same thing happens with the rest of the breakpoints, so I end up with their settings, but not their commands.
What will be the correct way? Is it possible?
source
share