This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "continue" in .pdbrc has no effect
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: coolheads, georg.brandl, isandler, jaraco, terry.reedy
Priority: normal Keywords: easy

Created on 2006-02-22 22:13 by coolheads, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg60872 - (view) Author: Coolheads Consulting (coolheads) Date: 2006-02-22 22:13
I'm using Python 2.4.2 under Debian Woody; uname -a:
Linux bruno 2.4.23 i686 GNU/Linux

The documentation for pdb says that commands in .pdbrc
will be executed just as if they were typed in at the
pdb prompt.  However, "c", "cont", and "continue" have
no effect.  It would be nice if this would work.

I discovered this problem because I need to be able to
call Python scripts from within a Makefile, and it is
convenient, when one of them goes awry (say, because of
a key error exception), to already be in the debugger
when such exceptions are raised.  However, I can't call
a Python script with the debugger from a makefile because
execution always stops at the beginning of the script,
waiting for a "continue" to be typed in at the prompt.
 I thought I could solve the problem with a "continue"
in the .pdbrc in the local directory.  However, every way I
can think of to say "continue", including aliasing it,
has no effect in the .pdbrc.  Is there another way to
accomplish what I'm trying to do?

Steve Newcomb
srn@coolheads.com
msg60873 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2006-03-06 02:00
Logged In: YES 
user_id=593130

I wonder whether the .pdbrc is being read and executed 
when you think it is.  Is the problem actually specific 
to 'continue'?  If you put 'list' in the file, do you get 
a listing?

It might help if you gave the exact command line you use 
to start the Python script.

I don't know if this is really a bug.  You might get 
answers about 'another way' on python-
list/comp.lang.python.  (I don't know ;-)
msg60874 - (view) Author: Ilya Sandler (isandler) Date: 2006-06-18 21:09
Logged In: YES 
user_id=971153

The problem is limited to step/next/continue...

"l", "break", etc do work.

As far as I can tell the following is happening

1. .pdbrc is read (but not executed!) on pdb startup

2. it's executed when pdb first time enters the interaction()

3. if rc file contains, "continue", then do_continue() IS
executed but it has no effect, because pdb's interaction()
does not return and simply proceeds with user's input..

(do_continue()/do_next()/do_step() work by setting up a
stopping condition and returning to interpreter)


The problem can be fixed by having execRcLines check every
command's return status and returning as soon as any command
returns 1.. Of course, the rest of rclines would need to be
executed later...

For the record, gdb's .gdbinit files do allow commands like
"run"/"continue"/etc

If there is any interest in this fix, I can submit a patch

msg99737 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2010-02-22 14:35
I encountered this as well.

At the very least, the documentation needs to describe that 'continue' is the only command which has no effect in .pdbrc.

I'd prefer a patch that enables continue in pdbrc.
msg99738 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2010-02-22 14:37
This problem also exists in Python 3.1.1. Because I have no reason to believe it has been fixed, I'm also tagging this in Python 3.2 and 2.7.
msg112047 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-30 08:30
Thanks for the patience, this is now fixed in r83262.

I also added a -c option so that you can give the "continue" on the command line, not put it in the .pdbrc file.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42940
2010-07-30 08:30:08georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg112047

resolution: fixed
2010-02-22 14:37:29jaracosetmessages: + msg99738
versions: + Python 3.1, Python 2.7, Python 3.2
2010-02-22 14:35:08jaracosetnosy: + jaraco
messages: + msg99737
2009-04-22 14:35:30ajaksu2setkeywords: + easy
2009-03-21 00:36:44ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6, - Python 2.4
2006-02-22 22:13:17coolheadscreate