You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2012-05-12.10:07:36.784>labels= ['type-bug', 'library']
title='Pdb debugs itself after ^C and a breakpoint is set anywhere'updated_at=<Date2019-04-19.10:51:51.502>user='https://github.com/xdegaye'
When a breakpoint is set anywhere (in which case the global system's
trace function is set), interrupting the debuggee causes Pdb to stop
into its own code. See the following pdb session run with python on
the current head of the default branch from the repo.
$ python -m pdb main.py
>/path_to/main.py(1)<module>()
-> import time
(Pdb) import sys; print(sys.version)
3.3.0a3+ (default:4e9680570be8, May 11 2012, 12:09:15)
[GCC 4.3.2]
(Pdb) break bar
Breakpoint 1 at /path_to/main.py:2
(Pdb) continue>/path_to/main.py(3)bar()
-> i = 1
(Pdb) continue
^C
Program interrupted. (Use 'cont' to resume).
--Call--
>/home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(212)set_trace()
-> def set_trace(self, frame=None):
(Pdb) where
/home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(405)run()
-> exec(cmd, globals, locals)
<string>(1)<module>()
/path_to/main.py(7)<module>()
->bar()
/path_to/main.py(5)bar()
-> time.sleep(.100)
/home/xavier/src/cpython/cpython-hg-default/Lib/pdb.py(196)sigint_handler()
-> self.set_trace(frame)
>/home/xavier/src/cpython/cpython-hg-default/Lib/bdb.py(212)set_trace()
-> def set_trace(self, frame=None):
(Pdb) quit
=================================================
The attached patch fixes the problem and includes a test case. This
fix is the same as the one proposed at bpo-14743 to fix another
problem, except that the set_step call is moved at the end of the
sigint_handler method for the sake of robustness.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: