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
69c1a665
Commit
69c1a665
authored
Aug 16, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Plain Diff
(Merge 3.4) Closes #22188: test_gdb now runs gdb with -nx: "Do not execute
commands from any .gdbinit initialization files".
parents
cddaa1bd
7869a4e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Lib/test/test_gdb.py
Lib/test/test_gdb.py
+5
-3
No files found.
Lib/test/test_gdb.py
View file @
69c1a665
...
...
@@ -22,7 +22,7 @@ from test import support
from
test.support
import
run_unittest
,
findfile
,
python_is_optimized
try
:
gdb_version
,
_
=
subprocess
.
Popen
([
"gdb"
,
"--version"
],
gdb_version
,
_
=
subprocess
.
Popen
([
"gdb"
,
"-
nx"
,
"-
-version"
],
stdout
=
subprocess
.
PIPE
).
communicate
()
except
OSError
:
# This is what "no gdb" looks like. There may, however, be other
...
...
@@ -54,7 +54,9 @@ def run_gdb(*args, **env_vars):
env
.
update
(
env_vars
)
else
:
env
=
None
base_cmd
=
(
'gdb'
,
'--batch'
)
# -nx: Do not execute commands from any .gdbinit initialization files
# (issue #22188)
base_cmd
=
(
'gdb'
,
'--batch'
,
'-nx'
)
if
(
gdb_major_version
,
gdb_minor_version
)
>=
(
7
,
4
):
base_cmd
+=
(
'-iex'
,
'add-auto-load-safe-path '
+
checkout_hook_path
)
out
,
err
=
subprocess
.
Popen
(
base_cmd
+
args
,
...
...
@@ -130,7 +132,7 @@ class DebuggerTests(unittest.TestCase):
# print commands
# Use "commands" to generate the arguments with which to invoke "gdb":
args
=
[
"gdb"
,
"--batch"
]
args
=
[
"gdb"
,
"--batch"
,
"-nx"
]
args
+=
[
'--eval-command=%s'
%
cmd
for
cmd
in
commands
]
args
+=
[
"--args"
,
sys
.
executable
]
...
...
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