llvm-project/lldb/test/Shell/ScriptInterpreter/Python
Jonas Devlieghere 4dd3dfe8e3 [lldb/Python] Fix the infinitely looping Python prompt bug
Executing commands below will get you bombarded by a wall of Python
command prompts (>>> ).

$ echo 'foo' | ./bin/lldb -o script
$ cat /tmp/script
script
print("foo")
$ lldb --source /tmp/script

The issue is that our custom input reader doesn't handle EOF. According
to the Python documentation, file.readline always includes a trailing
newline character unless the file ends with an incomplete line. An empty
string signals EOF. This patch raises an EOFError when that happens.

[1] https://docs.python.org/2/library/stdtypes.html#file.readline

Differential revision: https://reviews.llvm.org/D81898
2020-06-16 11:05:19 -07:00
..
Inputs [lldb/Bindings] Raise exception when using properties that rely on lldb.target 2020-05-29 22:11:21 -07:00
crashlog.test [lldb/Test] Skip script interpreter tests reading from stdin for lldb-repro 2020-01-22 15:22:25 -08:00
eof.test [lldb/Python] Fix the infinitely looping Python prompt bug 2020-06-16 11:05:19 -07:00
lit.local.cfg [lldb/Test] Use lit.local.cfg to mark whole directory as (un)supported. 2020-01-27 15:11:00 -08:00
sb_address_exception.test [lldb/Bindings] Raise exception when using properties that rely on lldb.target 2020-05-29 22:11:21 -07:00
scripted_breakpoint.test [lldb/Test] Skip script interpreter tests reading from stdin for lldb-repro 2020-01-22 15:22:25 -08:00