LLDB mainline
|
General Outline: Provides the callback and search depth for the SearchFilter search. More...
#include "lldb/Core/SearchFilter.h"
Public Types | |
enum | FilterTy { Unconstrained = 0 , Exception , ByModule , ByModules , ByModulesAndCU , LastKnownFilterType = ByModulesAndCU , UnknownFilter } |
Public Member Functions | |
SearchFilter (const lldb::TargetSP &target_sp) | |
The basic constructor takes a Target, which gives the space to search. | |
SearchFilter (const lldb::TargetSP &target_sp, unsigned char filterType) | |
virtual | ~SearchFilter () |
virtual bool | ModulePasses (const FileSpec &spec) |
Call this method with a file spec to see if that spec passes the filter. | |
virtual bool | ModulePasses (const lldb::ModuleSP &module_sp) |
Call this method with a Module to see if that module passes the filter. | |
virtual bool | AddressPasses (Address &addr) |
Call this method with a Address to see if address passes the filter. | |
virtual bool | CompUnitPasses (FileSpec &fileSpec) |
Call this method with a FileSpec to see if file spec passes the filter as the name of a compilation unit. | |
virtual bool | CompUnitPasses (CompileUnit &compUnit) |
Call this method with a CompileUnit to see if comp unit passes the filter. | |
virtual bool | FunctionPasses (Function &function) |
Call this method with a Function to see if function passes the filter. | |
virtual void | Search (Searcher &searcher) |
Call this method to do the search using the Searcher. | |
virtual void | SearchInModuleList (Searcher &searcher, ModuleList &modules) |
Call this method to do the search using the Searcher in the module list modules. | |
virtual uint32_t | GetFilterRequiredItems () |
This determines which items are REQUIRED for the filter to pass. | |
virtual void | GetDescription (Stream *s) |
Prints a canonical description for the search filter to the stream s. | |
virtual void | Dump (Stream *s) const |
Standard "Dump" method. At present it does nothing. | |
lldb::SearchFilterSP | CreateCopy (lldb::TargetSP &target_sp) |
virtual StructuredData::ObjectSP | SerializeToStructuredData () |
enum FilterTy | GetFilterTy () |
const char * | GetFilterName () |
Static Public Member Functions | |
static lldb::SearchFilterSP | CreateFromStructuredData (const lldb::TargetSP &target_sp, const StructuredData::Dictionary &data_dict, Status &error) |
static const char * | GetSerializationKey () |
static const char * | GetSerializationSubclassKey () |
static const char * | GetSerializationSubclassOptionsKey () |
static const char * | FilterTyToName (enum FilterTy) |
static FilterTy | NameToFilterTy (llvm::StringRef name) |
Static Public Attributes | |
static const char * | g_ty_to_name [LastKnownFilterType+2] |
Protected Types | |
enum | OptionNames { ModList = 0 , CUList , LanguageName , LastOptionName } |
Protected Member Functions | |
StructuredData::DictionarySP | WrapOptionsDict (StructuredData::DictionarySP options_dict_sp) |
void | SerializeFileSpecList (StructuredData::DictionarySP &options_dict_sp, OptionNames name, FileSpecList &file_list) |
Searcher::CallbackReturn | DoModuleIteration (const SymbolContext &context, Searcher &searcher) |
Searcher::CallbackReturn | DoModuleIteration (const lldb::ModuleSP &module_sp, Searcher &searcher) |
Searcher::CallbackReturn | DoCUIteration (const lldb::ModuleSP &module_sp, const SymbolContext &context, Searcher &searcher) |
Searcher::CallbackReturn | DoFunctionIteration (Function *function, const SymbolContext &context, Searcher &searcher) |
virtual lldb::SearchFilterSP | DoCreateCopy ()=0 |
void | SetTarget (lldb::TargetSP &target_sp) |
Static Protected Member Functions | |
static const char * | GetKey (enum OptionNames enum_value) |
Protected Attributes | |
lldb::TargetSP | m_target_sp |
Static Protected Attributes | |
static const char * | g_option_names [LastOptionName] |
Private Attributes | |
unsigned char | SubclassID |
General Outline: Provides the callback and search depth for the SearchFilter search.
Class descends through the SymbolContext space of the target, applying a filter at each stage till it reaches the depth specified by the GetDepth method of the searcher, and calls its callback at that point.
The search is done by cooperation between the search filter and the searcher. The search filter does the heavy work of recursing through the SymbolContext space of the target program's symbol space. The Searcher specifies the depth at which it wants its callback to be invoked. Note that since the resolution of the Searcher may be greater than that of the SearchFilter, before the Searcher qualifies an address it should pass it to "AddressPasses." The default implementation is "Everything Passes."
Definition at line 83 of file SearchFilter.h.
Enumerator | |
---|---|
Unconstrained | |
Exception | |
ByModule | |
ByModules | |
ByModulesAndCU | |
LastKnownFilterType | |
UnknownFilter |
Definition at line 217 of file SearchFilter.h.
|
protected |
Enumerator | |
---|---|
ModList | |
CUList | |
LanguageName | |
LastOptionName |
Definition at line 244 of file SearchFilter.h.
lldb_private::SearchFilter::SearchFilter | ( | const lldb::TargetSP & | target_sp | ) |
SearchFilter::SearchFilter | ( | const lldb::TargetSP & | target_sp, |
unsigned char | filterType | ||
) |
Definition at line 72 of file SearchFilter.cpp.
|
virtualdefault |
|
virtual |
Call this method with a Address to see if address passes the filter.
[in] | addr | The address to check against the filter. |
true
. Reimplemented in lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, and lldb_private::SearchFilterByModuleListAndCU.
Definition at line 141 of file SearchFilter.cpp.
Referenced by lldb_private::BreakpointResolver::AddLocation(), FunctionPasses(), lldb_private::BreakpointResolverAddress::SearchCallback(), and lldb_private::BreakpointResolverName::SearchCallback().
|
virtual |
Call this method with a CompileUnit to see if comp unit passes the filter.
[in] | compUnit | The CompileUnit to check against the filter. |
true
. Reimplemented in lldb_private::SearchFilterByModuleListAndCU.
Definition at line 145 of file SearchFilter.cpp.
|
virtual |
Call this method with a FileSpec to see if file spec passes the filter as the name of a compilation unit.
[in] | fileSpec | The file spec to check against the filter. |
true
. Reimplemented in lldb_private::SearchFilterByModuleListAndCU.
Definition at line 143 of file SearchFilter.cpp.
Referenced by DoCUIteration(), lldb_private::BreakpointResolverFileLine::SearchCallback(), and lldb_private::BreakpointResolverName::SearchCallback().
lldb::SearchFilterSP SearchFilter::CreateCopy | ( | lldb::TargetSP & | target_sp | ) |
Definition at line 164 of file SearchFilter.cpp.
References DoCreateCopy().
|
static |
Definition at line 77 of file SearchFilter.cpp.
References ByModule, ByModules, ByModulesAndCU, lldb_private::SearchFilterForUnconstrainedSearches::CreateFromStructuredData(), lldb_private::SearchFilterByModule::CreateFromStructuredData(), lldb_private::SearchFilterByModuleList::CreateFromStructuredData(), lldb_private::SearchFilterByModuleListAndCU::CreateFromStructuredData(), error(), Exception, GetSerializationSubclassKey(), GetSerializationSubclassOptionsKey(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsDictionary(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsString(), lldb_private::StructuredData::Object::IsValid(), NameToFilterTy(), Unconstrained, and UnknownFilter.
Referenced by lldb_private::Breakpoint::CreateFromStructuredData().
|
protectedpure virtual |
|
protected |
Definition at line 289 of file SearchFilter.cpp.
References lldb_private::SymbolContext::comp_unit, CompUnitPasses(), lldb_private::Searcher::eCallbackReturnContinue, lldb_private::Searcher::eCallbackReturnPop, lldb_private::Searcher::eCallbackReturnStop, lldb::eSearchDepthCompUnit, lldb::eSearchDepthFunction, FunctionPasses(), lldb_private::Searcher::GetDepth(), m_target_sp, lldb_private::SymbolFile::ParseFunctions(), and lldb_private::Searcher::SearchCallback().
Referenced by DoModuleIteration(), and lldb_private::SearchFilterByModuleListAndCU::Search().
|
protected |
Definition at line 346 of file SearchFilter.cpp.
References lldb_private::Searcher::eCallbackReturnContinue.
|
protected |
Definition at line 240 of file SearchFilter.cpp.
References DoModuleIteration(), and m_target_sp.
|
protected |
Definition at line 247 of file SearchFilter.cpp.
References DoCUIteration(), lldb_private::Searcher::eCallbackReturnContinue, lldb_private::Searcher::eCallbackReturnPop, lldb_private::Searcher::eCallbackReturnStop, lldb::eSearchDepthModule, lldb_private::Searcher::GetDepth(), m_target_sp, lldb_private::SymbolContext::module_sp, ModulePasses(), and lldb_private::Searcher::SearchCallback().
Referenced by DoModuleIteration(), Search(), lldb_private::SearchFilterByModule::Search(), lldb_private::SearchFilterByModuleList::Search(), lldb_private::SearchFilterByModuleListAndCU::Search(), and SearchInModuleList().
|
virtual |
Standard "Dump" method. At present it does nothing.
Reimplemented in lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, and lldb_private::SearchFilterByModuleListAndCU.
Definition at line 162 of file SearchFilter.cpp.
|
static |
Definition at line 51 of file SearchFilter.cpp.
References g_ty_to_name, LastKnownFilterType, and UnknownFilter.
Referenced by GetFilterName().
|
virtual |
Call this method with a Function to see if function passes the filter.
[in] | function | The Functions to check against the filter. |
Definition at line 147 of file SearchFilter.cpp.
References AddressPasses(), lldb_private::Function::GetAddressRange(), and lldb_private::AddressRange::GetBaseAddress().
Referenced by DoCUIteration().
|
virtual |
Prints a canonical description for the search filter to the stream s.
[in] | s | Stream to which the output is copied. |
Reimplemented in lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, lldb_private::SearchFilterByModuleListAndCU, and lldb_private::ExceptionSearchFilter.
Definition at line 160 of file SearchFilter.cpp.
|
inline |
Definition at line 236 of file SearchFilter.h.
References FilterTyToName(), and GetFilterTy().
Referenced by WrapOptionsDict().
|
virtual |
This determines which items are REQUIRED for the filter to pass.
For instance, if you are filtering by Compilation Unit, obviously symbols that have no compilation unit can't pass So return eSymbolContextCU and search callbacks can then short cut the search to avoid looking at things that obviously won't pass.
Reimplemented in lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, and lldb_private::SearchFilterByModuleListAndCU.
Definition at line 156 of file SearchFilter.cpp.
Referenced by lldb_private::BreakpointResolverName::SearchCallback().
|
inline |
Definition at line 229 of file SearchFilter.h.
References LastKnownFilterType, SubclassID, and UnknownFilter.
Referenced by GetFilterName().
|
inlinestaticprotected |
Definition at line 247 of file SearchFilter.h.
References g_option_names.
Referenced by lldb_private::SearchFilterByModule::CreateFromStructuredData(), lldb_private::SearchFilterByModuleList::CreateFromStructuredData(), lldb_private::SearchFilterByModuleListAndCU::CreateFromStructuredData(), SerializeFileSpecList(), and lldb_private::SearchFilterByModule::SerializeToStructuredData().
|
inlinestatic |
Definition at line 211 of file SearchFilter.h.
Referenced by lldb_private::Breakpoint::CreateFromStructuredData(), and lldb_private::Breakpoint::SerializeToStructuredData().
|
inlinestatic |
Definition at line 213 of file SearchFilter.h.
Referenced by CreateFromStructuredData(), and WrapOptionsDict().
|
inlinestatic |
Definition at line 215 of file SearchFilter.h.
Referenced by CreateFromStructuredData(), and WrapOptionsDict().
|
virtual |
Call this method with a file spec to see if that spec passes the filter.
[in] | spec | The file spec to check against the filter. |
true
. Reimplemented in lldb_private::SearchFilterForUnconstrainedSearches, lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, and lldb_private::ExceptionSearchFilter.
Definition at line 137 of file SearchFilter.cpp.
Referenced by DoModuleIteration(), and SearchInModuleList().
|
virtual |
Call this method with a Module to see if that module passes the filter.
[in] | module_sp | The Module to check against the filter. |
true
. Reimplemented in lldb_private::SearchFilterForUnconstrainedSearches, lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, and lldb_private::ExceptionSearchFilter.
Definition at line 139 of file SearchFilter.cpp.
|
static |
Definition at line 58 of file SearchFilter.cpp.
References g_ty_to_name, LastKnownFilterType, and UnknownFilter.
Referenced by CreateFromStructuredData().
|
virtual |
Call this method to do the search using the Searcher.
[in] | searcher | The searcher to drive with this search. |
Reimplemented in lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, lldb_private::SearchFilterByModuleListAndCU, and lldb_private::ExceptionSearchFilter.
Definition at line 204 of file SearchFilter.cpp.
References DoModuleIteration(), lldb::eSearchDepthTarget, lldb_private::Searcher::GetDepth(), m_target_sp, lldb_private::Searcher::SearchCallback(), and lldb_private::SymbolContext::target_sp.
Referenced by CommandObjectSourceList::DisplayFunctionSource(), CommandObjectSourceList::DoExecute(), lldb_private::AddressResolver::ResolveAddress(), and lldb_private::BreakpointResolver::ResolveBreakpoint().
|
virtual |
Call this method to do the search using the Searcher in the module list modules.
[in] | searcher | The searcher to drive with this search. |
[in] | modules | The module list within which to restrict the search. |
Definition at line 219 of file SearchFilter.cpp.
References DoModuleIteration(), lldb_private::Searcher::eCallbackReturnStop, lldb::eSearchDepthTarget, lldb_private::Searcher::GetDepth(), m_target_sp, ModulePasses(), lldb_private::ModuleList::Modules(), lldb_private::Searcher::SearchCallback(), and lldb_private::SymbolContext::target_sp.
Referenced by lldb_private::AddressResolver::ResolveAddressInModules(), and lldb_private::BreakpointResolver::ResolveBreakpointInModules().
|
protected |
Definition at line 184 of file SearchFilter.cpp.
References lldb_private::FileSpecList::GetFileSpecAtIndex(), GetKey(), lldb_private::FileSpec::GetPath(), and lldb_private::FileSpecList::GetSize().
Referenced by lldb_private::SearchFilterByModuleListAndCU::SerializeToStructuredData(), and lldb_private::SearchFilterByModuleList::SerializeUnwrapped().
|
inlinevirtual |
Reimplemented in lldb_private::SearchFilterForUnconstrainedSearches, lldb_private::SearchFilterByModule, lldb_private::SearchFilterByModuleList, lldb_private::SearchFilterByModuleListAndCU, and lldb_private::ExceptionSearchFilter.
Definition at line 207 of file SearchFilter.h.
|
inlineprotected |
Definition at line 276 of file SearchFilter.h.
References m_target_sp.
|
protected |
Definition at line 173 of file SearchFilter.cpp.
References GetFilterName(), GetSerializationSubclassKey(), and GetSerializationSubclassOptionsKey().
Referenced by lldb_private::SearchFilterForUnconstrainedSearches::SerializeToStructuredData(), lldb_private::SearchFilterByModule::SerializeToStructuredData(), lldb_private::SearchFilterByModuleList::SerializeToStructuredData(), and lldb_private::SearchFilterByModuleListAndCU::SerializeToStructuredData().
|
staticprotected |
Definition at line 245 of file SearchFilter.h.
Referenced by GetKey().
|
static |
Definition at line 227 of file SearchFilter.h.
Referenced by FilterTyToName(), and NameToFilterTy().
|
protected |
Definition at line 278 of file SearchFilter.h.
Referenced by DoCUIteration(), DoModuleIteration(), lldb_private::SearchFilterForUnconstrainedSearches::ModulePasses(), Search(), lldb_private::SearchFilterByModule::Search(), lldb_private::SearchFilterByModuleList::Search(), lldb_private::SearchFilterByModuleListAndCU::Search(), SearchInModuleList(), SetTarget(), and lldb_private::ExceptionSearchFilter::UpdateModuleListIfNeeded().
|
private |
Definition at line 282 of file SearchFilter.h.
Referenced by GetFilterTy().