LLDB  mainline
ScriptInterpreter.h
Go to the documentation of this file.
1 //===-- ScriptInterpreter.h -------------------------------------*- C++ -*-===//
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 #ifndef LLDB_INTERPRETER_SCRIPTINTERPRETER_H
10 #define LLDB_INTERPRETER_SCRIPTINTERPRETER_H
11 
12 #include "lldb/API/SBData.h"
13 #include "lldb/API/SBError.h"
17 #include "lldb/Core/SearchFilter.h"
18 #include "lldb/Core/StreamFile.h"
22 #include "lldb/Utility/Status.h"
24 #include "lldb/lldb-private.h"
25 
26 namespace lldb_private {
27 
29 public:
30  ScriptInterpreterLocker() = default;
31 
32  virtual ~ScriptInterpreterLocker() = default;
33 
34 private:
37  operator=(const ScriptInterpreterLocker &) = delete;
38 };
39 
41 public:
42  ExecuteScriptOptions() = default;
43 
44  bool GetEnableIO() const { return m_enable_io; }
45 
46  bool GetSetLLDBGlobals() const { return m_set_lldb_globals; }
47 
48  // If this is true then any exceptions raised by the script will be
49  // cleared with PyErr_Clear(). If false then they will be left for
50  // the caller to clean up
51  bool GetMaskoutErrors() const { return m_maskout_errors; }
52 
54  m_enable_io = enable;
55  return *this;
56  }
57 
60  return *this;
61  }
62 
64  m_maskout_errors = maskout;
65  return *this;
66  }
67 
68 private:
69  bool m_enable_io = true;
70  bool m_set_lldb_globals = true;
71  bool m_maskout_errors = true;
72 };
73 
75 public:
76  LoadScriptOptions() = default;
77 
78  bool GetInitSession() const { return m_init_session; }
79  bool GetSilent() const { return m_silent; }
80 
82  m_init_session = b;
83  return *this;
84  }
85 
87  m_silent = b;
88  return *this;
89  }
90 
91 private:
92  bool m_init_session = false;
93  bool m_silent = false;
94 };
95 
97 public:
98  /// Create an IO redirect. If IO is enabled, this will redirects the output
99  /// to the command return object if set or to the debugger otherwise. If IO
100  /// is disabled, it will redirect all IO to /dev/null.
101  static llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
102  Create(bool enable_io, Debugger &debugger, CommandReturnObject *result);
103 
105 
106  lldb::FileSP GetInputFile() const { return m_input_file_sp; }
107  lldb::FileSP GetOutputFile() const { return m_output_file_sp->GetFileSP(); }
108  lldb::FileSP GetErrorFile() const { return m_error_file_sp->GetFileSP(); }
109 
110  /// Flush our output and error file handles.
111  void Flush();
112 
113 private:
114  ScriptInterpreterIORedirect(std::unique_ptr<File> input,
115  std::unique_ptr<File> output);
117 
118  lldb::FileSP m_input_file_sp;
119  lldb::StreamFileSP m_output_file_sp;
120  lldb::StreamFileSP m_error_file_sp;
123 };
124 
126 public:
143  };
144 
146  Debugger &debugger, lldb::ScriptLanguage script_lang,
147  lldb::ScriptedProcessInterfaceUP scripted_process_interface_up =
148  std::make_unique<ScriptedProcessInterface>());
149 
150  ~ScriptInterpreter() override = default;
151 
152  virtual bool Interrupt() { return false; }
153 
154  virtual bool ExecuteOneLine(
155  llvm::StringRef command, CommandReturnObject *result,
156  const ExecuteScriptOptions &options = ExecuteScriptOptions()) = 0;
157 
158  virtual void ExecuteInterpreterLoop() = 0;
159 
161  llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value,
162  const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
163  return true;
164  }
165 
167  const char *in_string,
168  const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
169  Status error;
170  error.SetErrorString("not implemented");
171  return error;
172  }
173 
174  virtual Status
176  Status error;
177  error.SetErrorString("not implemented");
178  return error;
179  }
180 
182  StringList &input,
183  std::string &output,
184  bool has_extra_args) {
185  Status error;
186  error.SetErrorString("not implemented");
187  return error;
188  }
189 
191  std::string &output) {
192  return false;
193  }
194 
195  virtual bool GenerateTypeScriptFunction(const char *oneliner,
196  std::string &output,
197  const void *name_token = nullptr) {
198  return false;
199  }
200 
202  std::string &output,
203  const void *name_token = nullptr) {
204  return false;
205  }
206 
208  std::string &output) {
209  return false;
210  }
211 
212  virtual bool GenerateTypeSynthClass(StringList &input, std::string &output,
213  const void *name_token = nullptr) {
214  return false;
215  }
216 
217  virtual bool GenerateTypeSynthClass(const char *oneliner, std::string &output,
218  const void *name_token = nullptr) {
219  return false;
220  }
221 
223  CreateSyntheticScriptedProvider(const char *class_name,
224  lldb::ValueObjectSP valobj) {
225  return StructuredData::ObjectSP();
226  }
227 
229  CreateScriptCommandObject(const char *class_name) {
230  return StructuredData::GenericSP();
231  }
232 
234  CreateFrameRecognizer(const char *class_name) {
235  return StructuredData::GenericSP();
236  }
237 
238  virtual lldb::ValueObjectListSP GetRecognizedArguments(
239  const StructuredData::ObjectSP &implementor,
240  lldb::StackFrameSP frame_sp) {
241  return lldb::ValueObjectListSP();
242  }
243 
245  OSPlugin_CreatePluginObject(const char *class_name,
246  lldb::ProcessSP process_sp) {
247  return StructuredData::GenericSP();
248  }
249 
253  }
254 
257  return StructuredData::ArraySP();
258  }
259 
262  lldb::tid_t thread_id) {
263  return StructuredData::StringSP();
264  }
265 
268  lldb::tid_t tid, lldb::addr_t context) {
270  }
271 
273  CreateScriptedThreadPlan(const char *class_name,
274  StructuredDataImpl *args_data,
275  std::string &error_str,
276  lldb::ThreadPlanSP thread_plan_sp) {
277  return StructuredData::ObjectSP();
278  }
279 
280  virtual bool
282  Event *event, bool &script_error) {
283  script_error = true;
284  return true;
285  }
286 
287  virtual bool
289  Event *event, bool &script_error) {
290  script_error = true;
291  return true;
292  }
293 
294  virtual bool
296  bool &script_error) {
297  script_error = true;
298  return true;
299  }
300 
301  virtual lldb::StateType
303  bool &script_error) {
304  script_error = true;
305  return lldb::eStateStepping;
306  }
307 
309  CreateScriptedBreakpointResolver(const char *class_name,
310  StructuredDataImpl *args_data,
311  lldb::BreakpointSP &bkpt_sp) {
312  return StructuredData::GenericSP();
313  }
314 
315  virtual bool
317  SymbolContext *sym_ctx)
318  {
319  return false;
320  }
321 
322  virtual lldb::SearchDepth
324  {
326  }
327 
329  CreateScriptedStopHook(lldb::TargetSP target_sp, const char *class_name,
330  StructuredDataImpl *args_data, Status &error) {
331  error.SetErrorString("Creating scripted stop-hooks with the current "
332  "script interpreter is not supported.");
333  return StructuredData::GenericSP();
334  }
335 
336  // This dispatches to the handle_stop method of the stop-hook class. It
337  // returns a "should_stop" bool.
338  virtual bool
340  ExecutionContext &exc_ctx,
341  lldb::StreamSP stream_sp) {
342  return true;
343  }
344 
347  return StructuredData::ObjectSP();
348  }
349 
352  const char *setting_name, lldb_private::Status &error) {
354  }
355 
356  virtual Status GenerateFunction(const char *signature,
357  const StringList &input) {
358  Status error;
359  error.SetErrorString("unimplemented");
360  return error;
361  }
362 
364  std::vector<std::reference_wrapper<BreakpointOptions>> &options,
365  CommandReturnObject &result);
366 
367  virtual void
369  CommandReturnObject &result);
370 
371  /// Set the specified text as the callback for the breakpoint.
373  std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
374  const char *callback_text);
375 
377  const char *callback_text) {
378  Status error;
379  error.SetErrorString("unimplemented");
380  return error;
381  }
382 
383  /// This one is for deserialization:
385  BreakpointOptions &bp_options,
386  std::unique_ptr<BreakpointOptions::CommandData> &data_up) {
387  Status error;
388  error.SetErrorString("unimplemented");
389  return error;
390  }
391 
393  std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
394  const char *function_name, StructuredData::ObjectSP extra_args_sp);
395 
396  /// Set a script function as the callback for the breakpoint.
397  virtual Status
399  const char *function_name,
400  StructuredData::ObjectSP extra_args_sp) {
401  Status error;
402  error.SetErrorString("unimplemented");
403  return error;
404  }
405 
406  /// Set a one-liner as the callback for the watchpoint.
408  const char *oneliner) {}
409 
410  virtual bool GetScriptedSummary(const char *function_name,
411  lldb::ValueObjectSP valobj,
412  StructuredData::ObjectSP &callee_wrapper_sp,
413  const TypeSummaryOptions &options,
414  std::string &retval) {
415  return false;
416  }
417 
418  virtual void Clear() {
419  // Clean up any ref counts to SBObjects that might be in global variables
420  }
421 
422  virtual size_t
424  uint32_t max) {
425  return 0;
426  }
427 
428  virtual lldb::ValueObjectSP
430  return lldb::ValueObjectSP();
431  }
432 
433  virtual int
435  const char *child_name) {
436  return UINT32_MAX;
437  }
438 
439  virtual bool
441  return false;
442  }
443 
445  const StructuredData::ObjectSP &implementor) {
446  return true;
447  }
448 
449  virtual lldb::ValueObjectSP
451  return nullptr;
452  }
453 
454  virtual ConstString
456  return ConstString();
457  }
458 
459  virtual bool
460  RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
461  ScriptedCommandSynchronicity synchronicity,
463  Status &error,
464  const lldb_private::ExecutionContext &exe_ctx) {
465  return false;
466  }
467 
468  virtual bool RunScriptBasedCommand(
469  StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
470  ScriptedCommandSynchronicity synchronicity,
472  const lldb_private::ExecutionContext &exe_ctx) {
473  return false;
474  }
475 
476  virtual bool RunScriptFormatKeyword(const char *impl_function,
477  Process *process, std::string &output,
478  Status &error) {
479  error.SetErrorString("unimplemented");
480  return false;
481  }
482 
483  virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread,
484  std::string &output, Status &error) {
485  error.SetErrorString("unimplemented");
486  return false;
487  }
488 
489  virtual bool RunScriptFormatKeyword(const char *impl_function, Target *target,
490  std::string &output, Status &error) {
491  error.SetErrorString("unimplemented");
492  return false;
493  }
494 
495  virtual bool RunScriptFormatKeyword(const char *impl_function,
496  StackFrame *frame, std::string &output,
497  Status &error) {
498  error.SetErrorString("unimplemented");
499  return false;
500  }
501 
502  virtual bool RunScriptFormatKeyword(const char *impl_function,
503  ValueObject *value, std::string &output,
504  Status &error) {
505  error.SetErrorString("unimplemented");
506  return false;
507  }
508 
509  virtual bool GetDocumentationForItem(const char *item, std::string &dest) {
510  dest.clear();
511  return false;
512  }
513 
514  virtual bool
516  std::string &dest) {
517  dest.clear();
518  return false;
519  }
520 
521  virtual uint32_t
523  return 0;
524  }
525 
527  std::string &dest) {
528  dest.clear();
529  return false;
530  }
531 
532  virtual bool CheckObjectExists(const char *name) { return false; }
533 
534  virtual bool
535  LoadScriptingModule(const char *filename, const LoadScriptOptions &options,
537  StructuredData::ObjectSP *module_sp = nullptr,
538  FileSpec extra_search_dir = {});
539 
540  virtual bool IsReservedWord(const char *word) { return false; }
541 
542  virtual std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock();
543 
544  const char *GetScriptInterpreterPtyName();
545 
546  virtual llvm::Expected<unsigned>
547  GetMaxPositionalArgumentsForCallable(const llvm::StringRef &callable_name) {
548  return llvm::createStringError(
549  llvm::inconvertibleErrorCode(), "Unimplemented function");
550  }
551 
553 
554  static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string);
555 
557 
560  }
561 
562  lldb::DataExtractorSP
563  GetDataExtractorFromSBData(const lldb::SBData &data) const;
564 
566 
567 protected:
570  lldb::ScriptedProcessInterfaceUP m_scripted_process_interface_up;
571 };
572 
573 } // namespace lldb_private
574 
575 #endif // LLDB_INTERPRETER_SCRIPTINTERPRETER_H
lldb_private::ScriptInterpreter::RunScriptBasedCommand
virtual bool RunScriptBasedCommand(StructuredData::GenericSP impl_obj_sp, llvm::StringRef args, ScriptedCommandSynchronicity synchronicity, lldb_private::CommandReturnObject &cmd_retobj, Status &error, const lldb_private::ExecutionContext &exe_ctx)
Definition: ScriptInterpreter.h:468
lldb_private::ScriptInterpreter::SetBreakpointCommandCallback
Status SetBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions >> &bp_options_vec, const char *callback_text)
Set the specified text as the callback for the breakpoint.
Definition: ScriptInterpreter.cpp:97
lldb_private::ScriptInterpreter::SetBreakpointCommandCallback
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, std::unique_ptr< BreakpointOptions::CommandData > &data_up)
This one is for deserialization:
Definition: ScriptInterpreter.h:384
lldb_private::ExecuteScriptOptions::GetEnableIO
bool GetEnableIO() const
Definition: ScriptInterpreter.h:44
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::ExecuteScriptOptions::GetMaskoutErrors
bool GetMaskoutErrors() const
Definition: ScriptInterpreter.h:51
lldb::ScriptLanguage
ScriptLanguage
Script interpreter types.
Definition: lldb-enumerations.h:216
lldb::SearchDepth
SearchDepth
Definition: lldb-enumerations.h:283
lldb_private::ScriptInterpreterIORedirect
Definition: ScriptInterpreter.h:96
lldb_private::Event
Definition: Event.h:180
lldb_private::ScriptInterpreter::ExecuteMultipleLines
virtual Status ExecuteMultipleLines(const char *in_string, const ExecuteScriptOptions &options=ExecuteScriptOptions())
Definition: ScriptInterpreter.h:166
lldb_private::ScriptInterpreter::GenerateTypeSynthClass
virtual bool GenerateTypeSynthClass(const char *oneliner, std::string &output, const void *name_token=nullptr)
Definition: ScriptInterpreter.h:217
lldb_private::ScriptInterpreter::GetScriptInterpreterPtyName
const char * GetScriptInterpreterPtyName()
lldb_private::StructuredData::GenericSP
std::shared_ptr< Generic > GenericSP
Definition: StructuredData.h:68
StructuredData.h
lldb_private::ScriptInterpreter::ScriptedBreakpointResolverSearchDepth
virtual lldb::SearchDepth ScriptedBreakpointResolverSearchDepth(StructuredData::GenericSP implementor_sp)
Definition: ScriptInterpreter.h:323
lldb_private::ScriptInterpreter::OSPlugin_RegisterInfo
virtual StructuredData::DictionarySP OSPlugin_RegisterInfo(StructuredData::ObjectSP os_plugin_object_sp)
Definition: ScriptInterpreter.h:251
lldb::SBError
Definition: SBError.h:20
lldb_private::ScriptInterpreterIORedirect::GetErrorFile
lldb::FileSP GetErrorFile() const
Definition: ScriptInterpreter.h:108
lldb_private::ScriptInterpreter::GetIndexOfChildWithName
virtual int GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor, const char *child_name)
Definition: ScriptInterpreter.h:434
lldb_private::ScriptInterpreter::GetRecognizedArguments
virtual lldb::ValueObjectListSP GetRecognizedArguments(const StructuredData::ObjectSP &implementor, lldb::StackFrameSP frame_sp)
Definition: ScriptInterpreter.h:238
lldb_private::PluginInterface
Definition: PluginInterface.h:16
lldb_private::ScriptInterpreter::eScriptReturnTypeLongIntUnsigned
@ eScriptReturnTypeLongIntUnsigned
Definition: ScriptInterpreter.h:135
lldb_private::ScriptInterpreterIORedirect::m_error_file_sp
lldb::StreamFileSP m_error_file_sp
Definition: ScriptInterpreter.h:120
lldb_private::ExecuteScriptOptions::m_enable_io
bool m_enable_io
Definition: ScriptInterpreter.h:69
lldb_private::ScriptInterpreter::OSPlugin_CreatePluginObject
virtual StructuredData::GenericSP OSPlugin_CreatePluginObject(const char *class_name, lldb::ProcessSP process_sp)
Definition: ScriptInterpreter.h:245
lldb_private::ScriptInterpreter::LoadScriptingModule
virtual bool LoadScriptingModule(const char *filename, const LoadScriptOptions &options, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={})
Definition: ScriptInterpreter.cpp:49
lldb_private::ScriptInterpreter::CheckObjectExists
virtual bool CheckObjectExists(const char *name)
Definition: ScriptInterpreter.h:532
lldb_private::Process
Definition: Process.h:342
lldb_private::ScriptInterpreter::GetStatusFromSBError
Status GetStatusFromSBError(const lldb::SBError &error) const
Definition: ScriptInterpreter.cpp:79
lldb_private::ScriptInterpreter::StringToLanguage
static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string)
Definition: ScriptInterpreter.cpp:87
lldb_private::ScriptInterpreter::eScriptReturnTypeCharStrOrNone
@ eScriptReturnTypeCharStrOrNone
Definition: ScriptInterpreter.h:141
lldb_private::ScriptInterpreter::GenerateScriptAliasFunction
virtual bool GenerateScriptAliasFunction(StringList &input, std::string &output)
Definition: ScriptInterpreter.h:207
lldb_private::ScriptInterpreter::SetBreakpointCommandCallbackFunction
Status SetBreakpointCommandCallbackFunction(std::vector< std::reference_wrapper< BreakpointOptions >> &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp)
Definition: ScriptInterpreter.cpp:109
lldb_private::ScriptInterpreter::Interrupt
virtual bool Interrupt()
Definition: ScriptInterpreter.h:152
ScriptedProcessInterface.h
lldb_private::ScriptInterpreter::ScriptedBreakpointResolverSearchCallback
virtual bool ScriptedBreakpointResolverSearchCallback(StructuredData::GenericSP implementor_sp, SymbolContext *sym_ctx)
Definition: ScriptInterpreter.h:316
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::ScriptInterpreter::GetDynamicSettings
virtual StructuredData::DictionarySP GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target, const char *setting_name, lldb_private::Status &error)
Definition: ScriptInterpreter.h:351
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:137
lldb_private::ScriptInterpreter::eScriptReturnTypeBool
@ eScriptReturnTypeBool
Definition: ScriptInterpreter.h:129
lldb_private::ScriptInterpreter::GetScriptedProcessInterface
ScriptedProcessInterface & GetScriptedProcessInterface()
Definition: ScriptInterpreter.h:558
lldb_private::LoadScriptOptions::GetInitSession
bool GetInitSession() const
Definition: ScriptInterpreter.h:78
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:454
lldb_private::ScriptInterpreter::eScriptReturnTypeLongLongUnsigned
@ eScriptReturnTypeLongLongUnsigned
Definition: ScriptInterpreter.h:137
lldb_private::ScriptInterpreter::OSPlugin_RegisterContextData
virtual StructuredData::StringSP OSPlugin_RegisterContextData(StructuredData::ObjectSP os_plugin_object_sp, lldb::tid_t thread_id)
Definition: ScriptInterpreter.h:261
lldb_private::ScriptInterpreter::ExecuteOneLine
virtual bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions())=0
lldb_private::ScriptInterpreter::eScriptReturnTypeDouble
@ eScriptReturnTypeDouble
Definition: ScriptInterpreter.h:139
lldb_private::ScriptInterpreter::GetDataExtractorFromSBData
lldb::DataExtractorSP GetDataExtractorFromSBData(const lldb::SBData &data) const
Definition: ScriptInterpreter.cpp:74
lldb_private::ScriptInterpreter::RunScriptFormatKeyword
virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread, std::string &output, Status &error)
Definition: ScriptInterpreter.h:483
lldb_private::ScriptInterpreter::CreateScriptedThreadPlan
virtual StructuredData::ObjectSP CreateScriptedThreadPlan(const char *class_name, StructuredDataImpl *args_data, std::string &error_str, lldb::ThreadPlanSP thread_plan_sp)
Definition: ScriptInterpreter.h:273
lldb_private::ScriptInterpreter::CalculateNumChildren
virtual size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor, uint32_t max)
Definition: ScriptInterpreter.h:423
lldb_private::ScriptInterpreter::m_debugger
Debugger & m_debugger
Definition: ScriptInterpreter.h:568
Broadcaster.h
lldb_private::ScriptInterpreter::ScriptedThreadPlanGetRunState
virtual lldb::StateType ScriptedThreadPlanGetRunState(StructuredData::ObjectSP implementor_sp, bool &script_error)
Definition: ScriptInterpreter.h:302
lldb_private::Communication
Definition: Communication.h:84
lldb_private::ScriptInterpreterIORedirect::ScriptInterpreterIORedirect
ScriptInterpreterIORedirect(std::unique_ptr< File > input, std::unique_ptr< File > output)
Definition: ScriptInterpreter.cpp:157
lldb_private::ScriptInterpreter::GetLanguage
lldb::ScriptLanguage GetLanguage()
Definition: ScriptInterpreter.h:556
lldb_private::FileSpec
Definition: FileSpec.h:56
SBData.h
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::ScriptInterpreter::eScriptReturnTypeShortIntUnsigned
@ eScriptReturnTypeShortIntUnsigned
Definition: ScriptInterpreter.h:131
lldb_private::ScriptInterpreterLocker::ScriptInterpreterLocker
ScriptInterpreterLocker()=default
lldb_private::StructuredData::StringSP
std::shared_ptr< String > StringSP
Definition: StructuredData.h:66
lldb_private::ScriptInterpreter::SetBreakpointCommandCallback
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *callback_text)
Definition: ScriptInterpreter.h:376
lldb_private::ScriptInterpreter::CollectDataForWatchpointCommandCallback
virtual void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result)
Definition: ScriptInterpreter.cpp:43
lldb_private::ScriptInterpreter::ScriptInterpreter
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang, lldb::ScriptedProcessInterfaceUP scripted_process_interface_up=std::make_unique< ScriptedProcessInterface >())
Definition: ScriptInterpreter.cpp:29
lldb_private::ExecuteScriptOptions::SetSetLLDBGlobals
ExecuteScriptOptions & SetSetLLDBGlobals(bool set)
Definition: ScriptInterpreter.h:58
lldb_private::LoadScriptOptions::LoadScriptOptions
LoadScriptOptions()=default
lldb_private::ScriptInterpreter::GetSyntheticValue
virtual lldb::ValueObjectSP GetSyntheticValue(const StructuredData::ObjectSP &implementor)
Definition: ScriptInterpreter.h:450
lldb_private::ScriptInterpreterIORedirect::GetOutputFile
lldb::FileSP GetOutputFile() const
Definition: ScriptInterpreter.h:107
SearchFilter.h
lldb_private::Thread
Definition: Thread.h:62
lldb_private::ScriptInterpreter::eScriptReturnTypeFloat
@ eScriptReturnTypeFloat
Definition: ScriptInterpreter.h:138
lldb_private::ScriptInterpreter::eScriptReturnTypeOpaqueObject
@ eScriptReturnTypeOpaqueObject
Definition: ScriptInterpreter.h:142
lldb_private::ScriptInterpreter::ExecuteOneLineWithReturn
virtual bool ExecuteOneLineWithReturn(llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value, const ExecuteScriptOptions &options=ExecuteScriptOptions())
Definition: ScriptInterpreter.h:160
lldb_private::ScriptInterpreter::GenerateTypeScriptFunction
virtual bool GenerateTypeScriptFunction(StringList &input, std::string &output, const void *name_token=nullptr)
Definition: ScriptInterpreter.h:201
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::ExecuteScriptOptions::SetMaskoutErrors
ExecuteScriptOptions & SetMaskoutErrors(bool maskout)
Definition: ScriptInterpreter.h:63
lldb_private::WatchpointOptions
Definition: WatchpointOptions.h:25
lldb_private::ScriptInterpreter::ScriptReturnType
ScriptReturnType
Definition: ScriptInterpreter.h:127
lldb_private::ScriptInterpreter::m_scripted_process_interface_up
lldb::ScriptedProcessInterfaceUP m_scripted_process_interface_up
Definition: ScriptInterpreter.h:570
lldb_private::ScriptInterpreter::OSPlugin_ThreadsInfo
virtual StructuredData::ArraySP OSPlugin_ThreadsInfo(StructuredData::ObjectSP os_plugin_object_sp)
Definition: ScriptInterpreter.h:256
lldb_private::ScriptInterpreter::Clear
virtual void Clear()
Definition: ScriptInterpreter.h:418
lldb_private::StringList
Definition: StringList.h:25
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::ScriptInterpreter::eScriptReturnTypeLongLong
@ eScriptReturnTypeLongLong
Definition: ScriptInterpreter.h:136
lldb_private::BreakpointOptions
Definition: BreakpointOptions.h:27
lldb_private::ScriptInterpreterIORedirect::m_disconnect
bool m_disconnect
Definition: ScriptInterpreter.h:122
lldb_private::StructuredDataImpl
Definition: StructuredDataImpl.h:26
lldb_private::ScriptInterpreter::RunScriptBasedCommand
virtual bool RunScriptBasedCommand(const char *impl_function, llvm::StringRef args, ScriptedCommandSynchronicity synchronicity, lldb_private::CommandReturnObject &cmd_retobj, Status &error, const lldb_private::ExecutionContext &exe_ctx)
Definition: ScriptInterpreter.h:460
PluginInterface.h
lldb_private::LoadScriptOptions::m_silent
bool m_silent
Definition: ScriptInterpreter.h:93
lldb_private::ScriptInterpreter::eScriptReturnTypeIntUnsigned
@ eScriptReturnTypeIntUnsigned
Definition: ScriptInterpreter.h:133
lldb_private::ExecuteScriptOptions
Definition: ScriptInterpreter.h:40
lldb_private::ScriptInterpreter::ExecuteInterpreterLoop
virtual void ExecuteInterpreterLoop()=0
lldb_private::ScriptInterpreter::GetDocumentationForItem
virtual bool GetDocumentationForItem(const char *item, std::string &dest)
Definition: ScriptInterpreter.h:509
lldb_private::ScriptInterpreter::GetSyntheticTypeName
virtual ConstString GetSyntheticTypeName(const StructuredData::ObjectSP &implementor)
Definition: ScriptInterpreter.h:455
lldb_private::ScriptInterpreter::GenerateBreakpointCommandCallbackData
virtual Status GenerateBreakpointCommandCallbackData(StringList &input, std::string &output, bool has_extra_args)
Definition: ScriptInterpreter.h:181
lldb_private::StructuredData::DictionarySP
std::shared_ptr< Dictionary > DictionarySP
Definition: StructuredData.h:67
lldb_private::Debugger
Definition: Debugger.h:70
lldb_private::ScriptInterpreter::eScriptReturnTypeInt
@ eScriptReturnTypeInt
Definition: ScriptInterpreter.h:132
lldb_private::ScriptInterpreterIORedirect::m_communication
Communication m_communication
Definition: ScriptInterpreter.h:121
lldb_private::ScriptInterpreter::RunScriptFormatKeyword
virtual bool RunScriptFormatKeyword(const char *impl_function, Process *process, std::string &output, Status &error)
Definition: ScriptInterpreter.h:476
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:9
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
Communication.h
lldb_private::ScriptInterpreter::GetScriptedSummary
virtual bool GetScriptedSummary(const char *function_name, lldb::ValueObjectSP valobj, StructuredData::ObjectSP &callee_wrapper_sp, const TypeSummaryOptions &options, std::string &retval)
Definition: ScriptInterpreter.h:410
lldb_private::LoadScriptOptions::SetInitSession
LoadScriptOptions & SetInitSession(bool b)
Definition: ScriptInterpreter.h:81
lldb_private::ScriptInterpreterIORedirect::~ScriptInterpreterIORedirect
~ScriptInterpreterIORedirect()
Definition: ScriptInterpreter.cpp:216
lldb_private::ExecuteScriptOptions::GetSetLLDBGlobals
bool GetSetLLDBGlobals() const
Definition: ScriptInterpreter.h:46
lldb_private::ScriptInterpreterLocker::operator=
const ScriptInterpreterLocker & operator=(const ScriptInterpreterLocker &)=delete
lldb_private::ScriptInterpreter::CreateFrameRecognizer
virtual StructuredData::GenericSP CreateFrameRecognizer(const char *class_name)
Definition: ScriptInterpreter.h:234
lldb_private::ScriptInterpreter::CreateScriptedBreakpointResolver
virtual StructuredData::GenericSP CreateScriptedBreakpointResolver(const char *class_name, StructuredDataImpl *args_data, lldb::BreakpointSP &bkpt_sp)
Definition: ScriptInterpreter.h:309
lldb_private::ScriptInterpreter::GenerateFunction
virtual Status GenerateFunction(const char *signature, const StringList &input)
Definition: ScriptInterpreter.h:356
lldb_private::ScriptInterpreter::UpdateSynthProviderInstance
virtual bool UpdateSynthProviderInstance(const StructuredData::ObjectSP &implementor)
Definition: ScriptInterpreter.h:440
BreakpointOptions.h
lldb_private::ScriptInterpreter::GenerateTypeSynthClass
virtual bool GenerateTypeSynthClass(StringList &input, std::string &output, const void *name_token=nullptr)
Definition: ScriptInterpreter.h:212
lldb-private.h
lldb_private::ScriptInterpreter::eScriptReturnTypeShortInt
@ eScriptReturnTypeShortInt
Definition: ScriptInterpreter.h:130
lldb_private::ScriptInterpreter::SetWatchpointCommandCallback
virtual void SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *oneliner)
Set a one-liner as the callback for the watchpoint.
Definition: ScriptInterpreter.h:407
lldb::eSearchDepthModule
@ eSearchDepthModule
Definition: lldb-enumerations.h:286
lldb_private::ScriptInterpreter::ScriptedStopHookHandleStop
virtual bool ScriptedStopHookHandleStop(StructuredData::GenericSP implementor_sp, ExecutionContext &exc_ctx, lldb::StreamSP stream_sp)
Definition: ScriptInterpreter.h:339
lldb_private::ScriptInterpreter::IsReservedWord
virtual bool IsReservedWord(const char *word)
Definition: ScriptInterpreter.h:540
StreamFile.h
lldb::eStateStepping
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
Definition: lldb-enumerations.h:86
lldb_private::ScriptInterpreter::MightHaveChildrenSynthProviderInstance
virtual bool MightHaveChildrenSynthProviderInstance(const StructuredData::ObjectSP &implementor)
Definition: ScriptInterpreter.h:444
lldb_private::ScriptInterpreter::eScriptReturnTypeCharPtr
@ eScriptReturnTypeCharPtr
Definition: ScriptInterpreter.h:128
lldb_private::ScriptInterpreter::GetShortHelpForCommandObject
virtual bool GetShortHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp, std::string &dest)
Definition: ScriptInterpreter.h:515
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::ExecuteScriptOptions::m_maskout_errors
bool m_maskout_errors
Definition: ScriptInterpreter.h:71
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:25
uint32_t
lldb_private::ScriptInterpreter::RunScriptFormatKeyword
virtual bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value, std::string &output, Status &error)
Definition: ScriptInterpreter.h:502
lldb_private::ExecuteScriptOptions::SetEnableIO
ExecuteScriptOptions & SetEnableIO(bool enable)
Definition: ScriptInterpreter.h:53
lldb_private::ScriptedProcessInterface
Definition: ScriptedProcessInterface.h:21
lldb_private::ScriptInterpreter::ScriptedThreadPlanIsStale
virtual bool ScriptedThreadPlanIsStale(StructuredData::ObjectSP implementor_sp, bool &script_error)
Definition: ScriptInterpreter.h:295
lldb_private::ScriptInterpreter::OSPlugin_CreateThread
virtual StructuredData::DictionarySP OSPlugin_CreateThread(StructuredData::ObjectSP os_plugin_object_sp, lldb::tid_t tid, lldb::addr_t context)
Definition: ScriptInterpreter.h:267
lldb_private::ScriptInterpreter::GenerateWatchpointCommandCallbackData
virtual bool GenerateWatchpointCommandCallbackData(StringList &input, std::string &output)
Definition: ScriptInterpreter.h:190
lldb_private::ScriptInterpreter::SetBreakpointCommandCallbackFunction
virtual Status SetBreakpointCommandCallbackFunction(BreakpointOptions &bp_options, const char *function_name, StructuredData::ObjectSP extra_args_sp)
Set a script function as the callback for the breakpoint.
Definition: ScriptInterpreter.h:398
lldb::SBData
Definition: SBData.h:20
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::ScriptInterpreterLocker
Definition: ScriptInterpreter.h:28
lldb_private::ScriptInterpreter::~ScriptInterpreter
~ScriptInterpreter() override=default
lldb_private::ScriptInterpreter::LanguageToString
static std::string LanguageToString(lldb::ScriptLanguage language)
Definition: ScriptInterpreter.cpp:59
PseudoTerminal.h
lldb_private::TypeSummaryOptions
Definition: TypeSummary.h:26
lldb_private::ScriptInterpreter::ExportFunctionDefinitionToInterpreter
virtual Status ExportFunctionDefinitionToInterpreter(StringList &function_def)
Definition: ScriptInterpreter.h:175
lldb_private::ScriptInterpreter::CreateScriptedStopHook
virtual StructuredData::GenericSP CreateScriptedStopHook(lldb::TargetSP target_sp, const char *class_name, StructuredDataImpl *args_data, Status &error)
Definition: ScriptInterpreter.h:329
lldb_private::ScriptInterpreter::CreateSyntheticScriptedProvider
virtual StructuredData::ObjectSP CreateSyntheticScriptedProvider(const char *class_name, lldb::ValueObjectSP valobj)
Definition: ScriptInterpreter.h:223
lldb_private::ScriptInterpreter
Definition: ScriptInterpreter.h:125
lldb_private::ScriptInterpreter::RunScriptFormatKeyword
virtual bool RunScriptFormatKeyword(const char *impl_function, Target *target, std::string &output, Status &error)
Definition: ScriptInterpreter.h:489
lldb_private::ScriptInterpreterIORedirect::Flush
void Flush()
Flush our output and error file handles.
Definition: ScriptInterpreter.cpp:209
lldb_private::ScriptInterpreter::GetMaxPositionalArgumentsForCallable
virtual llvm::Expected< unsigned > GetMaxPositionalArgumentsForCallable(const llvm::StringRef &callable_name)
Definition: ScriptInterpreter.h:547
lldb_private::ScriptInterpreter::AcquireInterpreterLock
virtual std::unique_ptr< ScriptInterpreterLocker > AcquireInterpreterLock()
Definition: ScriptInterpreter.cpp:123
lldb_private::LoadScriptOptions::SetSilent
LoadScriptOptions & SetSilent(bool b)
Definition: ScriptInterpreter.h:86
lldb_private::ScriptInterpreter::eScriptReturnTypeLongInt
@ eScriptReturnTypeLongInt
Definition: ScriptInterpreter.h:134
lldb_private::ExecuteScriptOptions::ExecuteScriptOptions
ExecuteScriptOptions()=default
lldb_private::ScriptInterpreter::GetFlagsForCommandObject
virtual uint32_t GetFlagsForCommandObject(StructuredData::GenericSP cmd_obj_sp)
Definition: ScriptInterpreter.h:522
lldb_private::ScriptInterpreterIORedirect::m_input_file_sp
lldb::FileSP m_input_file_sp
Definition: ScriptInterpreter.h:118
Status.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ScriptInterpreter::ScriptedThreadPlanExplainsStop
virtual bool ScriptedThreadPlanExplainsStop(StructuredData::ObjectSP implementor_sp, Event *event, bool &script_error)
Definition: ScriptInterpreter.h:281
lldb_private::LoadScriptOptions::m_init_session
bool m_init_session
Definition: ScriptInterpreter.h:92
lldb_private::ScriptInterpreter::GenerateTypeScriptFunction
virtual bool GenerateTypeScriptFunction(const char *oneliner, std::string &output, const void *name_token=nullptr)
Definition: ScriptInterpreter.h:195
lldb_private::ScriptInterpreter::CreateScriptCommandObject
virtual StructuredData::GenericSP CreateScriptCommandObject(const char *class_name)
Definition: ScriptInterpreter.h:229
lldb_private::ScriptInterpreter::GetChildAtIndex
virtual lldb::ValueObjectSP GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx)
Definition: ScriptInterpreter.h:429
lldb_private::LoadScriptOptions
Definition: ScriptInterpreter.h:74
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::StructuredData::ArraySP
std::shared_ptr< Array > ArraySP
Definition: StructuredData.h:62
lldb_private::ExecuteScriptOptions::m_set_lldb_globals
bool m_set_lldb_globals
Definition: ScriptInterpreter.h:70
lldb_private::ScriptInterpreter::LoadPluginModule
virtual StructuredData::ObjectSP LoadPluginModule(const FileSpec &file_spec, lldb_private::Status &error)
Definition: ScriptInterpreter.h:346
lldb_private::ScriptInterpreter::RunScriptFormatKeyword
virtual bool RunScriptFormatKeyword(const char *impl_function, StackFrame *frame, std::string &output, Status &error)
Definition: ScriptInterpreter.h:495
lldb_private::ScriptInterpreter::GetLongHelpForCommandObject
virtual bool GetLongHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp, std::string &dest)
Definition: ScriptInterpreter.h:526
lldb_private::ScriptInterpreter::eScriptReturnTypeChar
@ eScriptReturnTypeChar
Definition: ScriptInterpreter.h:140
lldb_private::ScriptInterpreterIORedirect::m_output_file_sp
lldb::StreamFileSP m_output_file_sp
Definition: ScriptInterpreter.h:119
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::ScriptInterpreter::m_script_lang
lldb::ScriptLanguage m_script_lang
Definition: ScriptInterpreter.h:569
lldb_private::ScriptInterpreterLocker::~ScriptInterpreterLocker
virtual ~ScriptInterpreterLocker()=default
lldb_private::ScriptedCommandSynchronicity
ScriptedCommandSynchronicity
Definition: lldb-private-enumerations.h:152
SBError.h
lldb_private::ScriptInterpreter::ScriptedThreadPlanShouldStop
virtual bool ScriptedThreadPlanShouldStop(StructuredData::ObjectSP implementor_sp, Event *event, bool &script_error)
Definition: ScriptInterpreter.h:288
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
lldb_private::LoadScriptOptions::GetSilent
bool GetSilent() const
Definition: ScriptInterpreter.h:79
lldb_private::ScriptInterpreter::CollectDataForBreakpointCommandCallback
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions >> &options, CommandReturnObject &result)
Definition: ScriptInterpreter.cpp:36
lldb_private::ScriptInterpreterIORedirect::GetInputFile
lldb::FileSP GetInputFile() const
Definition: ScriptInterpreter.h:106