|
LLDB mainline
|
A class that encapsulates name lookup information. More...
#include "lldb/Core/Module.h"
Public Member Functions | |
| LookupInfo ()=default | |
| LookupInfo (const LookupInfo &lookup_info, ConstString lookup_name) | |
| Copies an existing LookupInfo with a different lookup name. | |
| ConstString | GetName () const |
| ConstString | GetLookupName () const |
| lldb::FunctionNameType | GetNameTypeMask () const |
| lldb::LanguageType | GetLanguageType () const |
| bool | NameMatchesLookupInfo (ConstString function_name, lldb::LanguageType language_type=lldb::eLanguageTypeUnknown) const |
| void | Prune (SymbolContextList &sc_list, size_t start_idx) const |
Static Public Member Functions | |
| static std::vector< LookupInfo > | MakeLookupInfos (ConstString name, lldb::FunctionNameType name_type_mask, lldb::LanguageType lang_type, ConstString lookup_name_override={}) |
| Creates a vector of lookup infos for function name resolution. | |
Protected Attributes | |
| ConstString | m_name |
| What the user originally typed. | |
| ConstString | m_lookup_name |
| The actual name will lookup when calling in the object or symbol file. | |
| lldb::LanguageType | m_language = lldb::eLanguageTypeUnknown |
| Limit matches to only be for this language. | |
| lldb::FunctionNameType | m_name_type_mask = lldb::eFunctionNameTypeNone |
| One or more bits from lldb::FunctionNameType that indicate what kind of names we are looking for. | |
| bool | m_match_name_after_lookup = false |
| If true, then demangled names that match will need to contain "m_name" in order to be considered a match. | |
Private Member Functions | |
| LookupInfo (ConstString name, ConstString lookup_name, lldb::FunctionNameType name_type_mask, lldb::LanguageType lang_type) | |
A class that encapsulates name lookup information.
Users can type a wide variety of partial names when setting breakpoints by name or when looking for functions by name. The SymbolFile object is only required to implement name lookup for function basenames and for fully mangled names. This means if the user types in a partial name, we must reduce this to a name lookup that will work with all SymbolFile objects. So we might reduce a name lookup to look for a basename, and then prune out any results that don't match.
The "m_name" member variable represents the name as it was typed by the user. "m_lookup_name" will be the name we actually search for through the symbol or objects files. Lanaguage is included in case we need to filter results by language at a later date. The "m_name_type_mask" member variable tells us what kinds of names we are looking for and can help us prune out unwanted results.
Function lookups are done in Module.cpp, ModuleList.cpp and in BreakpointResolverName.cpp and they all now use this class to do lookups correctly.
|
default |
References LookupInfo().
Referenced by LookupInfo(), and LookupInfo().
| Module::LookupInfo::LookupInfo | ( | const LookupInfo & | lookup_info, |
| ConstString | lookup_name ) |
Copies an existing LookupInfo with a different lookup name.
Definition at line 644 of file Module.cpp.
References GetLanguageType(), GetName(), GetNameTypeMask(), LookupInfo(), m_language, m_lookup_name, m_name, and m_name_type_mask.
|
private |
|
inline |
Definition at line 951 of file Module.h.
References m_language.
Referenced by LookupInfo(), and lldb_private::plugin::dwarf::DWARFIndex::ProcessFunctionDIE().
|
inline |
Definition at line 947 of file Module.h.
References m_lookup_name.
Referenced by lldb_private::breakpad::SymbolFileBreakpad::FindFunctions(), lldb_private::npdb::SymbolFileNativePDB::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindFunctions(), lldb_private::SymbolFileCTF::FindFunctions(), lldb_private::SymbolFileOnDemand::FindFunctions(), SymbolFilePDB::FindFunctions(), lldb_private::plugin::dwarf::AppleDWARFIndex::GetFunctions(), lldb_private::plugin::dwarf::DebugNamesDWARFIndex::GetFunctions(), lldb_private::plugin::dwarf::ManualDWARFIndex::GetFunctions(), and lldb_private::plugin::dwarf::DWARFIndex::ProcessFunctionDIE().
|
inline |
Definition at line 945 of file Module.h.
References m_name.
Referenced by lldb_private::npdb::SymbolFileNativePDB::FindFunctions(), SymbolFilePDB::FindFunctions(), and LookupInfo().
|
inline |
Definition at line 949 of file Module.h.
References m_name_type_mask.
Referenced by lldb_private::npdb::SymbolFileNativePDB::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindFunctions(), lldb_private::SymbolFileOnDemand::FindFunctions(), SymbolFilePDB::FindFunctions(), lldb_private::plugin::dwarf::ManualDWARFIndex::GetFunctions(), LookupInfo(), and lldb_private::plugin::dwarf::DWARFIndex::ProcessFunctionDIE().
|
static |
Creates a vector of lookup infos for function name resolution.
| [in] | name | The function name to search for. This can be a simple name like "foo" or a qualified name like "Class::method". |
| [in] | name_type_mask | A bitmask specifying what types of names to search for (e.g., eFunctionNameTypeFull, eFunctionNameTypeBase, eFunctionNameTypeMethod, eFunctionNameTypeAuto). Multiple types can be combined with bitwise OR. |
| [in] | lang_type | The language to create lookups for. If eLanguageTypeUnknown is passed, creates one LookupInfo for each language plugin currently available in LLDB. If a specific language is provided, creates only a single LookupInfo for that language. |
| [in] | lookup_name_override | Manually override the name used for lookup. This parameter is optional. If not provided, it will be set to the value of the name parameter. |
Definition at line 705 of file Module.cpp.
References lldb_private::Continue, lldb::eLanguageTypeC_plus_plus, lldb::eLanguageTypeObjC, lldb::eLanguageTypeUnknown, lldb_private::Language::ForEach(), and lldb_private::Language::GetLanguageType().
Referenced by lldb_private::BreakpointResolverName::AddNameLookup(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindFunctionDefinition(), and lldb_private::ModuleList::FindFunctionSymbols().
| bool Module::LookupInfo::NameMatchesLookupInfo | ( | ConstString | function_name, |
| lldb::LanguageType | language_type = lldb::eLanguageTypeUnknown ) const |
Definition at line 736 of file Module.cpp.
References lldb_private::Mangled::eManglingSchemeNone, lldb_private::Language::FindPlugin(), lldb_private::Mangled::GetDemangledName(), lldb_private::Mangled::GetManglingScheme(), and m_name.
Referenced by lldb_private::plugin::dwarf::DWARFIndex::ProcessFunctionDIE(), and Prune().
| void Module::LookupInfo::Prune | ( | SymbolContextList & | sc_list, |
| size_t | start_idx ) const |
Definition at line 769 of file Module.cpp.
References lldb::eLanguageTypeC_plus_plus, lldb_private::Mangled::ePreferMangled, lldb_private::Language::FindPlugin(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::SymbolContext::GetFunctionName(), lldb_private::SymbolContext::GetLanguage(), lldb_private::Language::GetMethodName(), lldb_private::SymbolContextList::GetSize(), m_match_name_after_lookup, m_name, m_name_type_mask, NameMatchesLookupInfo(), and lldb_private::SymbolContextList::RemoveContextAtIndex().
|
protected |
Limit matches to only be for this language.
Definition at line 967 of file Module.h.
Referenced by GetLanguageType(), and LookupInfo().
|
protected |
The actual name will lookup when calling in the object or symbol file.
Definition at line 964 of file Module.h.
Referenced by GetLookupName(), and LookupInfo().
|
protected |
|
protected |
What the user originally typed.
Definition at line 961 of file Module.h.
Referenced by GetName(), LookupInfo(), NameMatchesLookupInfo(), and Prune().
|
protected |
One or more bits from lldb::FunctionNameType that indicate what kind of names we are looking for.
Definition at line 971 of file Module.h.
Referenced by GetNameTypeMask(), LookupInfo(), and Prune().