summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gdb.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-06-17 09:16:02 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-06-17 09:16:02 (GMT)
commit9aff2a7c41ac28f6c3f65933d9b1c1ff6ce4fe40 (patch)
treef145df21e0d81d8400d99e968901904c7d480974 /Lib/test/test_gdb.py
parent658dc3f746e1ffe5f5dcdd1ffc5c1d0ad458eb96 (diff)
parentbe4e4b5691492008dae31c82dc6ac2aba230b4e5 (diff)
downloadcpython-9aff2a7c41ac28f6c3f65933d9b1c1ff6ce4fe40.zip
cpython-9aff2a7c41ac28f6c3f65933d9b1c1ff6ce4fe40.tar.gz
cpython-9aff2a7c41ac28f6c3f65933d9b1c1ff6ce4fe40.tar.bz2
Merge from 3.2 (Issue #15043: skip test_gdb if the custom hooks can't be loaded)
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r--Lib/test/test_gdb.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 91543c6..fd1275c 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -36,6 +36,15 @@ gdbpy_version, _ = p.communicate()
if gdbpy_version == b'':
raise unittest.SkipTest("gdb not built with embedded python support")
+# Verify that "gdb" can load our custom hooks
+p = subprocess.Popen(["gdb", "--batch", cmd,
+ "--args", sys.executable],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+__, gdbpy_errors = p.communicate()
+if b"auto-loading has been declined" in gdbpy_errors:
+ msg = "gdb security settings prevent use of custom hooks: %s"
+ raise unittest.SkipTest(msg % gdbpy_errors)
+
def gdb_has_frame_select():
# Does this build of gdb have gdb.Frame.select ?
cmd = "--eval-command=python print(dir(gdb.Frame))"