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
15#include "lldb/API/SBData.h"
16#include "lldb/API/SBError.h"
17#include "lldb/API/SBEvent.h"
22#include "lldb/API/SBStream.h"
24#include "lldb/API/SBThread.h"
40#include "lldb/Utility/Status.h"
43#include "lldb/lldb-private.h"
44#include <optional>
45
46namespace lldb_private {
47
49public:
51
52 virtual ~ScriptInterpreterLocker() = default;
53
54private:
58};
59
61public:
63
64 bool GetEnableIO() const { return m_enable_io; }
65
66 bool GetSetLLDBGlobals() const { return m_set_lldb_globals; }
67
68 // If this is true then any exceptions raised by the script will be
69 // cleared with PyErr_Clear(). If false then they will be left for
70 // the caller to clean up
71 bool GetMaskoutErrors() const { return m_maskout_errors; }
72
74 m_enable_io = enable;
75 return *this;
76 }
77
80 return *this;
81 }
82
84 m_maskout_errors = maskout;
85 return *this;
86 }
87
88private:
89 bool m_enable_io = true;
90 bool m_set_lldb_globals = true;
91 bool m_maskout_errors = true;
92};
93
95public:
96 LoadScriptOptions() = default;
97
98 bool GetInitSession() const { return m_init_session; }
99 bool GetSilent() const { return m_silent; }
100
102 m_init_session = b;
103 return *this;
104 }
105
107 m_silent = b;
108 return *this;
109 }
110
111private:
112 bool m_init_session = false;
113 bool m_silent = false;
114};
115
117public:
118 /// Create an IO redirect. If IO is enabled, this will redirects the output
119 /// to the command return object if set or to the debugger otherwise. If IO
120 /// is disabled, it will redirect all IO to /dev/null.
121 static llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
122 Create(bool enable_io, Debugger &debugger, CommandReturnObject *result);
123
125
128 return m_output_file_sp->GetUnlockedFileSP();
129 }
131 return m_error_file_sp->GetUnlockedFileSP();
132 }
133
134 /// Flush our output and error file handles.
135 void Flush();
136
137private:
138 ScriptInterpreterIORedirect(std::unique_ptr<File> input,
139 std::unique_ptr<File> output);
141
148};
149
151public:
169
170 ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang);
171
173
174 /// Describes one extension to emit into the generated template file.
175 ///
176 /// `full_name` is the dotted extension name as the user typed it (e.g.
177 /// `"ScriptedProcess"` or a nested `"...ChildKind"`), used to name the
178 /// generated class. `path` is the same name split on `.`; its last element
179 /// selects the ScriptedExtension kind and everything before it is treated
180 /// as a subclass discriminator. Both StringRefs must outlive the call to
181 /// GenerateExtensionTemplate; the implementation stores them, not copies.
183 llvm::StringRef full_name;
184 llvm::SmallVector<llvm::StringRef> path;
185 };
186
187 virtual llvm::Expected<FileSpec>
188 GenerateExtensionTemplate(const std::string &name,
189 std::vector<ExtensionTemplateRequest> &extensions,
190 bool generate_non_abstract_methods,
191 std::string output_file);
192
193 ~ScriptInterpreter() override = default;
194
195 virtual bool Interrupt() { return false; }
196
197 virtual bool ExecuteOneLine(
198 llvm::StringRef command, CommandReturnObject *result,
199 const ExecuteScriptOptions &options = ExecuteScriptOptions()) = 0;
200
201 virtual void ExecuteInterpreterLoop() = 0;
202
204 llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value,
205 const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
206 return true;
207 }
208
210 const char *in_string,
211 const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
212 return Status::FromErrorString("not implemented");
213 }
214
215 virtual Status
217 return Status::FromErrorString("not implemented");
218 }
219
221 std::string &output,
222 bool has_extra_args,
223 bool is_callback) {
224 return Status::FromErrorString("not implemented");
225 }
226
228 std::string &output,
229 bool is_callback) {
230 return false;
231 }
232
233 virtual bool GenerateTypeScriptFunction(const char *oneliner,
234 std::string &output,
235 const void *name_token = nullptr) {
236 return false;
237 }
238
240 std::string &output,
241 const void *name_token = nullptr) {
242 return false;
243 }
244
246 std::string &output) {
247 return false;
248 }
249
250 virtual bool GenerateTypeSynthClass(StringList &input, std::string &output,
251 const void *name_token = nullptr) {
252 return false;
253 }
254
255 virtual bool GenerateTypeSynthClass(const char *oneliner, std::string &output,
256 const void *name_token = nullptr) {
257 return false;
258 }
259
261 CreateSyntheticScriptedProvider(const char *class_name,
262 lldb::ValueObjectSP valobj) {
264 }
265
267 CreateScriptCommandObject(const char *class_name) {
269 }
270
275
278 const char *setting_name, lldb_private::Status &error) {
280 }
281
282 virtual Status GenerateFunction(const char *signature,
283 const StringList &input,
284 bool is_callback) {
285 return Status::FromErrorString("not implemented");
286 }
287
289 std::vector<std::reference_wrapper<BreakpointOptions>> &options,
290 CommandReturnObject &result);
291
292 virtual void
294 CommandReturnObject &result);
295
296 /// Set the specified text as the callback for the breakpoint.
298 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
299 const char *callback_text);
300
302 const char *callback_text,
303 bool is_callback) {
304 return Status::FromErrorString("not implemented");
305 }
306
307 /// This one is for deserialization:
309 BreakpointOptions &bp_options,
310 std::unique_ptr<BreakpointOptions::CommandData> &data_up) {
311 return Status::FromErrorString("not implemented");
312 }
313
315 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
316 const char *function_name, StructuredData::ObjectSP extra_args_sp);
317
318 /// Set a script function as the callback for the breakpoint.
319 virtual Status
321 const char *function_name,
322 StructuredData::ObjectSP extra_args_sp) {
323 return Status::FromErrorString("not implemented");
324 }
325
326 /// Set a one-liner as the callback for the watchpoint.
328 const char *user_input,
329 bool is_callback) {}
330
331 virtual bool GetScriptedSummary(const char *function_name,
332 lldb::ValueObjectSP valobj,
333 StructuredData::ObjectSP &callee_wrapper_sp,
334 const TypeSummaryOptions &options,
335 std::string &retval) {
336 return false;
337 }
338
339 // Calls the specified formatter matching Python function and returns its
340 // result (true if it's a match, false if we should keep looking for a
341 // matching formatter).
342 virtual bool FormatterCallbackFunction(const char *function_name,
343 lldb::TypeImplSP type_impl_sp) {
344 return true;
345 }
346
347 virtual void Clear() {
348 // Clean up any ref counts to SBObjects that might be in global variables
349 }
350
351 virtual size_t
353 uint32_t max) {
354 return 0;
355 }
356
357 virtual lldb::ValueObjectSP
358 GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx) {
359 return lldb::ValueObjectSP();
360 }
361
362 virtual llvm::Expected<uint32_t>
364 const char *child_name) {
365 return llvm::createStringError("Type has no child named '%s'", child_name);
366 }
367
368 virtual bool
370 return false;
371 }
372
374 const StructuredData::ObjectSP &implementor) {
375 return true;
376 }
377
378 virtual lldb::ValueObjectSP
380 return nullptr;
381 }
382
383 virtual ConstString
385 return ConstString();
386 }
387
388 virtual bool
389 RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
390 ScriptedCommandSynchronicity synchronicity,
392 Status &error,
393 const lldb_private::ExecutionContext &exe_ctx) {
394 return false;
395 }
396
398 StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
399 ScriptedCommandSynchronicity synchronicity,
401 const lldb_private::ExecutionContext &exe_ctx) {
402 return false;
403 }
404
406 StructuredData::GenericSP impl_obj_sp, Args& args,
407 ScriptedCommandSynchronicity synchronicity,
409 const lldb_private::ExecutionContext &exe_ctx) {
410 return false;
411 }
412
413 virtual std::optional<std::string>
415 Args &args) {
416 return std::nullopt;
417 }
418
421 StructuredData::GenericSP impl_obj_sp, std::vector<llvm::StringRef> &args,
422 size_t args_pos, size_t char_in_arg) {
423 return {};
424 }
425
428 StructuredData::GenericSP impl_obj_sp, llvm::StringRef &long_name,
429 size_t char_in_arg) {
430 return {};
431 }
432
433 virtual bool RunScriptFormatKeyword(const char *impl_function,
434 Process *process, std::string &output,
435 Status &error) {
436 error = Status::FromErrorString("unimplemented");
437 return false;
438 }
439
440 virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread,
441 std::string &output, Status &error) {
442 error = Status::FromErrorString("unimplemented");
443 return false;
444 }
445
446 virtual bool RunScriptFormatKeyword(const char *impl_function, Target *target,
447 std::string &output, Status &error) {
448 error = Status::FromErrorString("unimplemented");
449 return false;
450 }
451
452 virtual bool RunScriptFormatKeyword(const char *impl_function,
453 StackFrame *frame, std::string &output,
454 Status &error) {
455 error = Status::FromErrorString("unimplemented");
456 return false;
457 }
458
459 virtual bool RunScriptFormatKeyword(const char *impl_function,
460 ValueObject *value, std::string &output,
461 Status &error) {
462 error = Status::FromErrorString("unimplemented");
463 return false;
464 }
465
466 virtual bool GetDocumentationForItem(const char *item, std::string &dest) {
467 dest.clear();
468 return false;
469 }
470
471 virtual bool
473 std::string &dest) {
474 dest.clear();
475 return false;
476 }
477
480 return {};
481 }
482
485 return {};
486 }
487
489 StructuredData::GenericSP cmd_obj_sp, ExecutionContext *exe_ctx,
490 llvm::StringRef long_option, llvm::StringRef value) {
491 return false;
492 }
493
494 virtual void
496
497 virtual uint32_t
499 return 0;
500 }
501
503 std::string &dest) {
504 dest.clear();
505 return false;
506 }
507
508 virtual bool CheckObjectExists(const char *name) { return false; }
509
510 virtual bool
511 LoadScriptingModule(const char *filename, const LoadScriptOptions &options,
513 StructuredData::ObjectSP *module_sp = nullptr,
514 FileSpec extra_search_dir = {},
515 lldb::TargetSP loaded_into_target_sp = {});
516
517 virtual bool IsReservedWord(const char *word) { return false; }
518
519 virtual std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock();
520
522
523 virtual llvm::Expected<unsigned>
524 GetMaxPositionalArgumentsForCallable(const llvm::StringRef &callable_name) {
525 return llvm::createStringError(
526 llvm::inconvertibleErrorCode(), "Unimplemented function");
527 }
528
529 static std::string LanguageToString(lldb::ScriptLanguage language);
530
531 static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string);
532
533 virtual llvm::Expected<std::string>
535 return llvm::make_error<UnimplementedError>();
536 }
537
538 static llvm::StringLiteral
540
541 static lldb::ScriptedExtension StringToExtension(llvm::StringRef string);
542
544
548
552
556
559 return {};
560 }
561
564 return {};
565 }
566
570
574
578
581 return {};
582 }
583
588
593
594 /// Holds an lldb_private::Module name and a "sanitized" version
595 /// of it for the purposes of loading a script of that name by
596 /// the relevant ScriptInterpreter.
597 ///
598 /// E.g., for Python the sanitized name can't include:
599 /// * Special characters: '-', ' ', '.'
600 /// * Python keywords
602 public:
603 SanitizedScriptingModuleName(std::string name, std::string sanitized_name,
604 std::string conflicting_keyword)
605 : m_original_name(std::move(name)),
606 m_sanitized_name(std::move(sanitized_name)),
607 m_conflicting_keyword(std::move(conflicting_keyword)) {}
608
609 /// Returns \c true if this name is a keyword in the associated scripting
610 /// language.
611 bool IsKeyword() const { return !m_conflicting_keyword.empty(); }
612
613 /// Returns \c true if the original name has been sanitized (i.e., required
614 /// changes).
615 bool RequiredSanitization() const {
617 }
618
619 llvm::StringRef GetSanitizedName() const { return m_sanitized_name; }
620 llvm::StringRef GetOriginalName() const { return m_original_name; }
621 llvm::StringRef GetConflictingKeyword() const {
623 }
624
625 private:
626 std::string m_original_name;
627 std::string m_sanitized_name;
628
629 /// If the m_sanitized_name conflicts with a keyword for the
630 /// ScriptInterpreter language associated with this
631 /// SanitizedScriptingModuleName, is set to the conflicting keyword. Empty
632 /// otherwise.
634 };
635
637 GetSanitizedScriptingModuleName(llvm::StringRef name);
638
640 GetDataExtractorFromSBData(const lldb::SBData &data) const;
641
643
644 Event *GetOpaqueTypeFromSBEvent(const lldb::SBEvent &event) const;
645
647
649
651
654
656 GetOpaqueTypeFromSBBreakpoint(const lldb::SBBreakpoint &breakpoint) const;
657
659 const lldb::SBBreakpointLocation &break_loc) const;
660
662 GetOpaqueTypeFromSBAttachInfo(const lldb::SBAttachInfo &attach_info) const;
663
665 GetOpaqueTypeFromSBLaunchInfo(const lldb::SBLaunchInfo &launch_info) const;
666
667 std::optional<MemoryRegionInfo> GetOpaqueTypeFromSBMemoryRegionInfo(
668 const lldb::SBMemoryRegionInfo &mem_region) const;
669
671 const lldb::SBExecutionContext &exe_ctx) const;
672
675
677 GetOpaqueTypeFromSBValue(const lldb::SBValue &value) const;
678
680
681protected:
684};
685
686} // namespace lldb_private
687
688#endif // LLDB_INTERPRETER_SCRIPTINTERPRETER_H
static llvm::raw_ostream & error(Stream &strm)
Represents a list of SBFrame objects.
Definition SBFrameList.h:31
A command line argument class.
Definition Args.h:33
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
A uniqued constant string class.
Definition ConstString.h:40
A class to manage flag bits.
Definition Debugger.h:100
ExecuteScriptOptions & SetMaskoutErrors(bool maskout)
ExecuteScriptOptions & SetSetLLDBGlobals(bool set)
ExecuteScriptOptions & SetEnableIO(bool enable)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition FileSpec.h:57
LoadScriptOptions & SetInitSession(bool b)
LoadScriptOptions & SetSilent(bool b)
std::recursive_mutex Mutex
Definition StreamFile.h:77
A plug-in interface definition class for debugging a process.
Definition Process.h:359
void Flush()
Flush our output and error file handles.
ScriptInterpreterIORedirect(std::unique_ptr< File > input, std::unique_ptr< File > output)
static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > Create(bool enable_io, Debugger &debugger, CommandReturnObject *result)
Create an IO redirect.
const ScriptInterpreterLocker & operator=(const ScriptInterpreterLocker &)=delete
ScriptInterpreterLocker(const ScriptInterpreterLocker &)=delete
virtual ~ScriptInterpreterLocker()=default
Holds an lldb_private::Module name and a "sanitized" version of it for the purposes of loading a scri...
bool RequiredSanitization() const
Returns true if the original name has been sanitized (i.e., required changes).
SanitizedScriptingModuleName(std::string name, std::string sanitized_name, std::string conflicting_keyword)
std::string m_conflicting_keyword
If the m_sanitized_name conflicts with a keyword for the ScriptInterpreter language associated with t...
bool IsKeyword() const
Returns true if this name is a keyword in the associated scripting language.
virtual bool SetOptionValueForCommandObject(StructuredData::GenericSP cmd_obj_sp, ExecutionContext *exe_ctx, llvm::StringRef long_option, llvm::StringRef value)
static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string)
virtual lldb::ScriptedHookInterfaceSP CreateScriptedHookInterface()
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result)
const char * GetScriptInterpreterPtyName()
lldb::ProcessAttachInfoSP GetOpaqueTypeFromSBAttachInfo(const lldb::SBAttachInfo &attach_info) const
virtual Status ExecuteMultipleLines(const char *in_string, const ExecuteScriptOptions &options=ExecuteScriptOptions())
lldb::StreamSP GetOpaqueTypeFromSBStream(const lldb::SBStream &stream) const
virtual StructuredData::GenericSP CreateScriptCommandObject(const char *class_name)
virtual size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor, uint32_t max)
virtual bool GenerateTypeScriptFunction(const char *oneliner, std::string &output, const void *name_token=nullptr)
virtual bool RunScriptFormatKeyword(const char *impl_function, Target *target, std::string &output, Status &error)
virtual bool GenerateTypeScriptFunction(StringList &input, std::string &output, const void *name_token=nullptr)
virtual lldb::ScriptedProcessInterfaceUP CreateScriptedProcessInterface()
virtual lldb::ScriptedFrameInterfaceSP CreateScriptedFrameInterface()
virtual Status ExportFunctionDefinitionToInterpreter(StringList &function_def)
lldb::ExecutionContextRefSP GetOpaqueTypeFromSBExecutionContext(const lldb::SBExecutionContext &exe_ctx) const
~ScriptInterpreter() override=default
virtual lldb::OperatingSystemInterfaceSP CreateOperatingSystemInterface()
virtual StructuredData::ObjectSP CreateSyntheticScriptedProvider(const char *class_name, lldb::ValueObjectSP valobj)
SymbolContext GetOpaqueTypeFromSBSymbolContext(const lldb::SBSymbolContext &sym_ctx) const
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.
virtual llvm::Expected< unsigned > GetMaxPositionalArgumentsForCallable(const llvm::StringRef &callable_name)
virtual bool ExecuteOneLineWithReturn(llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value, const ExecuteScriptOptions &options=ExecuteScriptOptions())
virtual bool GenerateTypeSynthClass(StringList &input, std::string &output, const void *name_token=nullptr)
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)
virtual llvm::Expected< FileSpec > GenerateExtensionTemplate(const std::string &name, std::vector< ExtensionTemplateRequest > &extensions, bool generate_non_abstract_methods, std::string output_file)
virtual void ExecuteInterpreterLoop()=0
virtual lldb::ScriptedBreakpointInterfaceSP CreateScriptedBreakpointInterface()
virtual bool GenerateScriptAliasFunction(StringList &input, std::string &output)
lldb::ThreadSP GetOpaqueTypeFromSBThread(const lldb::SBThread &exe_ctx) const
static llvm::StringLiteral ExtensionToString(lldb::ScriptedExtension extension)
virtual llvm::Expected< std::string > ExtensionToImportPath(lldb::ScriptedExtension extension)
virtual bool MightHaveChildrenSynthProviderInstance(const StructuredData::ObjectSP &implementor)
static lldb::ScriptedExtension StringToExtension(llvm::StringRef string)
std::optional< MemoryRegionInfo > GetOpaqueTypeFromSBMemoryRegionInfo(const lldb::SBMemoryRegionInfo &mem_region) const
lldb::ValueObjectSP GetOpaqueTypeFromSBValue(const lldb::SBValue &value) const
virtual bool GenerateWatchpointCommandCallbackData(StringList &input, std::string &output, bool is_callback)
virtual StructuredData::DictionarySP GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target, const char *setting_name, lldb_private::Status &error)
virtual StructuredData::DictionarySP HandleOptionArgumentCompletionForScriptedCommand(StructuredData::GenericSP impl_obj_sp, llvm::StringRef &long_name, size_t char_in_arg)
virtual Status GenerateFunction(const char *signature, const StringList &input, bool is_callback)
virtual lldb::ValueObjectSP GetChildAtIndex(const StructuredData::ObjectSP &implementor, uint32_t idx)
Event * GetOpaqueTypeFromSBEvent(const lldb::SBEvent &event) const
virtual std::optional< std::string > GetRepeatCommandForScriptedCommand(StructuredData::GenericSP impl_obj_sp, Args &args)
virtual void SetWatchpointCommandCallback(WatchpointOptions *wp_options, const char *user_input, bool is_callback)
Set a one-liner as the callback for the watchpoint.
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.
lldb::ProcessLaunchInfoSP GetOpaqueTypeFromSBLaunchInfo(const lldb::SBLaunchInfo &launch_info) const
virtual lldb::ValueObjectSP GetSyntheticValue(const StructuredData::ObjectSP &implementor)
virtual bool ExecuteOneLine(llvm::StringRef command, CommandReturnObject *result, const ExecuteScriptOptions &options=ExecuteScriptOptions())=0
virtual bool LoadScriptingModule(const char *filename, const LoadScriptOptions &options, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={}, lldb::TargetSP loaded_into_target_sp={})
virtual llvm::Expected< uint32_t > GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor, const char *child_name)
virtual bool RunScriptFormatKeyword(const char *impl_function, StackFrame *frame, std::string &output, Status &error)
virtual Status GenerateBreakpointCommandCallbackData(StringList &input, std::string &output, bool has_extra_args, bool is_callback)
static std::string LanguageToString(lldb::ScriptLanguage language)
virtual bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value, std::string &output, Status &error)
Status GetStatusFromSBError(const lldb::SBError &error) const
virtual std::unique_ptr< ScriptInterpreterLocker > AcquireInterpreterLock()
virtual bool GetDocumentationForItem(const char *item, std::string &dest)
virtual StructuredData::DictionarySP GetInterpreterInfo()
lldb::BreakpointLocationSP GetOpaqueTypeFromSBBreakpointLocation(const lldb::SBBreakpointLocation &break_loc) const
virtual bool UpdateSynthProviderInstance(const StructuredData::ObjectSP &implementor)
lldb::TargetSP GetOpaqueTypeFromSBTarget(const lldb::SBTarget &target) const
virtual StructuredData::ObjectSP LoadPluginModule(const FileSpec &file_spec, lldb_private::Status &error)
virtual bool RunScriptBasedParsedCommand(StructuredData::GenericSP impl_obj_sp, Args &args, ScriptedCommandSynchronicity synchronicity, lldb_private::CommandReturnObject &cmd_retobj, Status &error, const lldb_private::ExecutionContext &exe_ctx)
Status SetBreakpointCommandCallbackFunction(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp)
virtual bool GenerateTypeSynthClass(const char *oneliner, std::string &output, const void *name_token=nullptr)
virtual StructuredData::ObjectSP CreateStructuredDataFromScriptObject(ScriptObject obj)
virtual StructuredData::ObjectSP GetOptionsForCommandObject(StructuredData::GenericSP cmd_obj_sp)
virtual StructuredData::ObjectSP GetArgumentsForCommandObject(StructuredData::GenericSP cmd_obj_sp)
virtual void OptionParsingStartedForCommandObject(StructuredData::GenericSP cmd_obj_sp)
virtual bool GetScriptedSummary(const char *function_name, lldb::ValueObjectSP valobj, StructuredData::ObjectSP &callee_wrapper_sp, const TypeSummaryOptions &options, std::string &retval)
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, std::unique_ptr< BreakpointOptions::CommandData > &data_up)
This one is for deserialization:
lldb::BreakpointSP GetOpaqueTypeFromSBBreakpoint(const lldb::SBBreakpoint &breakpoint) const
virtual bool GetLongHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp, std::string &dest)
virtual lldb::ScriptedThreadPlanInterfaceSP CreateScriptedThreadPlanInterface()
virtual bool RunScriptFormatKeyword(const char *impl_function, Thread *thread, std::string &output, Status &error)
virtual bool CheckObjectExists(const char *name)
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)
virtual bool FormatterCallbackFunction(const char *function_name, lldb::TypeImplSP type_impl_sp)
virtual ConstString GetSyntheticTypeName(const StructuredData::ObjectSP &implementor)
lldb::ScriptLanguage GetLanguage()
virtual uint32_t GetFlagsForCommandObject(StructuredData::GenericSP cmd_obj_sp)
lldb::StackFrameListSP GetOpaqueTypeFromSBFrameList(const lldb::SBFrameList &exe_ctx) const
virtual bool GetShortHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp, std::string &dest)
lldb::StackFrameSP GetOpaqueTypeFromSBFrame(const lldb::SBFrame &frame) const
virtual bool IsReservedWord(const char *word)
virtual StructuredData::DictionarySP HandleArgumentCompletionForScriptedCommand(StructuredData::GenericSP impl_obj_sp, std::vector< llvm::StringRef > &args, size_t args_pos, size_t char_in_arg)
lldb::DataExtractorSP GetDataExtractorFromSBData(const lldb::SBData &data) const
virtual lldb::ScriptedPlatformInterfaceUP GetScriptedPlatformInterface()
virtual bool RunScriptFormatKeyword(const char *impl_function, Process *process, std::string &output, Status &error)
virtual lldb::ScriptedThreadInterfaceSP CreateScriptedThreadInterface()
virtual Status SetBreakpointCommandCallback(BreakpointOptions &bp_options, const char *callback_text, bool is_callback)
virtual lldb::ScriptedFrameProviderInterfaceSP CreateScriptedFrameProviderInterface()
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang)
virtual void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result)
virtual SanitizedScriptingModuleName GetSanitizedScriptingModuleName(llvm::StringRef name)
virtual lldb::ScriptedStackFrameRecognizerInterfaceSP CreateScriptedStackFrameRecognizerInterface()
This base class provides an interface to stack frames.
Definition StackFrame.h:44
An error handling class.
Definition Status.h:118
static Status FromErrorString(const char *str)
Definition Status.h:141
std::shared_ptr< Generic > GenericSP
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
Defines a symbol context baton that can be handed other debug core functions.
"lldb/Core/ThreadedCommunication.h" Variation of Communication that supports threaded reads.
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.
A class that represents a running process on the host machine.
std::unique_ptr< lldb_private::ScriptedPlatformInterface > ScriptedPlatformInterfaceUP
ScriptLanguage
Script interpreter types.
ScriptedExtension
Scripting extension types.
std::shared_ptr< lldb_private::ScriptedHookInterface > ScriptedHookInterfaceSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ScriptedThreadPlanInterface > ScriptedThreadPlanInterfaceSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
std::shared_ptr< lldb_private::OperatingSystemInterface > OperatingSystemInterfaceSP
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::ScriptedBreakpointInterface > ScriptedBreakpointInterfaceSP
std::shared_ptr< lldb_private::ScriptedThreadInterface > ScriptedThreadInterfaceSP
std::shared_ptr< lldb_private::ScriptedFrameProviderInterface > ScriptedFrameProviderInterfaceSP
std::shared_ptr< lldb_private::LockableStreamFile > LockableStreamFileSP
std::shared_ptr< lldb_private::TypeImpl > TypeImplSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::File > FileSP
std::shared_ptr< lldb_private::ScriptedStackFrameRecognizerInterface > ScriptedStackFrameRecognizerInterfaceSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::unique_ptr< lldb_private::ScriptedProcessInterface > ScriptedProcessInterfaceUP
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP
std::shared_ptr< lldb_private::ScriptedFrameInterface > ScriptedFrameInterfaceSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP
Describes one extension to emit into the generated template file.