LLDB mainline
|
Implements a Clang-based REPL for C languages on top of LLDB's REPL framework. More...
#include <ClangREPL.h>
Public Member Functions | |
ClangREPL (lldb::LanguageType language, Target &target) | |
~ClangREPL () override | |
![]() | |
LLVMCastKind | getKind () const |
REPL (LLVMCastKind kind, Target &target) | |
~REPL () override | |
void | SetFormatOptions (const OptionGroupFormat &options) |
void | SetValueObjectDisplayOptions (const OptionGroupValueObjectDisplay &options) |
void | SetEvaluateOptions (const EvaluateExpressionOptions &options) |
void | SetCompilerOptions (const char *options) |
lldb::IOHandlerSP | GetIOHandler () |
Status | RunLoop () |
void | IOHandlerActivated (IOHandler &io_handler, bool interactive) override |
bool | IOHandlerInterrupt (IOHandler &io_handler) override |
void | IOHandlerInputInterrupted (IOHandler &io_handler, std::string &line) override |
const char * | IOHandlerGetFixIndentationCharacters () override |
ConstString | IOHandlerGetControlSequence (char ch) override |
const char * | IOHandlerGetCommandPrefix () override |
const char * | IOHandlerGetHelpPrologue () override |
bool | IOHandlerIsInputComplete (IOHandler &io_handler, StringList &lines) override |
Called to determine whether typing enter after the last line in lines should end input. | |
int | IOHandlerFixIndentation (IOHandler &io_handler, const StringList &lines, int cursor_position) override |
Called when a new line is created or one of an identified set of indentation characters is typed. | |
void | IOHandlerInputComplete (IOHandler &io_handler, std::string &line) override |
Called when a line or lines have been retrieved. | |
void | IOHandlerComplete (IOHandler &io_handler, CompletionRequest &request) override |
![]() | |
IOHandlerDelegate (Completion completion=Completion::None) | |
virtual | ~IOHandlerDelegate ()=default |
virtual void | IOHandlerActivated (IOHandler &io_handler, bool interactive) |
virtual void | IOHandlerDeactivated (IOHandler &io_handler) |
virtual std::optional< std::string > | IOHandlerSuggestion (IOHandler &io_handler, llvm::StringRef line) |
virtual void | IOHandlerComplete (IOHandler &io_handler, CompletionRequest &request) |
virtual const char * | IOHandlerGetFixIndentationCharacters () |
virtual int | IOHandlerFixIndentation (IOHandler &io_handler, const StringList &lines, int cursor_position) |
Called when a new line is created or one of an identified set of indentation characters is typed. | |
virtual void | IOHandlerInputComplete (IOHandler &io_handler, std::string &data)=0 |
Called when a line or lines have been retrieved. | |
virtual void | IOHandlerInputInterrupted (IOHandler &io_handler, std::string &data) |
virtual bool | IOHandlerIsInputComplete (IOHandler &io_handler, StringList &lines) |
Called to determine whether typing enter after the last line in lines should end input. | |
virtual ConstString | IOHandlerGetControlSequence (char ch) |
virtual const char * | IOHandlerGetCommandPrefix () |
virtual const char * | IOHandlerGetHelpPrologue () |
virtual bool | IOHandlerInterrupt (IOHandler &io_handler) |
Static Public Member Functions | |
static void | Initialize () |
static void | Terminate () |
static lldb::REPLSP | CreateInstance (Status &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options) |
static llvm::StringRef | GetPluginNameStatic () |
![]() | |
static lldb::REPLSP | Create (Status &Status, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options) |
Get a REPL with an existing target (or, failing that, a debugger to use), and (optional) extra arguments for the compiler. | |
Protected Member Functions | |
Status | DoInitialization () override |
ConstString | GetSourceFileBasename () override |
const char * | GetAutoIndentCharacters () override |
bool | SourceIsComplete (const std::string &source) override |
lldb::offset_t | GetDesiredIndentation (const StringList &lines, int cursor_position, int tab_size) override |
lldb::LanguageType | GetLanguage () override |
bool | PrintOneVariable (Debugger &debugger, lldb::StreamFileSP &output_sp, lldb::ValueObjectSP &valobj_sp, ExpressionVariable *var=nullptr) override |
void | CompleteCode (const std::string ¤t_code, CompletionRequest &request) override |
virtual Status | DoInitialization ()=0 |
virtual ConstString | GetSourceFileBasename ()=0 |
virtual const char * | GetAutoIndentCharacters ()=0 |
virtual bool | SourceIsComplete (const std::string &source)=0 |
virtual lldb::offset_t | GetDesiredIndentation (const StringList &lines, int cursor_position, int tab_size)=0 |
virtual lldb::LanguageType | GetLanguage ()=0 |
virtual bool | PrintOneVariable (Debugger &debugger, lldb::StreamFileSP &output_sp, lldb::ValueObjectSP &valobj_sp, ExpressionVariable *var=nullptr)=0 |
virtual void | CompleteCode (const std::string ¤t_code, CompletionRequest &request)=0 |
Private Attributes | |
lldb::LanguageType | m_language |
The specific C language of this REPL. | |
lldb_private::RegularExpression | m_implicit_expr_result_regex |
A regex matching the implicitly created LLDB result variables. | |
Implements a Clang-based REPL for C languages on top of LLDB's REPL framework.
Definition at line 17 of file ClangREPL.h.
ClangREPL::ClangREPL | ( | lldb::LanguageType | language, |
Target & | target | ||
) |
Definition at line 18 of file ClangREPL.cpp.
|
overridedefault |
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 99 of file ClangREPL.cpp.
|
static |
Definition at line 46 of file ClangREPL.cpp.
References error(), and lldb_private::Target::SetREPL().
Referenced by Initialize(), and Terminate().
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 61 of file ClangREPL.cpp.
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 67 of file ClangREPL.cpp.
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 75 of file ClangREPL.cpp.
References LLDB_INVALID_OFFSET.
|
overrideprotectedvirtual |
|
inlinestatic |
Definition at line 31 of file ClangREPL.h.
Referenced by Initialize().
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 63 of file ClangREPL.cpp.
|
static |
Definition at line 24 of file ClangREPL.cpp.
References CreateInstance(), lldb::eLanguageTypeC, lldb::eLanguageTypeC11, lldb::eLanguageTypeC89, lldb::eLanguageTypeC99, lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeC_plus_plus_03, lldb::eLanguageTypeC_plus_plus_11, lldb::eLanguageTypeC_plus_plus_14, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, GetPluginNameStatic(), lldb_private::LanguageSet::Insert(), and lldb_private::PluginManager::RegisterPlugin().
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 84 of file ClangREPL.cpp.
References lldb_private::RegularExpression::Execute(), lldb_private::ExpressionVariable::GetName(), lldb_private::ConstString::GetStringRef(), and m_implicit_expr_result_regex.
|
overrideprotectedvirtual |
Implements lldb_private::REPL.
Definition at line 69 of file ClangREPL.cpp.
|
static |
Definition at line 42 of file ClangREPL.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
private |
A regex matching the implicitly created LLDB result variables.
Definition at line 59 of file ClangREPL.h.
Referenced by PrintOneVariable().
|
private |
The specific C language of this REPL.
Definition at line 57 of file ClangREPL.h.
Referenced by GetLanguage().