summaryrefslogtreecommitdiffstats
path: root/lldb/test/Shell
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-07 17:35:31 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-20 11:19:47 -0800
commit2861324208e13846eb306f01b32448f94177cc3b (patch)
treeb47908336cb73f749fb4799dc5e877817ded4f0b /lldb/test/Shell
parent2a42a5a2f4144cd99812ad0d230480f94a1d1c92 (diff)
downloadbcm5719-llvm-2861324208e13846eb306f01b32448f94177cc3b.tar.gz
bcm5719-llvm-2861324208e13846eb306f01b32448f94177cc3b.zip
[lldb/Lua] Implement a Simple Lua Script Interpreter Prototype
This implements a very elementary Lua script interpreter. It supports running a single command as well as running interactively. It uses editline if available. It's still missing a bunch of stuff though. Some things that I intentionally ingored for now are that I/O isn't properly hooked up (so every print goes to stdout) and the non-editline support which is not handling a bunch of corner cases. The latter is a matter of reusing existing code in the Python interpreter. Discussion on the mailing list: http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html Differential revision: https://reviews.llvm.org/D71234
Diffstat (limited to 'lldb/test/Shell')
-rw-r--r--lldb/test/Shell/ScriptInterpreter/Lua/lua.test3
-rw-r--r--lldb/test/Shell/lit.cfg.py3
-rw-r--r--lldb/test/Shell/lit.site.cfg.py.in1
3 files changed, 7 insertions, 0 deletions
diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/lua.test b/lldb/test/Shell/ScriptInterpreter/Lua/lua.test
new file mode 100644
index 00000000000..70184edbab1
--- /dev/null
+++ b/lldb/test/Shell/ScriptInterpreter/Lua/lua.test
@@ -0,0 +1,3 @@
+# REQUIRES: lua
+# RUN: %lldb --script-language lua -o 'script print(1000+100+10+1)' 2>&1 | FileCheck %s
+# CHECK: 1111
diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index c0a60914551..cc6155f05cd 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -103,6 +103,9 @@ if 'native' in config.available_features:
if config.lldb_enable_python:
config.available_features.add('python')
+if config.lldb_enable_lua:
+ config.available_features.add('lua')
+
if config.lldb_enable_lzma:
config.available_features.add('lzma')
diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in
index b391f8ba31e..d998a0ca51c 100644
--- a/lldb/test/Shell/lit.site.cfg.py.in
+++ b/lldb/test/Shell/lit.site.cfg.py.in
@@ -19,6 +19,7 @@ config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
+config.lldb_enable_lua = @LLDB_ENABLE_LUA@
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
# The shell tests use their own module caches.
config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
OpenPOWER on IntegriCloud