LLDB  mainline
ScriptInterpreterLua.cpp
Go to the documentation of this file.
1 //===-- ScriptInterpreterLua.cpp ------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "ScriptInterpreterLua.h"
10 #include "Lua.h"
12 #include "lldb/Core/Debugger.h"
14 #include "lldb/Core/StreamFile.h"
17 #include "lldb/Utility/Stream.h"
19 #include "lldb/Utility/Timer.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Support/FormatAdapters.h"
22 #include <memory>
23 #include <vector>
24 
25 using namespace lldb;
26 using namespace lldb_private;
27 
29 
34 };
35 
37  public IOHandlerEditline {
38 public:
40  ScriptInterpreterLua &script_interpreter,
41  ActiveIOHandler active_io_handler = eIOHandlerNone)
42  : IOHandlerEditline(debugger, IOHandler::Type::LuaInterpreter, "lua",
43  ">>> ", "..> ", true, debugger.GetUseColor(), 0,
44  *this, nullptr),
45  m_script_interpreter(script_interpreter),
46  m_active_io_handler(active_io_handler) {
47  llvm::cantFail(m_script_interpreter.GetLua().ChangeIO(
48  debugger.GetOutputFile().GetStream(),
49  debugger.GetErrorFile().GetStream()));
50  llvm::cantFail(m_script_interpreter.EnterSession(debugger.GetID()));
51  }
52 
54  llvm::cantFail(m_script_interpreter.LeaveSession());
55  }
56 
57  void IOHandlerActivated(IOHandler &io_handler, bool interactive) override {
58  const char *instructions = nullptr;
59  switch (m_active_io_handler) {
60  case eIOHandlerNone:
62  break;
64  instructions = "Enter your Lua command(s). Type 'quit' to end.\n"
65  "The commands are compiled as the body of the following "
66  "Lua function\n"
67  "function (frame, bp_loc, ...) end\n";
68  SetPrompt(llvm::StringRef("..> "));
69  break;
70  }
71  if (instructions == nullptr)
72  return;
73  if (interactive)
74  *io_handler.GetOutputStreamFileSP() << instructions;
75  }
76 
78  StringList &lines) override {
79  size_t last = lines.GetSize() - 1;
80  if (IsQuitCommand(lines.GetStringAtIndex(last))) {
81  if (m_active_io_handler == eIOHandlerBreakpoint)
82  lines.DeleteStringAtIndex(last);
83  return true;
84  }
85  StreamString str;
86  lines.Join("\n", str);
87  if (llvm::Error E =
88  m_script_interpreter.GetLua().CheckSyntax(str.GetString())) {
89  std::string error_str = toString(std::move(E));
90  // Lua always errors out to incomplete code with '<eof>'
91  return error_str.find("<eof>") == std::string::npos;
92  }
93  // The breakpoint handler only exits with a explicit 'quit'
94  return m_active_io_handler != eIOHandlerBreakpoint;
95  }
96 
98  std::string &data) override {
99  switch (m_active_io_handler) {
100  case eIOHandlerBreakpoint: {
101  auto *bp_options_vec = static_cast<std::vector<BreakpointOptions *> *>(
102  io_handler.GetUserData());
103  for (auto *bp_options : *bp_options_vec) {
104  Status error = m_script_interpreter.SetBreakpointCommandCallback(
105  bp_options, data.c_str());
106  if (error.Fail())
107  *io_handler.GetErrorStreamFileSP() << error.AsCString() << '\n';
108  }
109  io_handler.SetIsDone(true);
110  } break;
112  io_handler.SetIsDone(true);
113  break;
114  case eIOHandlerNone:
115  if (IsQuitCommand(data)) {
116  io_handler.SetIsDone(true);
117  return;
118  }
119  if (llvm::Error error = m_script_interpreter.GetLua().Run(data))
120  *io_handler.GetErrorStreamFileSP() << toString(std::move(error));
121  break;
122  }
123  }
124 
125 private:
128 
129  bool IsQuitCommand(llvm::StringRef cmd) { return cmd.rtrim() == "quit"; }
130 };
131 
132 ScriptInterpreterLua::ScriptInterpreterLua(Debugger &debugger)
134  m_lua(std::make_unique<Lua>()) {}
135 
137 
138 bool ScriptInterpreterLua::ExecuteOneLine(llvm::StringRef command,
139  CommandReturnObject *result,
140  const ExecuteScriptOptions &options) {
141  if (command.empty()) {
142  if (result)
143  result->AppendError("empty command passed to lua\n");
144  return false;
145  }
146 
147  llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
148  io_redirect_or_error = ScriptInterpreterIORedirect::Create(
149  options.GetEnableIO(), m_debugger, result);
150  if (!io_redirect_or_error) {
151  if (result)
152  result->AppendErrorWithFormatv(
153  "failed to redirect I/O: {0}\n",
154  llvm::fmt_consume(io_redirect_or_error.takeError()));
155  else
156  llvm::consumeError(io_redirect_or_error.takeError());
157  return false;
158  }
159 
160  ScriptInterpreterIORedirect &io_redirect = **io_redirect_or_error;
161 
162  if (llvm::Error e =
163  m_lua->ChangeIO(io_redirect.GetOutputFile()->GetStream(),
164  io_redirect.GetErrorFile()->GetStream())) {
165  result->AppendErrorWithFormatv("lua failed to redirect I/O: {0}\n",
166  llvm::toString(std::move(e)));
167  return false;
168  }
169 
170  if (llvm::Error e = m_lua->Run(command)) {
171  result->AppendErrorWithFormatv(
172  "lua failed attempting to evaluate '{0}': {1}\n", command,
173  llvm::toString(std::move(e)));
174  return false;
175  }
176 
177  io_redirect.Flush();
178  return true;
179 }
180 
183 
184  // At the moment, the only time the debugger does not have an input file
185  // handle is when this is called directly from lua, in which case it is
186  // both dangerous and unnecessary (not to mention confusing) to try to embed
187  // a running interpreter loop inside the already running lua interpreter
188  // loop, so we won't do it.
190  return;
191 
192  IOHandlerSP io_handler_sp(new IOHandlerLuaInterpreter(m_debugger, *this));
193  m_debugger.RunIOHandlerAsync(io_handler_sp);
194 }
195 
197  const char *filename, bool init_session, lldb_private::Status &error,
198  StructuredData::ObjectSP *module_sp, FileSpec extra_search_dir) {
199 
200  FileSystem::Instance().Collect(filename);
201  if (llvm::Error e = m_lua->LoadModule(filename)) {
202  error.SetErrorStringWithFormatv("lua failed to import '{0}': {1}\n",
203  filename, llvm::toString(std::move(e)));
204  return false;
205  }
206  return true;
207 }
208 
210  static llvm::once_flag g_once_flag;
211 
212  llvm::call_once(g_once_flag, []() {
216  });
217 }
218 
220 
223  return llvm::Error::success();
224 
225  const char *fmt_str =
226  "lldb.debugger = lldb.SBDebugger.FindDebuggerWithID({0}); "
227  "lldb.target = lldb.debugger:GetSelectedTarget(); "
228  "lldb.process = lldb.target:GetProcess(); "
229  "lldb.thread = lldb.process:GetSelectedThread(); "
230  "lldb.frame = lldb.thread:GetSelectedFrame()";
231  return m_lua->Run(llvm::formatv(fmt_str, debugger_id).str());
232 }
233 
235  if (!m_session_is_active)
236  return llvm::Error::success();
237 
238  m_session_is_active = false;
239 
240  llvm::StringRef str = "lldb.debugger = nil; "
241  "lldb.target = nil; "
242  "lldb.process = nil; "
243  "lldb.thread = nil; "
244  "lldb.frame = nil";
245  return m_lua->Run(str);
246 }
247 
249  void *baton, StoppointCallbackContext *context, user_id_t break_id,
250  user_id_t break_loc_id) {
251  assert(context);
252 
253  ExecutionContext exe_ctx(context->exe_ctx_ref);
254  Target *target = exe_ctx.GetTargetPtr();
255  if (target == nullptr)
256  return true;
257 
258  StackFrameSP stop_frame_sp(exe_ctx.GetFrameSP());
259  BreakpointSP breakpoint_sp = target->GetBreakpointByID(break_id);
260  BreakpointLocationSP bp_loc_sp(breakpoint_sp->FindLocationByID(break_loc_id));
261 
262  Debugger &debugger = target->GetDebugger();
263  ScriptInterpreterLua *lua_interpreter = static_cast<ScriptInterpreterLua *>(
264  debugger.GetScriptInterpreter(true, eScriptLanguageLua));
265  Lua &lua = lua_interpreter->GetLua();
266 
267  CommandDataLua *bp_option_data = static_cast<CommandDataLua *>(baton);
268  llvm::Expected<bool> BoolOrErr = lua.CallBreakpointCallback(
269  baton, stop_frame_sp, bp_loc_sp, bp_option_data->m_extra_args_sp);
270  if (llvm::Error E = BoolOrErr.takeError()) {
271  debugger.GetErrorStream() << toString(std::move(E));
272  return true;
273  }
274 
275  return *BoolOrErr;
276 }
277 
279  std::vector<BreakpointOptions *> &bp_options_vec,
280  CommandReturnObject &result) {
281  IOHandlerSP io_handler_sp(
283  io_handler_sp->SetUserData(&bp_options_vec);
284  m_debugger.RunIOHandlerAsync(io_handler_sp);
285 }
286 
288  BreakpointOptions *bp_options, const char *function_name,
289  StructuredData::ObjectSP extra_args_sp) {
290  const char *fmt_str = "return {0}(frame, bp_loc, ...)";
291  std::string oneliner = llvm::formatv(fmt_str, function_name).str();
292  return RegisterBreakpointCallback(bp_options, oneliner.c_str(),
293  extra_args_sp);
294 }
295 
297  BreakpointOptions *bp_options, const char *command_body_text) {
298  return RegisterBreakpointCallback(bp_options, command_body_text, {});
299 }
300 
302  BreakpointOptions *bp_options, const char *command_body_text,
303  StructuredData::ObjectSP extra_args_sp) {
304  Status error;
305  auto data_up = std::make_unique<CommandDataLua>(extra_args_sp);
306  error = m_lua->RegisterBreakpointCallback(data_up.get(), command_body_text);
307  if (error.Fail())
308  return error;
309  auto baton_sp =
310  std::make_shared<BreakpointOptions::CommandBaton>(std::move(data_up));
312  baton_sp);
313  return error;
314 }
315 
316 lldb::ScriptInterpreterSP
318  return std::make_shared<ScriptInterpreterLua>(debugger);
319 }
320 
322  static ConstString g_name("script-lua");
323  return g_name;
324 }
325 
327  return "Lua script interpreter";
328 }
329 
331  return GetPluginNameStatic();
332 }
333 
335 
lldb_private::ScriptInterpreterLua::LeaveSession
llvm::Error LeaveSession()
Definition: ScriptInterpreterLua.cpp:234
lldb_private::ScriptInterpreterLua::EnterSession
llvm::Error EnterSession(lldb::user_id_t debugger_id)
Definition: ScriptInterpreterLua.cpp:221
lldb_private::ExecutionContext
Definition: ExecutionContext.h:291
IOHandlerLuaInterpreter::m_active_io_handler
ActiveIOHandler m_active_io_handler
Definition: ScriptInterpreterLua.cpp:127
lldb_private::Debugger::GetErrorFile
File & GetErrorFile()
Definition: Debugger.h:171
lldb_private::ScriptInterpreterLua::RegisterBreakpointCallback
Status RegisterBreakpointCallback(BreakpointOptions *bp_options, const char *command_body_text, StructuredData::ObjectSP extra_args_sp)
Definition: ScriptInterpreterLua.cpp:301
lldb_private::FileSystem::Collect
void Collect(const FileSpec &file_spec)
Definition: common/FileSystem.cpp:499
lldb_private::StoppointCallbackContext
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
Definition: StoppointCallbackContext.h:26
lldb_private::ScriptInterpreterLua::m_lua
std::unique_ptr< Lua > m_lua
Definition: ScriptInterpreterLua.h:86
lldb_private::ScriptInterpreterIORedirect
Definition: ScriptInterpreter.h:40
lldb_private::Lua
Definition: Lua.h:29
Lua.h
lldb_private::ScriptInterpreterLua::CollectDataForBreakpointCommandCallback
void CollectDataForBreakpointCommandCallback(std::vector< BreakpointOptions * > &bp_options_vec, CommandReturnObject &result) override
Definition: ScriptInterpreterLua.cpp:278
ScriptInterpreterLua.h
lldb_private::ScriptInterpreterIORedirect::GetErrorFile
lldb::FileSP GetErrorFile() const
Definition: ScriptInterpreter.h:52
lldb_private::ScriptInterpreterLua::GetPluginName
lldb_private::ConstString GetPluginName() override
Definition: ScriptInterpreterLua.cpp:330
lldb_private::Debugger::RunIOHandlerAsync
void RunIOHandlerAsync(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
Run the given IO handler and return immediately.
Definition: Debugger.cpp:952
lldb_private::StoppointCallbackContext::exe_ctx_ref
ExecutionContextRef exe_ctx_ref
Definition: StoppointCallbackContext.h:43
StoppointCallbackContext.h
lldb_private::ScriptInterpreterLua::SetBreakpointCommandCallback
Status SetBreakpointCommandCallback(BreakpointOptions *bp_options, const char *command_body_text) override
Definition: ScriptInterpreterLua.cpp:296
lldb_private::ScriptInterpreterLua::Initialize
static void Initialize()
Definition: ScriptInterpreterLua.cpp:209
eIOHandlerBreakpoint
@ eIOHandlerBreakpoint
Definition: ScriptInterpreterLua.cpp:32
eIOHandlerNone
@ eIOHandlerNone
Definition: ScriptInterpreterLua.cpp:31
lldb_private::ScriptInterpreter::ExecuteScriptOptions::GetEnableIO
bool GetEnableIO() const
Definition: ScriptInterpreter.h:100
lldb_private::ScriptInterpreterIORedirect::Create
static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > Create(bool enable_io, Debugger &debugger, CommandReturnObject *result)
Create an IO redirect.
Definition: ScriptInterpreter.cpp:139
lldb_private::Target::GetDebugger
Debugger & GetDebugger()
Definition: Target.h:996
CommandReturnObject.h
Debugger.h
lldb_private::Target
Definition: Target.h:447
lldb_private::CommandReturnObject::AppendErrorWithFormatv
void AppendErrorWithFormatv(const char *format, Args &&... args)
Definition: CommandReturnObject.h:121
lldb_private::Debugger::GetScriptInterpreter
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, llvm::Optional< lldb::ScriptLanguage > language={})
Definition: Debugger.cpp:1266
lldb_private::ScriptInterpreter::ExecuteScriptOptions
Definition: ScriptInterpreter.h:95
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::ScriptInterpreterLua::BreakpointCallbackFunction
static bool BreakpointCallbackFunction(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Definition: ScriptInterpreterLua.cpp:248
IOHandlerLuaInterpreter
Definition: ScriptInterpreterLua.cpp:36
lldb_private::ScriptInterpreter::m_debugger
Debugger & m_debugger
Definition: ScriptInterpreter.h:546
lldb_private::StringList::GetSize
size_t GetSize() const
Definition: StringList.cpp:68
lldb_private::PluginManager::RegisterPlugin
static bool RegisterPlugin(ConstString name, const char *description, ABICreateInstance create_callback)
Definition: PluginManager.cpp:287
IOHandlerLuaInterpreter::~IOHandlerLuaInterpreter
~IOHandlerLuaInterpreter() override
Definition: ScriptInterpreterLua.cpp:53
IOHandlerLuaInterpreter::IOHandlerLuaInterpreter
IOHandlerLuaInterpreter(Debugger &debugger, ScriptInterpreterLua &script_interpreter, ActiveIOHandler active_io_handler=eIOHandlerNone)
Definition: ScriptInterpreterLua.cpp:39
lldb_private::Debugger::GetInputFile
File & GetInputFile()
Definition: Debugger.h:167
lldb_private::ScriptInterpreterLua::ExecuteOneLine
bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions()) override
Definition: ScriptInterpreterLua.cpp:138
lldb_private::File::IsValid
bool IsValid() const override
IsValid.
Definition: File.cpp:107
lldb_private::FileSpec
Definition: FileSpec.h:56
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::Lua::CallBreakpointCallback
llvm::Expected< bool > CallBreakpointCallback(void *baton, lldb::StackFrameSP stop_frame_sp, lldb::BreakpointLocationSP bp_loc_sp, StructuredData::ObjectSP extra_args_sp)
Definition: Lua.cpp:99
lldb_private::StringList::GetStringAtIndex
const char * GetStringAtIndex(size_t idx) const
Definition: StringList.cpp:80
lldb_private::breakpad::toString
llvm::StringRef toString(Record::Kind K)
Definition: BreakpadRecords.cpp:483
IOHandlerLuaInterpreter::m_script_interpreter
ScriptInterpreterLua & m_script_interpreter
Definition: ScriptInterpreterLua.cpp:126
lldb_private::Debugger::GetOutputFile
File & GetOutputFile()
Definition: Debugger.h:169
lldb_private::ScriptInterpreterIORedirect::GetOutputFile
lldb::FileSP GetOutputFile() const
Definition: ScriptInterpreter.h:51
lldb_private::BreakpointOptions::SetCallback
void SetCallback(BreakpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false)
Adds a callback to the breakpoint option set.
Definition: BreakpointOptions.cpp:402
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::ScriptInterpreterLua::GetPluginVersion
uint32_t GetPluginVersion() override
Definition: ScriptInterpreterLua.cpp:334
ActiveIOHandler
ActiveIOHandler
Definition: ScriptInterpreterLua.cpp:30
lldb_private::ScriptInterpreterLua::m_session_is_active
bool m_session_is_active
Definition: ScriptInterpreterLua.h:87
lldb_private::StringList
Definition: StringList.h:25
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::StreamString
Definition: StreamString.h:23
lldb_private::BreakpointOptions
Definition: BreakpointOptions.h:27
lldb_private::IOHandler
Definition: IOHandler.h:46
Timer.h
LLDB_SCOPED_TIMER
#define LLDB_SCOPED_TIMER()
Definition: Timer.h:77
lldb_private::ScriptInterpreterLua::GetPluginDescriptionStatic
static const char * GetPluginDescriptionStatic()
Definition: ScriptInterpreterLua.cpp:326
lldb_private::Debugger
Definition: Debugger.h:70
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:38
StringList.h
eIOHandlerWatchpoint
@ eIOHandlerWatchpoint
Definition: ScriptInterpreterLua.cpp:33
lldb_private::ScriptInterpreterLua::CreateInstance
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger)
Definition: ScriptInterpreterLua.cpp:317
IOHandlerLuaInterpreter::IOHandlerInputComplete
void IOHandlerInputComplete(IOHandler &io_handler, std::string &data) override
Called when a line or lines have been retrieved.
Definition: ScriptInterpreterLua.cpp:97
lldb_private::UserID::GetID
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47
lldb_private::ScriptInterpreterLua::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: ScriptInterpreterLua.cpp:321
StreamFile.h
lldb_private::IOHandler::SetIsDone
virtual void SetIsDone(bool b)
Definition: IOHandler.h:90
lldb_private::ScriptInterpreterLua::CommandDataLua::m_extra_args_sp
StructuredData::ObjectSP m_extra_args_sp
Definition: ScriptInterpreterLua.h:30
lldb_private::Status
Definition: Status.h:44
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:25
uint32_t
lldb_private::ExecutionContext::GetFrameSP
const lldb::StackFrameSP & GetFrameSP() const
Get accessor to get the frame shared pointer.
Definition: ExecutionContext.h:468
lldb_private::ScriptInterpreterLua::GetLua
Lua & GetLua()
Definition: ScriptInterpreterLua.cpp:336
lldb_private::StringList::DeleteStringAtIndex
void DeleteStringAtIndex(size_t id)
Definition: StringList.cpp:141
lldb_private::IOHandler::GetUserData
void * GetUserData()
Definition: IOHandler.h:139
lldb_private::ScriptInterpreterLua::~ScriptInterpreterLua
~ScriptInterpreterLua() override
Definition: ScriptInterpreterLua.cpp:136
lldb_private::IOHandler::Type
Type
Definition: IOHandler.h:48
PluginManager.h
lldb_private::ScriptInterpreter
Definition: ScriptInterpreter.h:69
lldb_private::ScriptInterpreterIORedirect::Flush
void Flush()
Flush our output and error file handles.
Definition: ScriptInterpreter.cpp:211
IOHandlerLuaInterpreter::IsQuitCommand
bool IsQuitCommand(llvm::StringRef cmd)
Definition: ScriptInterpreterLua.cpp:129
lldb_private::ScriptInterpreterLua::CommandDataLua
Definition: ScriptInterpreterLua.h:21
IOHandlerLuaInterpreter::IOHandlerIsInputComplete
bool IOHandlerIsInputComplete(IOHandler &io_handler, StringList &lines) override
Called to determine whether typing enter after the last line in lines should end input.
Definition: ScriptInterpreterLua.cpp:77
lldb_private::FileSystem::Instance
static FileSystem & Instance()
Definition: common/FileSystem.cpp:45
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::IOHandlerDelegate
A delegate class for use with IOHandler subclasses.
Definition: IOHandler.h:195
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:29
lldb_private::ScriptInterpreterLua
Definition: ScriptInterpreterLua.h:19
lldb_private::ScriptInterpreterLua::SetBreakpointCommandCallbackFunction
Status SetBreakpointCommandCallbackFunction(BreakpointOptions *bp_options, const char *function_name, StructuredData::ObjectSP extra_args_sp) override
Set a script function as the callback for the breakpoint.
Definition: ScriptInterpreterLua.cpp:287
lldb_private::ScriptInterpreterLua::ExecuteInterpreterLoop
void ExecuteInterpreterLoop() override
Definition: ScriptInterpreterLua.cpp:181
lldb::eScriptLanguageLua
@ eScriptLanguageLua
Definition: lldb-enumerations.h:219
lldb_private::File::GetStream
virtual FILE * GetStream()
Get the underlying libc stream for this file, or NULL.
Definition: File.cpp:122
Stream.h
LLDB_PLUGIN_DEFINE
#define LLDB_PLUGIN_DEFINE(PluginName)
Definition: PluginManager.h:31
lldb_private::Target::GetBreakpointByID
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:301
lldb_private::CommandReturnObject::AppendError
void void AppendError(llvm::StringRef in_string)
Definition: CommandReturnObject.cpp:100
lldb_private::StringList::Join
void Join(const char *separator, Stream &strm)
Definition: StringList.cpp:86
lldb_private::Debugger::GetErrorStream
StreamFile & GetErrorStream()
Definition: Debugger.h:175
lldb
Definition: SBAddress.h:15
lldb_private::IOHandler::GetOutputStreamFileSP
lldb::StreamFileSP GetOutputStreamFileSP()
Definition: IOHandler.cpp:108
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:200
ExecutionContext.h
lldb_private::ScriptInterpreterLua::Terminate
static void Terminate()
Definition: ScriptInterpreterLua.cpp:219
lldb_private::IOHandler::GetErrorStreamFileSP
lldb::StreamFileSP GetErrorStreamFileSP()
Definition: IOHandler.cpp:110
lldb_private::IOHandlerEditline
Definition: IOHandler.h:332
lldb_private::ScriptInterpreterLua::LoadScriptingModule
bool LoadScriptingModule(const char *filename, bool init_session, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={}) override
Definition: ScriptInterpreterLua.cpp:196
IOHandlerLuaInterpreter::IOHandlerActivated
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override
Definition: ScriptInterpreterLua.cpp:57