[issue14743] on terminating, Pdb debugs itself

2019-03-15 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14743] on terminating, Pdb debugs itself

2014-07-04 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we have a formal patch review please, but note the similar patch on #14788.

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14743
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14743] on terminating, Pdb debugs itself

2012-12-05 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14743
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14743] on terminating, Pdb debugs itself

2012-11-24 Thread Xavier de Gaye

Xavier de Gaye added the comment:

See also how this is fixed at
http://code.google.com/p/pdb-clone/source/detail?r=625d61e3494d3b7e2a3e8578ddd2f204e21f1800

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14743
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14743] on terminating, Pdb debugs itself

2012-05-11 Thread Xavier de Gaye

Xavier de Gaye xdeg...@gmail.com added the comment:

The previous patch only fixed the problem when the debugger is started
from its main function. Uploaded new patch
pdb_botframe_default_3.patch that fixes pdb.main and the pdb.run*
function.

This patch also corrects pdb.runcall(): in the following session, the
3.1 debugger starts the debugging session at the second line of foo()
and not at the --Call-- event. A test case for this problem is also
included in the patch.


===   main.py   =
import pdb, sys
print(sys.version)

def foo():
pass

pdb.runcall(foo)
=
$ python3.1 main.py
3.1.2 (r312:79147, Apr  4 2010, 17:46:48) 
[GCC 4.3.2]
 /path_to/main.py(5)foo()
- pass
(Pdb) quit
=

--
Added file: http://bugs.python.org/file25535/pdb_botframe_default_3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14743
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14743] on terminating, Pdb debugs itself

2012-05-08 Thread Xavier de Gaye

Xavier de Gaye xdeg...@gmail.com added the comment:

Uploaded a new patch, pdb_botframe_default_2.patch (that applies to
the current tip of the default branch) with:

* a correction to the initial change made to fix sigint_handler()

* the two test cases

--
Added file: http://bugs.python.org/file25493/pdb_botframe_default_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14743
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14743] on terminating, Pdb debugs itself

2012-05-07 Thread Xavier de Gaye

New submission from Xavier de Gaye xdeg...@gmail.com:

All the problems raised in this issue are caused by self.botframe
being set in a Pdb frame.

In the following pdb session run with python 3.2.2, the first two
frames in the printed stack are Pdb frames, this is wrong. And the
second step command steps incorrectly into the exec() frame that is
called by the Bdb run() method. What prevents the third step command
to step into the run() frame, is that this frame does not have a trace
function setup initially.
===   foo.py=
i = 1
=
$ python3 -m pdb foo.py
 path_to/foo.py(1)module()
- i = 1
(Pdb) import sys; print(sys.version)
3.2.2 (default, Dec 27 2011, 17:35:55) 
[GCC 4.3.2]
(Pdb) where
  /usr/local/lib/python3.2/bdb.py(392)run()
- exec(cmd, globals, locals)
  string(1)module()
 path_to/foo.py(1)module()
- i = 1
(Pdb) step
--Return--
 path_to/foo.py(1)module()-None
- i = 1
(Pdb) step
--Return--
 string(1)module()-None
(Pdb) step
The program finished and will be restarted
 path_to/foo.py(1)module()
- i = 1
(Pdb) quit
=


In the following pdb session run with python built from the default
branch (i.e. after issue 13183 has been fixed) the third step command
steps into the run() method of Bdb and the backtrace printed after the
quit command shows duplicate entries. Pdb is trying to debug itself !
Pdb steps in the run() method because after the fix in issue 13183,
Pdb knows now how to step when returning into the caller frame with no
trace function.
===   foo.py=
i = 1
=
$ python -m pdb foo.py 
 path_to/foo.py(1)module()
- i = 1
(Pdb) step
--Return--
 path_to/foo.py(1)module()-None
- i = 1
(Pdb) step
--Return--
 string(1)module()-None
(Pdb) step
 path_to/cpython/Lib/bdb.py(409)run()
- self.quitting = True
(Pdb) quit
Traceback (most recent call last):
  File path_to/cpython/Lib/pdb.py, line 1651, in main
pdb._runscript(mainpyfile)
  File path_to/cpython/Lib/pdb.py, line 1532, in _runscript
self.run(statement)
  File path_to/cpython/Lib/bdb.py, line 409, in run
self.quitting = True
  File path_to/cpython/Lib/bdb.py, line 409, in run
self.quitting = True
  File path_to/cpython/Lib/bdb.py, line 47, in trace_dispatch
return self.dispatch_line(frame)
  File path_to/cpython/Lib/bdb.py, line 66, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
 path_to/cpython/Lib/bdb.py(66)dispatch_line()
- if self.quitting: raise BdbQuit
(Pdb) quit
Post mortem debugger finished. The foo.py will be restarted
 path_to/foo.py(1)module()
- i = 1
(Pdb) quit
=


In the following pdb session run with python 3.2.2, the session is
interrupted with Ctl-C. The same problems occur as in the previous
case.
=
import time
i = 1
while i:
time.sleep(.100)
i = 0
=
$ python3 -m pdb foo.py
 path_to/foo.py(1)module()
- import time
(Pdb) import sys; print(sys.version)
3.2.2 (default, Dec 27 2011, 17:35:55) 
[GCC 4.3.2]
(Pdb) continue
^C
Program interrupted. (Use 'cont' to resume).
 path_to/foo.py(3)module()
- while i:
(Pdb) !i=0
(Pdb) step
 path_to/foo.py(5)module()
- i = 0
(Pdb) step
--Return--
 path_to/foo.py(5)module()-None
- i = 0
(Pdb) step
--Return--
 string(1)module()-None
(Pdb) step
 /usr/local/lib/python3.2/bdb.py(396)run()
- self.quitting = True
(Pdb) quit
Traceback (most recent call last):
  File /usr/local/lib/python3.2/pdb.py, line 1556, in main
pdb._runscript(mainpyfile)
  File /usr/local/lib/python3.2/pdb.py, line 1437, in _runscript
self.run(statement)
  File /usr/local/lib/python3.2/bdb.py, line 396, in run
self.quitting = True
  File /usr/local/lib/python3.2/bdb.py, line 396, in run
self.quitting = True
  File /usr/local/lib/python3.2/bdb.py, line 46, in trace_dispatch
return self.dispatch_line(frame)
  File /usr/local/lib/python3.2/bdb.py, line 65, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
 /usr/local/lib/python3.2/bdb.py(65)dispatch_line()
- if self.quitting: raise BdbQuit
(Pdb) quit
Post mortem debugger finished. The foo.py will be restarted
 path_to/foo.py(1)module()
- import time
(Pdb) quit
=


The attached patch fixes all those problems. The patch applies to the
default branch.

--
components: Library (Lib)
files: pdb_botframe_default.patch
keywords: patch
messages: 160166
nosy: xdegaye
priority: normal
severity: normal
status: open
title: on terminating, Pdb debugs itself
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added 

[issue14743] on terminating, Pdb debugs itself

2012-05-07 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
keywords: +needs review
nosy: +georg.brandl
stage:  - test needed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14743
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com