LLDB mainline
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
lldb_private::ClangREPL Class Reference

Implements a Clang-based REPL for C languages on top of LLDB's REPL framework. More...

#include <ClangREPL.h>

Inheritance diagram for lldb_private::ClangREPL:
Inheritance graph
[legend]

Public Member Functions

 ClangREPL (lldb::LanguageType language, Target &target)
 
 ~ClangREPL () override
 

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 Public Attributes

static char ID
 

Protected Member Functions

Status DoInitialization () override
 
llvm::StringRef 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 &current_code, CompletionRequest &request) override
 

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.
 

Detailed Description

Implements a Clang-based REPL for C languages on top of LLDB's REPL framework.

Definition at line 17 of file ClangREPL.h.

Constructor & Destructor Documentation

◆ ClangREPL()

ClangREPL::ClangREPL ( lldb::LanguageType  language,
Target target 
)

Definition at line 20 of file ClangREPL.cpp.

◆ ~ClangREPL()

ClangREPL::~ClangREPL ( )
overridedefault

Member Function Documentation

◆ CompleteCode()

void ClangREPL::CompleteCode ( const std::string &  current_code,
CompletionRequest request 
)
overrideprotected

Definition at line 104 of file ClangREPL.cpp.

◆ CreateInstance()

lldb::REPLSP ClangREPL::CreateInstance ( Status error,
lldb::LanguageType  language,
Debugger debugger,
Target target,
const char *  repl_options 
)
static

Definition at line 48 of file ClangREPL.cpp.

References error(), and lldb_private::Target::SetREPL().

Referenced by Initialize(), and Terminate().

◆ DoInitialization()

Status ClangREPL::DoInitialization ( )
overrideprotected

Definition at line 63 of file ClangREPL.cpp.

◆ GetAutoIndentCharacters()

const char * ClangREPL::GetAutoIndentCharacters ( )
overrideprotected

Definition at line 70 of file ClangREPL.cpp.

◆ GetDesiredIndentation()

lldb::offset_t ClangREPL::GetDesiredIndentation ( const StringList lines,
int  cursor_position,
int  tab_size 
)
overrideprotected

Definition at line 78 of file ClangREPL.cpp.

References LLDB_INVALID_OFFSET.

◆ GetLanguage()

lldb::LanguageType ClangREPL::GetLanguage ( )
overrideprotected

Definition at line 85 of file ClangREPL.cpp.

References m_language.

◆ GetPluginNameStatic()

static llvm::StringRef lldb_private::ClangREPL::GetPluginNameStatic ( )
inlinestatic

Definition at line 34 of file ClangREPL.h.

Referenced by Initialize().

◆ GetSourceFileBasename()

llvm::StringRef ClangREPL::GetSourceFileBasename ( )
overrideprotected

Definition at line 65 of file ClangREPL.cpp.

◆ Initialize()

void ClangREPL::Initialize ( )
static

◆ PrintOneVariable()

bool ClangREPL::PrintOneVariable ( Debugger debugger,
lldb::StreamFileSP output_sp,
lldb::ValueObjectSP valobj_sp,
ExpressionVariable var = nullptr 
)
overrideprotected

◆ SourceIsComplete()

bool ClangREPL::SourceIsComplete ( const std::string &  source)
overrideprotected

Definition at line 72 of file ClangREPL.cpp.

◆ Terminate()

void ClangREPL::Terminate ( )
static

Member Data Documentation

◆ ID

char ClangREPL::ID
static

Definition at line 20 of file ClangREPL.h.

◆ m_implicit_expr_result_regex

lldb_private::RegularExpression lldb_private::ClangREPL::m_implicit_expr_result_regex
private

A regex matching the implicitly created LLDB result variables.

Definition at line 62 of file ClangREPL.h.

Referenced by PrintOneVariable().

◆ m_language

lldb::LanguageType lldb_private::ClangREPL::m_language
private

The specific C language of this REPL.

Definition at line 60 of file ClangREPL.h.

Referenced by GetLanguage().


The documentation for this class was generated from the following files: