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
a92e81bf
Kaydet (Commit)
a92e81bf
authored
Nis 20, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #8437: Fix test_gdb failures, patch written by Dave Malcolm
üst
e593fad8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
15 deletions
+36
-15
test_gdb.py
Lib/test/test_gdb.py
+19
-0
NEWS
Misc/NEWS
+2
-0
libpython.py
Tools/gdb/libpython.py
+15
-15
No files found.
Lib/test/test_gdb.py
Dosyayı görüntüle @
a92e81bf
...
@@ -31,6 +31,19 @@ gdbpy_version, _ = p.communicate()
...
@@ -31,6 +31,19 @@ gdbpy_version, _ = p.communicate()
if
gdbpy_version
==
''
:
if
gdbpy_version
==
''
:
raise
unittest
.
SkipTest
(
"gdb not built with embedded python support"
)
raise
unittest
.
SkipTest
(
"gdb not built with embedded python support"
)
def
gdb_has_frame_select
():
# Does this build of gdb have gdb.Frame.select ?
cmd
=
"--eval-command=python print(dir(gdb.Frame))"
p
=
subprocess
.
Popen
([
"gdb"
,
"--batch"
,
cmd
],
stdout
=
subprocess
.
PIPE
)
stdout
,
_
=
p
.
communicate
()
m
=
re
.
match
(
r'.*\[(.*)\].*'
,
stdout
)
if
not
m
:
raise
unittest
.
SkipTest
(
"Unable to parse output from gdb.Frame.select test"
)
gdb_frame_dir
=
m
.
group
(
1
)
.
split
(
', '
)
return
"'select'"
in
gdb_frame_dir
HAS_PYUP_PYDOWN
=
gdb_has_frame_select
()
class
DebuggerTests
(
unittest
.
TestCase
):
class
DebuggerTests
(
unittest
.
TestCase
):
...
@@ -569,6 +582,7 @@ class PyListTests(DebuggerTests):
...
@@ -569,6 +582,7 @@ class PyListTests(DebuggerTests):
bt
)
bt
)
class
StackNavigationTests
(
DebuggerTests
):
class
StackNavigationTests
(
DebuggerTests
):
@unittest.skipUnless
(
HAS_PYUP_PYDOWN
,
"test requires py-up/py-down commands"
)
def
test_pyup_command
(
self
):
def
test_pyup_command
(
self
):
'Verify that the "py-up" command works'
'Verify that the "py-up" command works'
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
...
@@ -579,6 +593,7 @@ class StackNavigationTests(DebuggerTests):
...
@@ -579,6 +593,7 @@ class StackNavigationTests(DebuggerTests):
baz\(a, b, c\)
baz\(a, b, c\)
$'''
)
$'''
)
@unittest.skipUnless
(
HAS_PYUP_PYDOWN
,
"test requires py-up/py-down commands"
)
def
test_down_at_bottom
(
self
):
def
test_down_at_bottom
(
self
):
'Verify handling of "py-down" at the bottom of the stack'
'Verify handling of "py-down" at the bottom of the stack'
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
...
@@ -586,6 +601,7 @@ $''')
...
@@ -586,6 +601,7 @@ $''')
self
.
assertEndsWith
(
bt
,
self
.
assertEndsWith
(
bt
,
'Unable to find a newer python frame
\n
'
)
'Unable to find a newer python frame
\n
'
)
@unittest.skipUnless
(
HAS_PYUP_PYDOWN
,
"test requires py-up/py-down commands"
)
def
test_up_at_top
(
self
):
def
test_up_at_top
(
self
):
'Verify handling of "py-up" at the top of the stack'
'Verify handling of "py-up" at the top of the stack'
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
...
@@ -593,6 +609,7 @@ $''')
...
@@ -593,6 +609,7 @@ $''')
self
.
assertEndsWith
(
bt
,
self
.
assertEndsWith
(
bt
,
'Unable to find an older python frame
\n
'
)
'Unable to find an older python frame
\n
'
)
@unittest.skipUnless
(
HAS_PYUP_PYDOWN
,
"test requires py-up/py-down commands"
)
def
test_up_then_down
(
self
):
def
test_up_then_down
(
self
):
'Verify "py-up" followed by "py-down"'
'Verify "py-up" followed by "py-down"'
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
...
@@ -628,6 +645,7 @@ class PyPrintTests(DebuggerTests):
...
@@ -628,6 +645,7 @@ class PyPrintTests(DebuggerTests):
self
.
assertMultilineMatches
(
bt
,
self
.
assertMultilineMatches
(
bt
,
r".*\nlocal 'args' = \(1, 2, 3\)\n.*"
)
r".*\nlocal 'args' = \(1, 2, 3\)\n.*"
)
@unittest.skipUnless
(
HAS_PYUP_PYDOWN
,
"test requires py-up/py-down commands"
)
def
test_print_after_up
(
self
):
def
test_print_after_up
(
self
):
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
cmds_after_breakpoint
=
[
'py-up'
,
'py-print c'
,
'py-print b'
,
'py-print a'
])
cmds_after_breakpoint
=
[
'py-up'
,
'py-print c'
,
'py-print b'
,
'py-print a'
])
...
@@ -653,6 +671,7 @@ class PyLocalsTests(DebuggerTests):
...
@@ -653,6 +671,7 @@ class PyLocalsTests(DebuggerTests):
self
.
assertMultilineMatches
(
bt
,
self
.
assertMultilineMatches
(
bt
,
r".*\nargs = \(1, 2, 3\)\n.*"
)
r".*\nargs = \(1, 2, 3\)\n.*"
)
@unittest.skipUnless
(
HAS_PYUP_PYDOWN
,
"test requires py-up/py-down commands"
)
def
test_locals_after_up
(
self
):
def
test_locals_after_up
(
self
):
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
bt
=
self
.
get_stack_trace
(
script
=
self
.
get_sample_script
(),
cmds_after_breakpoint
=
[
'py-up'
,
'py-locals'
])
cmds_after_breakpoint
=
[
'py-up'
,
'py-locals'
])
...
...
Misc/NEWS
Dosyayı görüntüle @
a92e81bf
...
@@ -20,6 +20,8 @@ Core and Builtins
...
@@ -20,6 +20,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #8437: Fix test_gdb failures, patch written by Dave Malcolm
- Issue #4814: timeout parameter is now applied also for connections resulting
- Issue #4814: timeout parameter is now applied also for connections resulting
from PORT/EPRT commands.
from PORT/EPRT commands.
...
...
Tools/gdb/libpython.py
Dosyayı görüntüle @
a92e81bf
...
@@ -1148,18 +1148,17 @@ class Frame(object):
...
@@ -1148,18 +1148,17 @@ class Frame(object):
def
is_evalframeex
(
self
):
def
is_evalframeex
(
self
):
'''Is this a PyEval_EvalFrameEx frame?'''
'''Is this a PyEval_EvalFrameEx frame?'''
if
self
.
_gdbframe
.
function
():
if
self
.
_gdbframe
.
name
()
==
'PyEval_EvalFrameEx'
:
if
self
.
_gdbframe
.
name
()
==
'PyEval_EvalFrameEx'
:
'''
'''
I believe we also need to filter on the inline
I believe we also need to filter on the inline
struct frame_id.inline_depth, only regarding frames with
struct frame_id.inline_depth, only regarding frames with
an inline depth of 0 as actually being this function
an inline depth of 0 as actually being this function
So we reject those with type gdb.INLINE_FRAME
So we reject those with type gdb.INLINE_FRAME
'''
'''
if
self
.
_gdbframe
.
type
()
==
gdb
.
NORMAL_FRAME
:
if
self
.
_gdbframe
.
type
()
==
gdb
.
NORMAL_FRAME
:
# We have a PyEval_EvalFrameEx frame:
# We have a PyEval_EvalFrameEx frame:
return
True
return
True
return
False
return
False
...
@@ -1309,8 +1308,6 @@ class PyUp(gdb.Command):
...
@@ -1309,8 +1308,6 @@ class PyUp(gdb.Command):
def
invoke
(
self
,
args
,
from_tty
):
def
invoke
(
self
,
args
,
from_tty
):
move_in_stack
(
move_up
=
True
)
move_in_stack
(
move_up
=
True
)
PyUp
()
class
PyDown
(
gdb
.
Command
):
class
PyDown
(
gdb
.
Command
):
'Select and print the python stack frame called by this one (if any)'
'Select and print the python stack frame called by this one (if any)'
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -1323,7 +1320,10 @@ class PyDown(gdb.Command):
...
@@ -1323,7 +1320,10 @@ class PyDown(gdb.Command):
def
invoke
(
self
,
args
,
from_tty
):
def
invoke
(
self
,
args
,
from_tty
):
move_in_stack
(
move_up
=
False
)
move_in_stack
(
move_up
=
False
)
PyDown
()
# Not all builds of gdb have gdb.Frame.select
if
hasattr
(
gdb
.
Frame
,
'select'
):
PyUp
()
PyDown
()
class
PyBacktrace
(
gdb
.
Command
):
class
PyBacktrace
(
gdb
.
Command
):
'Display the current python frame and all the frames within its call stack (if any)'
'Display the current python frame and all the frames within its call stack (if any)'
...
...
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