LLDB mainline
ClangREPL.h
Go to the documentation of this file.
1//===-- ClangREPL.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_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H
10#define LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H
11
13
14namespace lldb_private {
15/// Implements a Clang-based REPL for C languages on top of LLDB's REPL
16/// framework.
17class ClangREPL : public REPL {
18public:
19 ClangREPL(lldb::LanguageType language, Target &target);
20
21 ~ClangREPL() override;
22
23 static void Initialize();
24
25 static void Terminate();
26
27 static lldb::REPLSP CreateInstance(Status &error, lldb::LanguageType language,
28 Debugger *debugger, Target *target,
29 const char *repl_options);
30
31 static llvm::StringRef GetPluginNameStatic() { return "ClangREPL"; }
32
33protected:
34 Status DoInitialization() override;
35
37
38 const char *GetAutoIndentCharacters() override;
39
40 bool SourceIsComplete(const std::string &source) override;
41
43 int cursor_position,
44 int tab_size) override;
45
47
48 bool PrintOneVariable(Debugger &debugger, lldb::StreamFileSP &output_sp,
49 lldb::ValueObjectSP &valobj_sp,
50 ExpressionVariable *var = nullptr) override;
51
52 void CompleteCode(const std::string &current_code,
53 CompletionRequest &request) override;
54
55private:
56 /// The specific C language of this REPL.
58 /// A regex matching the implicitly created LLDB result variables.
60};
61} // namespace lldb_private
62
63#endif // LLDB_SOURCE_PLUGINS_REPL_CLANG_CLANGREPL_H
static llvm::raw_ostream & error(Stream &strm)
Implements a Clang-based REPL for C languages on top of LLDB's REPL framework.
Definition: ClangREPL.h:17
lldb::LanguageType GetLanguage() override
Definition: ClangREPL.cpp:82
ConstString GetSourceFileBasename() override
Definition: ClangREPL.cpp:63
static void Initialize()
Definition: ClangREPL.cpp:24
static void Terminate()
Definition: ClangREPL.cpp:42
const char * GetAutoIndentCharacters() override
Definition: ClangREPL.cpp:67
lldb_private::RegularExpression m_implicit_expr_result_regex
A regex matching the implicitly created LLDB result variables.
Definition: ClangREPL.h:59
static llvm::StringRef GetPluginNameStatic()
Definition: ClangREPL.h:31
static lldb::REPLSP CreateInstance(Status &error, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options)
Definition: ClangREPL.cpp:46
Status DoInitialization() override
Definition: ClangREPL.cpp:61
void CompleteCode(const std::string &current_code, CompletionRequest &request) override
Definition: ClangREPL.cpp:99
lldb::offset_t GetDesiredIndentation(const StringList &lines, int cursor_position, int tab_size) override
Definition: ClangREPL.cpp:75
bool SourceIsComplete(const std::string &source) override
Definition: ClangREPL.cpp:69
bool PrintOneVariable(Debugger &debugger, lldb::StreamFileSP &output_sp, lldb::ValueObjectSP &valobj_sp, ExpressionVariable *var=nullptr) override
Definition: ClangREPL.cpp:84
lldb::LanguageType m_language
The specific C language of this REPL.
Definition: ClangREPL.h:57
"lldb/Utility/ArgCompletionRequest.h"
A uniqued constant string class.
Definition: ConstString.h:39
A class to manage flag bits.
Definition: Debugger.h:78
An error handling class.
Definition: Status.h:44
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
uint64_t offset_t
Definition: lldb-types.h:83
LanguageType
Programming language type.