PR python/17372 - Python hangs when displaying help()
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / python.exp
index 3df934771c1ecf9544a7089156aedecc174e77e4..0e772566f13c26486c1e416638942001c1ce3244 100644 (file)
@@ -61,6 +61,22 @@ gdb_py_test_multiple "multi-line python command" \
   "print (23)" "" \
   "end" "23"
 
+# Spawn interactive Python help from a multi-line command, thus, after
+# a secondary prompt.
+
+with_test_prefix "python interactive help" {
+    set test "python; help(); end"
+    gdb_test_multiple "python\nhelp()\nend" $test {
+       -re "online help utility.*help> $" {
+           pass $test
+
+           # The "quit" must be seen on the output.  A buggy GDB
+           # would not display it.
+           gdb_test "quit" "^quit.*leaving help.*" "quit help"
+       }
+    }
+}
+
 gdb_py_test_multiple "show python command" \
   "define zzq" "Type commands for definition of .* just \"end\"\\.*" \
   "python" "" \
This page took 0.027137 seconds and 4 git commands to generate.