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
8bd3415a
Kaydet (Commit)
8bd3415a
authored
Agu 16, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #22188: test_gdb now runs gdb with -nx: "Do not execute commands from
any .gdbinit initialization files".
üst
7257b50e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
test_gdb.py
Lib/test/test_gdb.py
+6
-4
No files found.
Lib/test/test_gdb.py
Dosyayı görüntüle @
8bd3415a
...
@@ -13,7 +13,7 @@ import sysconfig
...
@@ -13,7 +13,7 @@ import sysconfig
from
test.test_support
import
run_unittest
,
findfile
from
test.test_support
import
run_unittest
,
findfile
try
:
try
:
gdb_version
,
_
=
subprocess
.
Popen
([
"gdb"
,
"--version"
],
gdb_version
,
_
=
subprocess
.
Popen
([
"gdb"
,
"-
nx"
,
"-
-version"
],
stdout
=
subprocess
.
PIPE
)
.
communicate
()
stdout
=
subprocess
.
PIPE
)
.
communicate
()
except
OSError
:
except
OSError
:
# This is what "no gdb" looks like. There may, however, be other
# This is what "no gdb" looks like. There may, however, be other
...
@@ -31,7 +31,7 @@ checkout_hook_path = os.path.join(os.path.dirname(sys.executable),
...
@@ -31,7 +31,7 @@ checkout_hook_path = os.path.join(os.path.dirname(sys.executable),
'python-gdb.py'
)
'python-gdb.py'
)
def
run_gdb
(
*
args
,
**
env_vars
):
def
run_gdb
(
*
args
,
**
env_vars
):
"""Runs gdb in
--
batch mode with the additional arguments given by *args.
"""Runs gdb in batch mode with the additional arguments given by *args.
Returns its (stdout, stderr)
Returns its (stdout, stderr)
"""
"""
...
@@ -40,7 +40,9 @@ def run_gdb(*args, **env_vars):
...
@@ -40,7 +40,9 @@ def run_gdb(*args, **env_vars):
env
.
update
(
env_vars
)
env
.
update
(
env_vars
)
else
:
else
:
env
=
None
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
):
if
(
gdb_major_version
,
gdb_minor_version
)
>=
(
7
,
4
):
base_cmd
+=
(
'-iex'
,
'add-auto-load-safe-path '
+
checkout_hook_path
)
base_cmd
+=
(
'-iex'
,
'add-auto-load-safe-path '
+
checkout_hook_path
)
out
,
err
=
subprocess
.
Popen
(
base_cmd
+
args
,
out
,
err
=
subprocess
.
Popen
(
base_cmd
+
args
,
...
@@ -122,7 +124,7 @@ class DebuggerTests(unittest.TestCase):
...
@@ -122,7 +124,7 @@ class DebuggerTests(unittest.TestCase):
# print commands
# print commands
# Use "commands" to generate the arguments with which to invoke "gdb":
# 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
+=
[
'--eval-command=
%
s'
%
cmd
for
cmd
in
commands
]
args
+=
[
"--args"
,
args
+=
[
"--args"
,
sys
.
executable
]
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