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