Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue14751] Pdb does not stop at a breakpoint

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

May 8, 2012, 6:00 AM

Post #1 of 2 (65 views)
Permalink
[issue14751] Pdb does not stop at a breakpoint

New submission from Xavier de Gaye <xdegaye [at] gmail>:

When a breakpoint is set in one of the frames of the frame stack, Pdb
may not stop at that breakpoint when the frame does not have a trace
function. This problem is closely related to issue 13183 and issue
14728. The following scenario demonstrates this problem.


==== main.py ================================
import bar

def foo():
bar.bar()
x = 1

foo()
==== bar.py ==================================
def bar():
pass
=================================================
$ python3 -m pdb main.py
> /path_to/main.py(1)<module>()
-> import bar
(Pdb) import sys; print(sys.version)
3.2.2 (default, Dec 27 2011, 17:35:55)
[GCC 4.3.2]
(Pdb) break bar.bar
Breakpoint 1 at /path_to/bar.py:1
(Pdb) continue
> /path_to/bar.py(2)bar()
-> pass
(Pdb) break main.py:5
Breakpoint 2 at /path_to/main.py:5
(Pdb) continue
The program finished and will be restarted
> /path_to/main.py(1)<module>()
-> import bar
(Pdb) quit
=================================================


The attached patch fixes this problem. A test case is included in the
patch. The patch is made against the proposed fix of issue 14728 (i.e.
assumes this patch is applied), the reason being that self._curframe
must be correctly set. Actually this issue and issue 14728 should
probably be merged.

Note that the trace function does not need anymore to be set in all
the frames of the frame stack in set_trace(), so setting the trace
function has been removed from the while loop.

----------
components: Library (Lib)
files: pdb_default.patch
keywords: patch
messages: 160202
nosy: xdegaye
priority: normal
severity: normal
status: open
title: Pdb does not stop at a breakpoint
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25494/pdb_default.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14751>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 13, 2012, 8:48 AM

Post #2 of 2 (65 views)
Permalink
[issue14751] Pdb does not stop at a breakpoint [In reply to]

Xavier de Gaye <xdegaye [at] gmail> added the comment:

Uploaded pdb_default_2.patch that corrects the initial patch: the
trace function must be set in all frames whose co_filename is the
breakpoint file name and not just the first frame of this set.

----------
Added file: http://bugs.python.org/file25561/pdb_default_2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue14751>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.