LLDB mainline
lldb_private::RustLanguage Class Reference

#include <RustLanguage.h>

Inheritance diagram for lldb_private::RustLanguage:
[legend]

Public Member Functions

 RustLanguage ()=default
 ~RustLanguage () override=default
lldb::LanguageType GetLanguageType () const override
bool IsSourceFile (llvm::StringRef file_path) const override
std::unique_ptr< TypeScavenger > GetTypeScavenger () override
bool IsNilReference (ValueObject &valobj) override
llvm::StringRef GetNilReferenceSummaryString () override
 Rust has no null literal, so null pointers print like in C.
DemangledName DemangleSymbol (ConstString mangled, Mangled::ManglingScheme scheme, const DemangleOptions &options) const override
 Demangle mangled, a name mangled with scheme, a scheme that this language registered with Mangled::RegisterManglingScheme().
lldb::TypeCategoryImplSP GetFormatters () override
std::vector< lldb::LanguageType > GetFormatterLanguages (lldb::LanguageType language) const override
 Returns the languages whose formatters apply to values of language, in the order in which to consult them.
bool IsCategoryApplicable (lldb::LanguageType category_language, lldb::LanguageType valobj_language) const override
 Returns whether the formatters in a category for category_language, one of the languages of this plugin, apply to values of valobj_language.
llvm::StringRef GetPluginName () override
 PluginInterface protocol.
Public Member Functions inherited from lldb_private::Language
 ~Language () override
virtual llvm::StringRef GetUserEntryPointName () const
virtual bool IsTopLevelFunction (Function &function)
virtual HardcodedFormatters::HardcodedFormatFinder GetHardcodedFormats ()
virtual HardcodedFormatters::HardcodedSummaryFinder GetHardcodedSummaries ()
virtual HardcodedFormatters::HardcodedSyntheticFinder GetHardcodedSynthetics ()
virtual std::vector< FormattersMatchCandidate > GetPossibleFormattersMatches (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
virtual std::unique_ptr< OptionGroupLanguageExpression > CreateExpressionOptions ()
 Returns the options that this language adds to the commands that evaluate expressions, or nullptr.
virtual const char * GetLanguageSpecificTypeLookupHelp ()
virtual std::vector< Language::MethodNameVariant > GetMethodNameVariants (llvm::StringRef method_name) const
virtual std::unique_ptr< Language::MethodName > GetMethodName (llvm::StringRef name) const
virtual std::pair< lldb::FunctionNameType, std::optional< ConstString > > GetFunctionNameInfo (ConstString name) const
virtual bool SymbolNameFitsToLanguage (const Mangled &name) const
 Returns true iff the given symbol name is compatible with the mangling scheme of this language.
virtual std::unique_ptr< MangledNameParser > CreateMangledNameParser (Mangled::ManglingScheme scheme) const
 Returns a parser for the names mangled with scheme, a scheme that this language registered, or a nullptr if the symbol table should index them by their demangled names.
virtual std::pair< llvm::StringRef, llvm::StringRef > GetFormatterPrefixSuffix (llvm::StringRef type_hint)
 An individual data formatter may apply to several types and cross language boundaries.
virtual bool DemangledNameContainsPath (llvm::StringRef path, ConstString demangled) const
virtual DumpValueObjectOptions::DeclPrintingHelper GetDeclPrintingHelper ()
virtual LazyBool IsLogicalTrue (ValueObject &valobj, Status &error)
virtual bool IsUninitializedReference (ValueObject &valobj)
virtual bool GetFunctionDisplayName (const SymbolContext &sc, const ExecutionContext *exe_ctx, FunctionNameRepresentation representation, Stream &s)
virtual bool HandleFrameFormatVariable (const SymbolContext &sc, const ExecutionContext *exe_ctx, FormatEntity::Entry::Type type, Stream &s)
virtual ConstString GetDemangledFunctionNameWithoutArguments (Mangled mangled) const
virtual ConstString GetDisplayDemangledName (Mangled mangled) const
virtual void GetExceptionResolverDescription (bool catch_on, bool throw_on, Stream &s)
virtual std::vector< ConstString > GenerateAlternateFunctionManglings (const ConstString mangled) const
virtual ConstString FindBestAlternateFunctionMangledName (const Mangled mangled, const SymbolContext &sym_ctx) const
virtual llvm::StringRef GetInstanceName ()
virtual void FilterForLineBreakpoints (llvm::SmallVectorImpl< SymbolContext > &) const
 Given a symbol context list of matches which supposedly represent the same file and line number in a CU, erases those that should be ignored when setting breakpoints by line (number or regex).
virtual std::optional< bool > AreEqualForFrameComparison (const SymbolContext &sc1, const SymbolContext &sc2) const
 Returns a boolean indicating whether two symbol contexts are equal for the purposes of frame comparison.
virtual std::string GetMissingVariableDiagnostic (llvm::StringRef name, const SymbolContext &sc) const
 Returns an explanation of why there is no variable named name in sc, for example because sc is a closure that didn't capture a variable of that name from its parent function, or an empty string.
virtual std::optional< bool > GetBooleanFromString (llvm::StringRef str) const
virtual bool SupportsExceptionBreakpointsOnThrow () const
 Returns true if this Language supports exception breakpoints on throw via a corresponding LanguageRuntime plugin.
virtual bool SupportsExceptionBreakpointsOnCatch () const
 Returns true if this Language supports exception breakpoints on catch via a corresponding LanguageRuntime plugin.
virtual llvm::StringRef GetThrowKeyword () const
 Returns the keyword used for throw statements in this language, e.g.
virtual llvm::StringRef GetCatchKeyword () const
 Returns the keyword used for catch statements in this language, e.g.
virtual FormatEntity::Entry GetFunctionNameFormat () const
virtual std::string GetVersionInfo () const
 Returns text to append to LLDB's version string, such as the revisions of compilers embedded in this plugin.
Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
virtual ~PluginInterface ()=default
 PluginInterface (const PluginInterface &)=delete
PluginInterface & operator= (const PluginInterface &)=delete

Static Public Member Functions

static void Initialize ()
static void Terminate ()
static Language * CreateInstance (lldb::LanguageType language)
static llvm::StringRef GetPluginNameStatic ()
Static Public Member Functions inherited from lldb_private::Language
static Language * FindPlugin (lldb::LanguageType language)
static Language * FindPlugin (llvm::StringRef file_path)
 Returns the Language associated with the given file path or a nullptr if there is no known language.
static Language * FindPlugin (lldb::LanguageType language, llvm::StringRef file_path)
static Language * FindPluginForManglingScheme (Mangled::ManglingScheme scheme)
 Returns the Language that registered scheme with Mangled::RegisterManglingScheme(), or a nullptr if none did.
static llvm::Expected< lldb::LanguageType > GetExceptionLanguageForLanguage (llvm::StringRef lang_name)
static void ForEach (llvm::function_ref< IterationAction(Language *)> callback)
static std::string GetVersionWithLanguageInfo ()
 Returns lldb_private::GetVersion(), followed by the GetVersionInfo() of each registered language plugin, in language type order.
static void GetDefaultExceptionResolverDescription (bool catch_on, bool throw_on, Stream &s)
static lldb::LanguageType GetLanguageTypeFromString (const char *string)=delete
static lldb::LanguageType GetLanguageTypeFromString (llvm::StringRef string)
static const char * GetNameForLanguageType (lldb::LanguageType language)
 Returns the internal LLDB name for the specified language.
static llvm::StringRef GetDisplayNameForLanguageType (lldb::LanguageType language)
 Returns a user-friendly name for the specified language.
static void PrintAllLanguages (Stream &s, const char *prefix, const char *suffix)
static void PrintSupportedLanguagesForExpressions (Stream &s, llvm::StringRef prefix, llvm::StringRef suffix)
 Prints to the specified stream 's' each language type that the current target supports for expression evaluation.
static void ForAllLanguages (llvm::function_ref< IterationAction(lldb::LanguageType)> callback)
static bool LanguageIsCPlusPlus (lldb::LanguageType language)
static bool LanguageIsObjC (lldb::LanguageType language)
static bool LanguageIsC (lldb::LanguageType language)
static bool LanguageIsCFamily (lldb::LanguageType language)
 Equivalent to LanguageIsC||LanguageIsObjC||LanguageIsCPlusPlus.
static bool LanguageIsFortran (lldb::LanguageType language)
static bool LanguageIsPascal (lldb::LanguageType language)
static bool LanguageIsRust (lldb::LanguageType language)
static lldb::LanguageType GetPrimaryLanguage (lldb::LanguageType language)
static std::set< lldb::LanguageType > GetSupportedLanguages ()
static LanguageSet GetLanguagesSupportingTypeSystems ()
static LanguageSet GetLanguagesSupportingTypeSystemsForExpressions ()
static LanguageSet GetLanguagesSupportingREPLs ()
static LanguageProperties & GetGlobalLanguageProperties ()

Additional Inherited Members

Public Types inherited from lldb_private::Language
enum class  FunctionNameRepresentation { eName , eNameWithArgs , eNameWithNoArgs }
Protected Member Functions inherited from lldb_private::Language
 Language ()

Detailed Description

Definition at line 24 of file RustLanguage.h.

Constructor & Destructor Documentation

◆ RustLanguage()

lldb_private::RustLanguage::RustLanguage ( )
default

Referenced by CreateInstance(), and Initialize().

◆ ~RustLanguage()

lldb_private::RustLanguage::~RustLanguage ( )
overridedefault

Member Function Documentation

◆ CreateInstance()

Language * RustLanguage::CreateInstance ( lldb::LanguageType language)
static

◆ DemangleSymbol()

Language::DemangledName RustLanguage::DemangleSymbol ( ConstString mangled,
Mangled::ManglingScheme scheme,
const DemangleOptions & options ) const
overridevirtual

Demangle mangled, a name mangled with scheme, a scheme that this language registered with Mangled::RegisterManglingScheme().

Reimplemented from lldb_private::Language.

Definition at line 84 of file RustLanguage.cpp.

References lldb_private::Demangle, g_rust_v0_scheme, lldb_private::GetLog(), lldb_private::ConstString::GetStringRef(), LLDB_LOG, and lldb_private::Language::DemangledName::name.

◆ GetFormatterLanguages()

std::vector< lldb::LanguageType > RustLanguage::GetFormatterLanguages ( lldb::LanguageType language) const
overridevirtual

Returns the languages whose formatters apply to values of language, in the order in which to consult them.

FormatManager consults the formatters of every language that a language plugin returns. By default, the formatters of this language apply to its own values.

Reimplemented from lldb_private::Language.

Definition at line 151 of file RustLanguage.cpp.

References lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeObjC, and lldb::eLanguageTypeRust.

◆ GetFormatters()

lldb::TypeCategoryImplSP RustLanguage::GetFormatters ( )
overridevirtual

◆ GetLanguageType()

lldb::LanguageType lldb_private::RustLanguage::GetLanguageType ( ) const
inlineoverridevirtual

Implements lldb_private::Language.

Definition at line 30 of file RustLanguage.h.

References lldb::eLanguageTypeRust.

◆ GetNilReferenceSummaryString()

llvm::StringRef lldb_private::RustLanguage::GetNilReferenceSummaryString ( )
inlineoverridevirtual

Rust has no null literal, so null pointers print like in C.

Reimplemented from lldb_private::Language.

Definition at line 41 of file RustLanguage.h.

◆ GetPluginName()

llvm::StringRef lldb_private::RustLanguage::GetPluginName ( )
inlineoverridevirtual

PluginInterface protocol.

Implements lldb_private::PluginInterface.

Definition at line 65 of file RustLanguage.h.

References GetPluginNameStatic().

Referenced by GetFormatters().

◆ GetPluginNameStatic()

llvm::StringRef lldb_private::RustLanguage::GetPluginNameStatic ( )
inlinestatic

Definition at line 62 of file RustLanguage.h.

Referenced by GetPluginName(), and Initialize().

◆ GetTypeScavenger()

◆ Initialize()

◆ IsCategoryApplicable()

bool RustLanguage::IsCategoryApplicable ( lldb::LanguageType category_language,
lldb::LanguageType valobj_language ) const
overridevirtual

Returns whether the formatters in a category for category_language, one of the languages of this plugin, apply to values of valobj_language.

By default, they only apply to values of category_language.

Reimplemented from lldb_private::Language.

Definition at line 158 of file RustLanguage.cpp.

References lldb::eLanguageTypeRust, and lldb_private::Language::LanguageIsC().

◆ IsNilReference()

◆ IsSourceFile()

bool RustLanguage::IsSourceFile ( llvm::StringRef file_path) const
overridevirtual

Implements lldb_private::Language.

Definition at line 53 of file RustLanguage.cpp.

◆ Terminate()


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