Commands for a breakpoint in .pdbrc

  • Thread starter Pablo Torres N.
  • Start date
P

Pablo Torres N.

Hi all,

I'd like to save the commands for a breakpoint in a .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 would automate setting the environment for the debugging session.
However, this does not work with 'python -m pdb script.py', because at
the line 'commands 1', the pdb prompt starts and asks me for the
commands for the first breakpoint, ignoring what I wrote in .pdbrc;
further, it raises a NameError after I type 'end' at the pdb prompt,
because of 'foo.attr1', 'foo.attr2' and even 'end'. The same happens
for the rest of the breakpoints, so I end up with them set but not
their commands.

What would be the correct way to do this? Is it even possible?


Thanks a lot,
Pablo Torres N.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,113
Latest member
Vinay KumarNevatia
Top