7

I want to be able to be able to save or insert programmatically pdb commands, here is a example:

(Pdb) b doc/filename.py:365 Breakpoint 1 at doc/filename.py:365 (Pdb) commands # command to be applied to all breaks (com) silent # makes it not print the break message (com) print "Here is my breakpoint!" (com) c # continues without stopping on break 

So here I am creating a command that will happen on my breakpoint where I will print the text "Here is my breakpoint!" and then continue.

Now my problem is that I have to write all that manually every time I want to have those prints (or any kind of command I want to add). I would like to have a more automated way of adding this commands, maybe saving them in some kind of .pdbrc file or been able to add them with the pdb.set_trace() command as code so I can just paste it instead.

1 Answer 1

1

You can add a .pdbrc file in your home or the current directory for that. Here is an example http://code.activestate.com/recipes/498182-sane-tab-completion-in-pdb/

Sign up to request clarification or add additional context in comments.

1 Comment

Taking a look at this, now, for the autocomplete I highly recommend ipdb (ipython pdb), which does that and a bunch of other stuff :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.