aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-21 14:58:50 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-21 15:00:35 -0800
commit4164be7206d740b77b5a7b4b2f859ed122d08c10 (patch)
tree36221f6baeca0eea6e416ad95a6420a093892a03 /lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
parentceb433ad162bac35888303d29d34dc2609974d92 (diff)
downloadllvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.zip
llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.tar.gz
llvm-4164be7206d740b77b5a7b4b2f859ed122d08c10.tar.bz2
[Lldb/Lua] Persist Lua state across script interpreter calls.
Don't create a new lua state on every operation. Share a single state across the lifetime of the script interpreter. Add simple locking to prevent two threads from modifying the state concurrently.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
index 7f69a73..b34c7d0 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
@@ -12,7 +12,7 @@
#include "lldb/Interpreter/ScriptInterpreter.h"
namespace lldb_private {
-
+class Lua;
class ScriptInterpreterLua : public ScriptInterpreter {
public:
ScriptInterpreterLua(Debugger &debugger);
@@ -40,6 +40,11 @@ public:
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
+
+ Lua &GetLua();
+
+private:
+ std::unique_ptr<Lua> m_lua;
};
} // namespace lldb_private