Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1b1e412b
Commit
1b1e412b
authored
Nov 24, 2013
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #19743: fix test_gdb on some optimized Python builds
parent
b6a979dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Lib/test/test_gdb.py
Lib/test/test_gdb.py
+8
-4
No files found.
Lib/test/test_gdb.py
View file @
1b1e412b
...
@@ -141,7 +141,7 @@ class DebuggerTests(unittest.TestCase):
...
@@ -141,7 +141,7 @@ class DebuggerTests(unittest.TestCase):
args
+=
[
script
]
args
+=
[
script
]
# print args
# print args
# print
' '.join(args
)
# print
(' '.join(args)
)
# Use "args" to invoke gdb, capturing stdout, stderr:
# Use "args" to invoke gdb, capturing stdout, stderr:
out
,
err
=
run_gdb
(
*
args
,
PYTHONHASHSEED
=
'0'
)
out
,
err
=
run_gdb
(
*
args
,
PYTHONHASHSEED
=
'0'
)
...
@@ -186,6 +186,11 @@ class DebuggerTests(unittest.TestCase):
...
@@ -186,6 +186,11 @@ class DebuggerTests(unittest.TestCase):
#
#
# For a nested structure, the first time we hit the breakpoint will
# For a nested structure, the first time we hit the breakpoint will
# give us the top-level structure
# give us the top-level structure
# NOTE: avoid decoding too much of the traceback as some
# undecodable characters may lurk there in optimized mode
# (issue #19743).
cmds_after_breakpoint
=
cmds_after_breakpoint
or
[
"backtrace 1"
]
gdb_output
=
self
.
get_stack_trace
(
source
,
breakpoint
=
BREAKPOINT_FN
,
gdb_output
=
self
.
get_stack_trace
(
source
,
breakpoint
=
BREAKPOINT_FN
,
cmds_after_breakpoint
=
cmds_after_breakpoint
,
cmds_after_breakpoint
=
cmds_after_breakpoint
,
import_site
=
import_site
)
import_site
=
import_site
)
...
@@ -216,11 +221,10 @@ class PrettyPrintTests(DebuggerTests):
...
@@ -216,11 +221,10 @@ class PrettyPrintTests(DebuggerTests):
gdb_output
=
self
.
get_stack_trace
(
'id(42)'
)
gdb_output
=
self
.
get_stack_trace
(
'id(42)'
)
self
.
assertTrue
(
BREAKPOINT_FN
in
gdb_output
)
self
.
assertTrue
(
BREAKPOINT_FN
in
gdb_output
)
def
assertGdbRepr
(
self
,
val
,
exp_repr
=
None
,
cmds_after_breakpoint
=
None
):
def
assertGdbRepr
(
self
,
val
,
exp_repr
=
None
):
# Ensure that gdb's rendering of the value in a debugged process
# Ensure that gdb's rendering of the value in a debugged process
# matches repr(value) in this process:
# matches repr(value) in this process:
gdb_repr
,
gdb_output
=
self
.
get_gdb_repr
(
'id('
+
ascii
(
val
)
+
')'
,
gdb_repr
,
gdb_output
=
self
.
get_gdb_repr
(
'id('
+
ascii
(
val
)
+
')'
)
cmds_after_breakpoint
)
if
not
exp_repr
:
if
not
exp_repr
:
exp_repr
=
repr
(
val
)
exp_repr
=
repr
(
val
)
self
.
assertEqual
(
gdb_repr
,
exp_repr
,
self
.
assertEqual
(
gdb_repr
,
exp_repr
,
...
...
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