LLDB mainline
|
#include <Language.h>
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 Highlighter * | GetHighlighter () const |
virtual lldb::TypeCategoryImplSP | GetFormatters () |
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< TypeScavenger > | GetTypeScavenger () |
virtual const char * | GetLanguageSpecificTypeLookupHelp () |
virtual std::vector< Language::MethodNameVariant > | GetMethodNameVariants (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< ConstString > | GenerateAlternateFunctionManglings (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 | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
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 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::LanguageType > | GetSupportedLanguages () |
static LanguageSet | GetLanguagesSupportingTypeSystems () |
static LanguageSet | GetLanguagesSupportingTypeSystemsForExpressions () |
static LanguageSet | GetLanguagesSupportingREPLs () |
static LanguageProperties & | GetGlobalLanguageProperties () |
Protected Member Functions | |
Language () | |
Private Member Functions | |
Language (const Language &)=delete | |
const Language & | operator= (const Language &)=delete |
Definition at line 38 of file Language.h.
|
strong |
Enumerator | |
---|---|
eName | |
eNameWithArgs | |
eNameWithNoArgs |
Definition at line 150 of file Language.h.
|
overridedefault |
|
protecteddefault |
|
privatedelete |
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 493 of file Language.cpp.
References lldb_private::ConstString::GetStringRef().
|
inlinevirtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 350 of file Language.h.
|
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().
|
static |
Definition at line 121 of file Language.cpp.
References FindPlugin().
|
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().
|
static |
Definition at line 291 of file Language.cpp.
References language_names, and num_languages.
|
static |
Definition at line 131 of file Language.cpp.
References lldb::eLanguageTypeUnknown, lldb::eNumLanguageTypes, FindPlugin(), GetLanguagesMap(), and GetLanguagesMutex().
Referenced by lldb_private::BreakpointResolverName::AddNameLookup(), FindPlugin(), GetSupportedLanguages(), lldb_private::Mangled::GuessLanguage(), and lldb_private::Symtab::InitNameIndexes().
|
inlinevirtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 345 of file Language.h.
|
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.
|
virtual |
Definition at line 501 of file Language.cpp.
|
static |
Definition at line 525 of file Language.cpp.
References lldb_private::Stream::Printf().
Referenced by ExceptionBreakpointResolver::GetDescription(), and GetExceptionResolverDescription().
|
inlinevirtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 277 of file Language.h.
References lldb_private::Mangled::GetDemangledName(), and lldb_private::Mangled::GetMangledName().
|
inlinevirtual |
Definition at line 284 of file Language.h.
References lldb_private::Mangled::GetDemangledName().
|
virtual |
Definition at line 520 of file Language.cpp.
References GetDefaultExceptionResolverDescription().
Referenced by ExceptionBreakpointResolver::GetDescription().
|
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.
[in] | type_hint | A 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. |
Reimplemented in lldb_private::ObjCLanguage.
Definition at line 489 of file Language.cpp.
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.
Definition at line 163 of file Language.cpp.
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 513 of file Language.cpp.
Referenced by lldb_private::FormatEntity::Format().
|
static |
Definition at line 40 of file Language.cpp.
Referenced by lldb_private::Debugger::Debugger(), and lldb_private::BreakpointResolver::SetSCMatchesByLine().
|
virtual |
Definition at line 165 of file Language.cpp.
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 169 of file Language.cpp.
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage.
Definition at line 174 of file Language.cpp.
|
inlinevirtual |
Reimplemented in lldb_private::CPlusPlusLanguage, lldb_private::ObjCLanguage, and lldb_private::ObjCPlusPlusLanguage.
Definition at line 180 of file Language.h.
Referenced by lldb_private::HighlighterManager::getHighlighterFor().
|
inlinevirtual |
Reimplemented in lldb_private::CPlusPlusLanguage, lldb_private::ObjCLanguage, and lldb_private::ObjCPlusPlusLanguage.
Definition at line 355 of file Language.h.
|
virtual |
Definition at line 440 of file Language.cpp.
|
static |
Definition at line 432 of file Language.cpp.
References lldb_private::PluginManager::GetREPLAllTypeSystemSupportedLanguages().
Referenced by GetHomeREPLInitFile(), lldb_private::Target::GetREPL(), and lldb_private::Debugger::RunREPL().
|
static |
Definition at line 424 of file Language.cpp.
References lldb_private::PluginManager::GetAllTypeSystemSupportedLanguagesForTypes().
Referenced by lldb_private::OptionValueLanguage::SetValueFromString(), and lldb_private::CommandCompletions::TypeLanguages().
|
static |
Definition at line 428 of file Language.cpp.
References lldb_private::PluginManager::GetAllTypeSystemSupportedLanguagesForExpressions().
Referenced by lldb_private::Target::GetScratchTypeSystemForLanguage(), lldb_private::Target::GetScratchTypeSystems(), and PrintSupportedLanguagesForExpressions().
|
pure virtual |
Implemented in lldb_private::CPlusPlusLanguage, lldb_private::ObjCLanguage, and lldb_private::ObjCPlusPlusLanguage.
Referenced by GetSupportedLanguages().
|
staticdelete |
Referenced by lldb_private::BreakpointResolverName::CreateFromStructuredData(), CommandObjectTypeLookup::DoExecute(), lldb::SBLanguageRuntime::GetLanguageTypeFromString(), lldb_private::Property::Property(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), CommandObjectTypeFormatterDelete::CommandOptions::SetOptionValue(), lldb_private::OptionGroupWatchpoint::SetOptionValue(), lldb_private::CommandObjectExpression::CommandOptions::SetOptionValue(), and lldb_private::OptionValueLanguage::SetValueFromString().
|
static |
Definition at line 257 of file Language.cpp.
References lldb::eLanguageTypeUnknown, and language_names.
|
inlinevirtual |
Reimplemented in lldb_private::ObjCLanguage.
Definition at line 213 of file Language.h.
|
static |
Definition at line 266 of file Language.cpp.
References lldb::eLanguageTypeUnknown, language_names, language_name_pair::name, and num_languages.
Referenced by lldb_private::Target::CreateUtilityFunction(), CommandObjectFormatterInfo< FormatterType >::DoExecute(), lldb_private::OptionValueLanguage::DumpValue(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindDefinitionDIE(), lldb_private::FormatEntity::Format(), lldb_private::CompileUnit::GetCachedLanguage(), lldb_private::TypeCategoryImpl::GetDescription(), lldb_private::SourceLanguage::GetDescription(), lldb_private::BreakpointResolverName::GetDescription(), lldb_private::Target::GetFunctionCallerForLanguage(), GetHomeREPLInitFile(), lldb::SBLanguageRuntime::GetNameForLanguageType(), lldb_private::Target::GetPersistentExpressionStateForLanguage(), lldb_private::Target::GetREPL(), lldb_private::Target::GetScratchTypeSystems(), lldb_private::TypeSystemMap::GetTypeSystemForLanguage(), lldb_private::Target::GetUserExpressionForLanguage(), lldb_private::Module::ReportWarningUnsupportedLanguage(), lldb_private::Debugger::RunREPL(), lldb_private::BreakpointResolverName::SerializeToStructuredData(), SetupLangOpts(), lldb_private::OptionValueLanguage::SetValueFromString(), lldb_private::OptionValueLanguage::ToJSON(), lldb_private::CommandCompletions::TypeLanguages(), and lldb_private::ValueObjectVTable::UpdateValue().
|
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.
|
virtual |
Reimplemented in lldb_private::ObjCLanguage.
Definition at line 179 of file Language.cpp.
|
static |
Definition at line 365 of file Language.cpp.
References lldb::eLanguageTypeAda83, lldb::eLanguageTypeAda95, 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::eLanguageTypeC_plus_plus_17, lldb::eLanguageTypeC_plus_plus_20, lldb::eLanguageTypeCobol74, lldb::eLanguageTypeCobol85, lldb::eLanguageTypeD, lldb::eLanguageTypeDylan, lldb::eLanguageTypeFortran03, lldb::eLanguageTypeFortran08, lldb::eLanguageTypeFortran77, lldb::eLanguageTypeFortran90, lldb::eLanguageTypeFortran95, lldb::eLanguageTypeGo, lldb::eLanguageTypeHaskell, lldb::eLanguageTypeJava, lldb::eLanguageTypeJulia, lldb::eLanguageTypeMipsAssembler, lldb::eLanguageTypeModula2, lldb::eLanguageTypeModula3, lldb::eLanguageTypeMojo, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, lldb::eLanguageTypeOCaml, lldb::eLanguageTypeOpenCL, lldb::eLanguageTypePascal83, lldb::eLanguageTypePLI, lldb::eLanguageTypePython, lldb::eLanguageTypeRust, lldb::eLanguageTypeSwift, lldb::eLanguageTypeUnknown, and lldb::eLanguageTypeUPC.
Referenced by lldb_private::Process::GetLanguageRuntime(), and lldb_private::BreakpointResolverName::SearchCallback().
|
static |
Definition at line 415 of file Language.cpp.
References ForEach(), and GetLanguageType().
Referenced by lldb_private::Target::CreateBreakpointAtUserEntry(), CommandObjectMemoryRead::DoExecute(), lldb_private::Process::GetLanguageRuntimes(), lldb_private::LanguageRuntime::GetRuntimeUnwindPlan(), and lldb_private::Process::ModulesDidLoad().
|
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.
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.
Definition at line 436 of file Language.cpp.
|
inlinevirtual |
Reimplemented in lldb_private::CPlusPlusLanguage, lldb_private::ObjCLanguage, and lldb_private::ObjCPlusPlusLanguage.
Definition at line 174 of file Language.h.
Referenced by lldb_private::Target::CreateBreakpointAtUserEntry().
|
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().
|
virtual |
Definition at line 505 of file Language.cpp.
References lldb_private::eLazyBoolCalculate.
|
virtual |
Reimplemented in lldb_private::CPlusPlusLanguage, and lldb_private::ObjCLanguage.
Definition at line 509 of file Language.cpp.
|
pure virtual |
Implemented in lldb_private::CPlusPlusLanguage, lldb_private::ObjCLanguage, and lldb_private::ObjCPlusPlusLanguage.
Referenced by FindPlugin().
|
virtual |
Definition at line 161 of file Language.cpp.
|
virtual |
Definition at line 511 of file Language.cpp.
|
static |
Definition at line 324 of file Language.cpp.
References lldb::eLanguageTypeC, lldb::eLanguageTypeC11, lldb::eLanguageTypeC89, and lldb::eLanguageTypeC99.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), and lldb_private::CPlusPlusLanguage::GetTypeScavenger().
|
static |
Equivalent to LanguageIsC||LanguageIsObjC||LanguageIsCPlusPlus
.
Definition at line 336 of file Language.cpp.
References 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::eLanguageTypeC_plus_plus_17, lldb::eLanguageTypeC_plus_plus_20, lldb::eLanguageTypeObjC, and lldb::eLanguageTypeObjC_plus_plus.
Referenced by lldb_private::ValueObject::GetObjectDescription(), and lldb::SBLanguageRuntime::LanguageIsCFamily().
|
static |
Definition at line 299 of file Language.cpp.
References lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeC_plus_plus_03, lldb::eLanguageTypeC_plus_plus_11, lldb::eLanguageTypeC_plus_plus_14, lldb::eLanguageTypeC_plus_plus_17, lldb::eLanguageTypeC_plus_plus_20, and lldb::eLanguageTypeObjC_plus_plus.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::CPlusPlusLanguage::CreateInstance(), lldb_private::CPlusPlusLanguage::GetTypeScavenger(), DWARFASTParserClang::GetUniqueTypeNameAndDeclaration(), lldb_private::CPlusPlusLanguage::IsNilReference(), lldb::SBLanguageRuntime::LanguageIsCPlusPlus(), DWARFASTParserClang::ParseFunctionFromDWARF(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariableDIE().
|
static |
Definition at line 314 of file Language.cpp.
References lldb::eLanguageTypeObjC, and lldb::eLanguageTypeObjC_plus_plus.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::ValueObject::Dereference(), lldb_private::ObjCLanguage::GetTypeScavenger(), lldb::SBLanguageRuntime::LanguageIsObjC(), and DWARFASTParserClang::ParseFunctionFromDWARF().
|
static |
Definition at line 356 of file Language.cpp.
References lldb::eLanguageTypePascal83.
|
static |
Definition at line 284 of file Language.cpp.
References language_names, num_languages, and lldb_private::Stream::Printf().
Referenced by lldb_private::LanguageTypeHelpTextCallback().
|
static |
Prints to the specified stream 's' each language type that the current target supports for expression evaluation.
[out] | s | Stream to which the language types are written. |
[in] | prefix | String that is prepended to the language type. |
[in] | suffix | String 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().
|
inlinevirtual |
Returns true if this Language supports exception breakpoints on catch via a corresponding LanguageRuntime plugin.
Definition at line 372 of file Language.h.
|
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.
|
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.