Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3f94089a
Kaydet (Commit)
3f94089a
authored
Tem 30, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#5294: Fix the behavior of pdb "continue" command when called in the top-level debugged frame.
üst
d72e043b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
3 deletions
+52
-3
bdb.py
Lib/bdb.py
+7
-3
test_pdb.py
Lib/test/test_pdb.py
+42
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/bdb.py
Dosyayı görüntüle @
3f94089a
...
@@ -109,6 +109,8 @@ class Bdb:
...
@@ -109,6 +109,8 @@ class Bdb:
self
.
is_skipped_module
(
frame
.
f_globals
.
get
(
'__name__'
)):
self
.
is_skipped_module
(
frame
.
f_globals
.
get
(
'__name__'
)):
return
False
return
False
if
frame
is
self
.
stopframe
:
if
frame
is
self
.
stopframe
:
if
self
.
stoplineno
==
-
1
:
return
False
return
frame
.
f_lineno
>=
self
.
stoplineno
return
frame
.
f_lineno
>=
self
.
stoplineno
while
frame
is
not
None
and
frame
is
not
self
.
stopframe
:
while
frame
is
not
None
and
frame
is
not
self
.
stopframe
:
if
frame
is
self
.
botframe
:
if
frame
is
self
.
botframe
:
...
@@ -165,10 +167,12 @@ class Bdb:
...
@@ -165,10 +167,12 @@ class Bdb:
but only if we are to stop at or just below this level."""
but only if we are to stop at or just below this level."""
pass
pass
def
_set_stopinfo
(
self
,
stopframe
,
returnframe
,
stoplineno
=
-
1
):
def
_set_stopinfo
(
self
,
stopframe
,
returnframe
,
stoplineno
=
0
):
self
.
stopframe
=
stopframe
self
.
stopframe
=
stopframe
self
.
returnframe
=
returnframe
self
.
returnframe
=
returnframe
self
.
quitting
=
0
self
.
quitting
=
0
# stoplineno >= 0 means: stop at line >= the stoplineno
# stoplineno -1 means: don't stop at all
self
.
stoplineno
=
stoplineno
self
.
stoplineno
=
stoplineno
# Derived classes and clients can call the following methods
# Derived classes and clients can call the following methods
...
@@ -184,7 +188,7 @@ class Bdb:
...
@@ -184,7 +188,7 @@ class Bdb:
def
set_step
(
self
):
def
set_step
(
self
):
"""Stop after one line of code."""
"""Stop after one line of code."""
self
.
_set_stopinfo
(
None
,
None
)
self
.
_set_stopinfo
(
None
,
None
)
def
set_next
(
self
,
frame
):
def
set_next
(
self
,
frame
):
"""Stop on the next line in or below the given frame."""
"""Stop on the next line in or below the given frame."""
...
@@ -211,7 +215,7 @@ class Bdb:
...
@@ -211,7 +215,7 @@ class Bdb:
def
set_continue
(
self
):
def
set_continue
(
self
):
# Don't stop except at breakpoints or when finished
# Don't stop except at breakpoints or when finished
self
.
_set_stopinfo
(
self
.
botframe
,
None
)
self
.
_set_stopinfo
(
self
.
botframe
,
None
,
-
1
)
if
not
self
.
breaks
:
if
not
self
.
breaks
:
# no breakpoints; run without debugger overhead
# no breakpoints; run without debugger overhead
sys
.
settrace
(
None
)
sys
.
settrace
(
None
)
...
...
Lib/test/test_pdb.py
Dosyayı görüntüle @
3f94089a
...
@@ -122,6 +122,48 @@ def test_pdb_skip_modules_with_callback():
...
@@ -122,6 +122,48 @@ def test_pdb_skip_modules_with_callback():
"""
"""
def
test_pdb_continue_in_bottomframe
():
"""Test that "continue" and "next" work properly in bottom frame (issue #5294).
>>> def test_function():
... import pdb, sys; inst = pdb.Pdb()
... inst.set_trace()
... inst.botframe = sys._getframe() # hackery to get the right botframe
... print(1)
... print(2)
... print(3)
... print(4)
>>> with PdbTestInput([
... 'next',
... 'break 7',
... 'continue',
... 'next',
... 'continue',
... 'continue',
... ]):
... test_function()
> <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(4)test_function()
-> inst.botframe = sys._getframe() # hackery to get the right botframe
(Pdb) next
> <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(5)test_function()
-> print(1)
(Pdb) break 7
Breakpoint 1 at <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>:7
(Pdb) continue
1
2
> <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(7)test_function()
-> print(3)
(Pdb) next
3
> <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(8)test_function()
-> print(4)
(Pdb) continue
4
"""
def
pdb_invoke
(
method
,
arg
):
def
pdb_invoke
(
method
,
arg
):
"""Run pdb.method(arg)."""
"""Run pdb.method(arg)."""
import
pdb
;
getattr
(
pdb
,
method
)(
arg
)
import
pdb
;
getattr
(
pdb
,
method
)(
arg
)
...
...
Misc/NEWS
Dosyayı görüntüle @
3f94089a
...
@@ -475,6 +475,9 @@ C-API
...
@@ -475,6 +475,9 @@ C-API
Library
Library
-------
-------
- Issue #5294: Fix the behavior of pdb's "continue" command when called
in the top-level debugged frame.
- Issue #5727: Restore the ability to use readline when calling into pdb
- Issue #5727: Restore the ability to use readline when calling into pdb
in doctests.
in doctests.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment