LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
lldb_private::Language Class Referenceabstract

#include <Language.h>

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

Classes

class  EitherTypeScavenger
 
class  ImageListTypeScavenger
 
class  MethodNameVariant
 
class  TypeScavenger
 
class  UnionTypeScavenger
 

Public Types

enum class  FunctionNameRepresentation { eName , eNameWithArgs , eNameWithNoArgs }
 

Public Member Functions

 ~Language () override
 
virtual lldb::LanguageType GetLanguageType () const =0
 
virtual llvm::StringRef GetUserEntryPointName () const
 
virtual bool IsTopLevelFunction (Function &function)
 
virtual bool IsSourceFile (llvm::StringRef file_path) const =0
 
virtual const HighlighterGetHighlighter () const
 
virtual lldb::TypeCategoryImplSP GetFormatters ()
 
virtual HardcodedFormatters::HardcodedFormatFinder GetHardcodedFormats ()
 
virtual HardcodedFormatters::HardcodedSummaryFinder GetHardcodedSummaries ()
 
virtual HardcodedFormatters::HardcodedSyntheticFinder GetHardcodedSynthetics ()
 
virtual std::vector< FormattersMatchCandidateGetPossibleFormattersMatches (ValueObject &valobj, lldb::DynamicValueType use_dynamic)
 
virtual std::unique_ptr< TypeScavengerGetTypeScavenger ()
 
virtual const char * GetLanguageSpecificTypeLookupHelp ()
 
virtual std::vector< Language::MethodNameVariantGetMethodNameVariants (ConstString method_name) const
 
virtual bool SymbolNameFitsToLanguage (Mangled name) const
 Returns true iff the given symbol name is compatible with the mangling scheme of this language.
 
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 IsNilReference (ValueObject &valobj)
 
virtual llvm::StringRef GetNilReferenceSummaryString ()
 Returns the summary string for ValueObjects for which IsNilReference() is true.
 
virtual bool IsUninitializedReference (ValueObject &valobj)
 
virtual bool GetFunctionDisplayName (const SymbolContext *sc, const ExecutionContext *exe_ctx, FunctionNameRepresentation representation, 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< ConstStringGenerateAlternateFunctionManglings (const ConstString mangled) const
 
virtual ConstString FindBestAlternateFunctionMangledName (const Mangled mangled, const SymbolContext &sym_ctx) const
 
virtual llvm::StringRef GetInstanceVariableName ()
 
virtual bool IgnoreForLineBreakpoints (const SymbolContext &) const
 Returns true if this SymbolContext should be ignored when setting breakpoints by line (number or regex).
 
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.
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual llvm::StringRef GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static LanguageFindPlugin (lldb::LanguageType language)
 
static LanguageFindPlugin (llvm::StringRef file_path)
 Returns the Language associated with the given file path or a nullptr if there is no known language.
 
static LanguageFindPlugin (lldb::LanguageType language, llvm::StringRef file_path)
 
static void ForEach (std::function< bool(Language *)> callback)
 
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)
 
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 (std::function< bool(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 LanguageIsPascal (lldb::LanguageType language)
 
static lldb::LanguageType GetPrimaryLanguage (lldb::LanguageType language)
 
static std::set< lldb::LanguageTypeGetSupportedLanguages ()
 
static LanguageSet GetLanguagesSupportingTypeSystems ()
 
static LanguageSet GetLanguagesSupportingTypeSystemsForExpressions ()
 
static LanguageSet GetLanguagesSupportingREPLs ()
 
static LanguagePropertiesGetGlobalLanguageProperties ()
 

Protected Member Functions

 Language ()
 

Private Member Functions

 Language (const Language &)=delete
 
const Languageoperator= (const Language &)=delete
 

Detailed Description

Definition at line 38 of file Language.h.

Member Enumeration Documentation

◆ FunctionNameRepresentation

Enumerator
eName 
eNameWithArgs 
eNameWithNoArgs 

Definition at line 150 of file Language.h.

Constructor & Destructor Documentation

◆ ~Language()

Language::~Language ( )
overridedefault

◆ Language() [1/2]

Language::Language ( )
protecteddefault

◆ Language() [2/2]

lldb_private::Language::Language ( const Language )
privatedelete

Member Function Documentation

◆ DemangledNameContainsPath()

bool Language::DemangledNameContainsPath ( llvm::StringRef  path,
ConstString  demangled 
) const
virtual

Reimplemented in lldb_private::CPlusPlusLanguage.

Definition at line 493 of file Language.cpp.

References lldb_private::ConstString::GetStringRef().

◆ FindBestAlternateFunctionMangledName()

virtual ConstString lldb_private::Language::FindBestAlternateFunctionMangledName ( const Mangled  mangled,
const SymbolContext sym_ctx 
) const
inlinevirtual

Reimplemented in lldb_private::CPlusPlusLanguage.

Definition at line 350 of file Language.h.

◆ FindPlugin() [1/3]

Language * Language::FindPlugin ( lldb::LanguageType  language)
static

Definition at line 84 of file Language.cpp.

References lldb_private::PluginManager::GetLanguageCreateCallbackAtIndex(), GetLanguagesMap(), and GetLanguagesMutex().

Referenced by lldb_private::BreakpointResolverName::AddNameLookup(), lldb_private::formatters::CFBagSummaryProvider(), lldb_private::formatters::CFBinaryHeapSummaryProvider(), lldb_private::IRExecutionUnit::CollectCandidateCPlusPlusNames(), lldb_private::Target::CreateBreakpointAtUserEntry(), FindPlugin(), ForEach(), lldb_private::FormatEntity::Format(), lldb::SBLanguageRuntime::GetCatchKeywordForLanguage(), ExceptionBreakpointResolver::GetDescription(), lldb_private::Mangled::GetDisplayDemangledName(), lldb_private::HighlighterManager::getHighlighterFor(), lldb_private::SymbolContext::GetInstanceVariableName(), lldb_private::Mangled::GetName(), lldb_private::FormatManager::GetPossibleMatches(), lldb::SBLanguageRuntime::GetThrowKeywordForLanguage(), lldb_private::ValueObjectPrinter::GetValueSummaryError(), lldb_private::ValueObject::IsLogicalTrue(), lldb_private::ValueObject::IsNilReference(), lldb_private::Function::IsTopLevelFunction(), lldb_private::ValueObject::IsUninitializedReference(), lldb_private::LanguageCategory::LanguageCategory(), lldb_private::Module::LookupInfo::NameMatchesLookupInfo(), lldb_private::formatters::NSArraySummaryProvider(), lldb_private::formatters::NSDictionarySummaryProvider(), NSNumber_FormatChar(), NSNumber_FormatDouble(), NSNumber_FormatFloat(), NSNumber_FormatInt(), NSNumber_FormatInt128(), NSNumber_FormatLong(), NSNumber_FormatShort(), lldb_private::formatters::NSSetSummaryProvider(), lldb_private::formatters::NSStringSummaryProvider(), lldb_private::formatters::NSTaggedString_SummaryProvider(), lldb_private::formatters::NSURLSummaryProvider(), lldb_private::ValueObjectPrinter::PrintDecl(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), lldb_private::BreakpointResolver::SetSCMatchesByLine(), lldb::SBLanguageRuntime::SupportsExceptionBreakpointsOnCatch(), and lldb::SBLanguageRuntime::SupportsExceptionBreakpointsOnThrow().

◆ FindPlugin() [2/3]

Language * Language::FindPlugin ( lldb::LanguageType  language,
llvm::StringRef  file_path 
)
static

Definition at line 121 of file Language.cpp.

References FindPlugin().

◆ FindPlugin() [3/3]

Language * Language::FindPlugin ( llvm::StringRef  file_path)
static

Returns the Language associated with the given file path or a nullptr if there is no known language.

Definition at line 109 of file Language.cpp.

References ForEach(), and IsSourceFile().

◆ ForAllLanguages()

void Language::ForAllLanguages ( std::function< bool(lldb::LanguageType)>  callback)
static

Definition at line 291 of file Language.cpp.

References language_names, and num_languages.

◆ ForEach()

void Language::ForEach ( std::function< bool(Language *)>  callback)
static

◆ GenerateAlternateFunctionManglings()

virtual std::vector< ConstString > lldb_private::Language::GenerateAlternateFunctionManglings ( const ConstString  mangled) const
inlinevirtual

Reimplemented in lldb_private::CPlusPlusLanguage.

Definition at line 345 of file Language.h.

◆ GetCatchKeyword()

virtual llvm::StringRef lldb_private::Language::GetCatchKeyword ( ) const
inlinevirtual

Returns the keyword used for catch statements in this language, e.g.

Python uses except. Defaults to catch.

Definition at line 380 of file Language.h.

◆ GetDeclPrintingHelper()

DumpValueObjectOptions::DeclPrintingHelper Language::GetDeclPrintingHelper ( )
virtual

Definition at line 501 of file Language.cpp.

◆ GetDefaultExceptionResolverDescription()

void Language::GetDefaultExceptionResolverDescription ( bool  catch_on,
bool  throw_on,
Stream s 
)
static

◆ GetDemangledFunctionNameWithoutArguments()

virtual ConstString lldb_private::Language::GetDemangledFunctionNameWithoutArguments ( Mangled  mangled) const
inlinevirtual

◆ GetDisplayDemangledName()

virtual ConstString lldb_private::Language::GetDisplayDemangledName ( Mangled  mangled) const
inlinevirtual

Definition at line 284 of file Language.h.

References lldb_private::Mangled::GetDemangledName().

◆ GetExceptionResolverDescription()

void Language::GetExceptionResolverDescription ( bool  catch_on,
bool  throw_on,
Stream s 
)
virtual

◆ GetFormatterPrefixSuffix()

std::pair< llvm::StringRef, llvm::StringRef > Language::GetFormatterPrefixSuffix ( llvm::StringRef  type_hint)
virtual

An individual data formatter may apply to several types and cross language boundaries.

Each of those languages may want to customize the display of values of said types by appending proper prefix/suffix information in language-specific ways. This function returns that prefix and suffix.

Parameters
[in]type_hintA StringRef used to determine what the prefix and suffix should be. It is called a hint because some types may have multiple variants for which the prefix and/or suffix may vary.
Returns
A std::pair<StringRef, StringRef>, the first being the prefix and the second being the suffix. They may be empty.

Reimplemented in lldb_private::ObjCLanguage.

Definition at line 489 of file Language.cpp.

◆ GetFormatters()

lldb::TypeCategoryImplSP Language::GetFormatters ( )
virtual

Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.

Definition at line 163 of file Language.cpp.

◆ GetFunctionDisplayName()

bool Language::GetFunctionDisplayName ( const SymbolContext sc,
const ExecutionContext exe_ctx,
FunctionNameRepresentation  representation,
Stream s 
)
virtual

Reimplemented in lldb_private::CPlusPlusLanguage.

Definition at line 513 of file Language.cpp.

Referenced by lldb_private::FormatEntity::Format().

◆ GetGlobalLanguageProperties()

LanguageProperties & Language::GetGlobalLanguageProperties ( )
static

◆ GetHardcodedFormats()

HardcodedFormatters::HardcodedFormatFinder Language::GetHardcodedFormats ( )
virtual

Definition at line 165 of file Language.cpp.

◆ GetHardcodedSummaries()

HardcodedFormatters::HardcodedSummaryFinder Language::GetHardcodedSummaries ( )
virtual

Reimplemented in lldb_private::CPlusPlusLanguage.

Definition at line 169 of file Language.cpp.

◆ GetHardcodedSynthetics()

HardcodedFormatters::HardcodedSyntheticFinder Language::GetHardcodedSynthetics ( )
virtual

Reimplemented in lldb_private::CPlusPlusLanguage.

Definition at line 174 of file Language.cpp.

◆ GetHighlighter()

virtual const Highlighter * lldb_private::Language::GetHighlighter ( ) const
inlinevirtual

◆ GetInstanceVariableName()

virtual llvm::StringRef lldb_private::Language::GetInstanceVariableName ( )
inlinevirtual

◆ GetLanguageSpecificTypeLookupHelp()

const char * Language::GetLanguageSpecificTypeLookupHelp ( )
virtual

Definition at line 440 of file Language.cpp.

◆ GetLanguagesSupportingREPLs()

LanguageSet Language::GetLanguagesSupportingREPLs ( )
static

◆ GetLanguagesSupportingTypeSystems()

LanguageSet Language::GetLanguagesSupportingTypeSystems ( )
static

◆ GetLanguagesSupportingTypeSystemsForExpressions()

LanguageSet Language::GetLanguagesSupportingTypeSystemsForExpressions ( )
static

◆ GetLanguageType()

virtual lldb::LanguageType lldb_private::Language::GetLanguageType ( ) const
pure virtual

◆ GetLanguageTypeFromString() [1/2]

static lldb::LanguageType lldb_private::Language::GetLanguageTypeFromString ( const char *  string)
staticdelete

◆ GetLanguageTypeFromString() [2/2]

LanguageType Language::GetLanguageTypeFromString ( llvm::StringRef  string)
static

Definition at line 257 of file Language.cpp.

References lldb::eLanguageTypeUnknown, and language_names.

◆ GetMethodNameVariants()

virtual std::vector< Language::MethodNameVariant > lldb_private::Language::GetMethodNameVariants ( ConstString  method_name) const
inlinevirtual

Reimplemented in lldb_private::ObjCLanguage.

Definition at line 213 of file Language.h.

◆ GetNameForLanguageType()

const char * Language::GetNameForLanguageType ( lldb::LanguageType  language)
static

◆ GetNilReferenceSummaryString()

virtual llvm::StringRef lldb_private::Language::GetNilReferenceSummaryString ( )
inlinevirtual

Returns the summary string for ValueObjects for which IsNilReference() is true.

Reimplemented in lldb_private::CPlusPlusLanguage, lldb_private::ObjCLanguage, and lldb_private::ObjCPlusPlusLanguage.

Definition at line 263 of file Language.h.

◆ GetPossibleFormattersMatches()

std::vector< FormattersMatchCandidate > Language::GetPossibleFormattersMatches ( ValueObject valobj,
lldb::DynamicValueType  use_dynamic 
)
virtual

Reimplemented in lldb_private::ObjCLanguage.

Definition at line 179 of file Language.cpp.

◆ GetPrimaryLanguage()

LanguageType Language::GetPrimaryLanguage ( lldb::LanguageType  language)
static

◆ GetSupportedLanguages()

std::set< lldb::LanguageType > Language::GetSupportedLanguages ( )
static

◆ GetThrowKeyword()

virtual llvm::StringRef lldb_private::Language::GetThrowKeyword ( ) const
inlinevirtual

Returns the keyword used for throw statements in this language, e.g.

Python uses raise. Defaults to throw.

Definition at line 376 of file Language.h.

◆ GetTypeScavenger()

std::unique_ptr< Language::TypeScavenger > Language::GetTypeScavenger ( )
virtual

Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.

Definition at line 436 of file Language.cpp.

◆ GetUserEntryPointName()

virtual llvm::StringRef lldb_private::Language::GetUserEntryPointName ( ) const
inlinevirtual

◆ IgnoreForLineBreakpoints()

virtual bool lldb_private::Language::IgnoreForLineBreakpoints ( const SymbolContext ) const
inlinevirtual

Returns true if this SymbolContext should be ignored when setting breakpoints by line (number or regex).

Helpful for languages that create artificial functions without meaningful user code associated with them (e.g. code that gets expanded in late compilation stages, like by CoroSplitter).

Definition at line 362 of file Language.h.

Referenced by lldb_private::BreakpointResolver::SetSCMatchesByLine().

◆ IsLogicalTrue()

LazyBool Language::IsLogicalTrue ( ValueObject valobj,
Status error 
)
virtual

Definition at line 505 of file Language.cpp.

References lldb_private::eLazyBoolCalculate.

◆ IsNilReference()

bool Language::IsNilReference ( ValueObject valobj)
virtual

Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.

Definition at line 509 of file Language.cpp.

◆ IsSourceFile()

virtual bool lldb_private::Language::IsSourceFile ( llvm::StringRef  file_path) const
pure virtual

◆ IsTopLevelFunction()

bool Language::IsTopLevelFunction ( Function function)
virtual

Definition at line 161 of file Language.cpp.

◆ IsUninitializedReference()

bool Language::IsUninitializedReference ( ValueObject valobj)
virtual

Definition at line 511 of file Language.cpp.

◆ LanguageIsC()

bool Language::LanguageIsC ( lldb::LanguageType  language)
static

◆ LanguageIsCFamily()

bool Language::LanguageIsCFamily ( lldb::LanguageType  language)
static

◆ LanguageIsCPlusPlus()

bool Language::LanguageIsCPlusPlus ( lldb::LanguageType  language)
static

◆ LanguageIsObjC()

bool Language::LanguageIsObjC ( lldb::LanguageType  language)
static

◆ LanguageIsPascal()

bool Language::LanguageIsPascal ( lldb::LanguageType  language)
static

Definition at line 356 of file Language.cpp.

References lldb::eLanguageTypePascal83.

◆ operator=()

const Language & lldb_private::Language::operator= ( const Language )
privatedelete

◆ PrintAllLanguages()

void Language::PrintAllLanguages ( Stream s,
const char *  prefix,
const char *  suffix 
)
static

◆ PrintSupportedLanguagesForExpressions()

void Language::PrintSupportedLanguagesForExpressions ( Stream s,
llvm::StringRef  prefix,
llvm::StringRef  suffix 
)
static

Prints to the specified stream 's' each language type that the current target supports for expression evaluation.

Parameters
[out]sStream to which the language types are written.
[in]prefixString that is prepended to the language type.
[in]suffixString that is appended to the language type.

Definition at line 273 of file Language.cpp.

References GetLanguagesSupportingTypeSystemsForExpressions(), language_names, and num_languages.

Referenced by lldb_private::OptionGroupWatchpoint::SetOptionValue(), and lldb_private::CommandObjectExpression::CommandOptions::SetOptionValue().

◆ SupportsExceptionBreakpointsOnCatch()

virtual bool lldb_private::Language::SupportsExceptionBreakpointsOnCatch ( ) const
inlinevirtual

Returns true if this Language supports exception breakpoints on catch via a corresponding LanguageRuntime plugin.

Definition at line 372 of file Language.h.

◆ SupportsExceptionBreakpointsOnThrow()

virtual bool lldb_private::Language::SupportsExceptionBreakpointsOnThrow ( ) const
inlinevirtual

Returns true if this Language supports exception breakpoints on throw via a corresponding LanguageRuntime plugin.

Reimplemented in lldb_private::ObjCLanguage.

Definition at line 368 of file Language.h.

◆ SymbolNameFitsToLanguage()

virtual bool lldb_private::Language::SymbolNameFitsToLanguage ( Mangled  name) const
inlinevirtual

Returns true iff the given symbol name is compatible with the mangling scheme of this language.

This function should only return true if there is a high confidence that the name actually belongs to this language.

Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.

Definition at line 222 of file Language.h.


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