NFC: Move Searcher::Depth into lldb-enumerations as SearchDepth.

In a subsequent commit, I will need to expose the search depth
to the SB API's, so I'm moving this define into lldb-enumerations
where it will get added to the lldb module.

llvm-svn: 341690
This commit is contained in:
Jim Ingham 2018-09-07 18:43:04 +00:00
parent 960324471b
commit 4911d36aa6
21 changed files with 57 additions and 56 deletions

View File

@ -51,7 +51,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -45,7 +45,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -47,7 +47,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -65,7 +65,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -47,7 +47,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -52,7 +52,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -48,7 +48,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
void GetDescription(Stream *s) override;

View File

@ -70,15 +70,6 @@ public:
eCallbackReturnPop // Pop one level up and continue iterating
} CallbackReturn;
typedef enum {
eDepthTarget,
eDepthModule,
eDepthCompUnit,
eDepthFunction,
eDepthBlock,
eDepthAddress
} Depth;
Searcher();
virtual ~Searcher();
@ -87,7 +78,7 @@ public:
SymbolContext &context, Address *addr,
bool complete) = 0;
virtual Depth GetDepth() = 0;
virtual lldb::SearchDepth GetDepth() = 0;
//------------------------------------------------------------------
/// Prints a canonical description for the searcher to the stream \a s.

View File

@ -116,7 +116,7 @@ public:
CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context,
Address *addr, bool complete) override = 0;
Depth GetDepth() override = 0;
lldb::SearchDepth GetDepth() override = 0;
virtual size_t DoCompletion(SearchFilter *filter) = 0;
@ -136,7 +136,7 @@ public:
SourceFileCompleter(CommandInterpreter &interpreter,
bool include_support_files, CompletionRequest &request);
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
SymbolContext &context,
@ -162,7 +162,7 @@ public:
ModuleCompleter(CommandInterpreter &interpreter,
CompletionRequest &request);
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
SymbolContext &context,
@ -186,7 +186,7 @@ public:
SymbolCompleter(CommandInterpreter &interpreter,
CompletionRequest &request);
Searcher::Depth GetDepth() override;
lldb::SearchDepth GetDepth() override;
Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
SymbolContext &context,

View File

@ -256,6 +256,16 @@ enum ExpressionResults {
eExpressionStoppedForDebug
};
enum SearchDepth {
eSearchDepthTarget = 0,
eSearchDepthModule,
eSearchDepthCompUnit,
eSearchDepthFunction,
eSearchDepthBlock,
eSearchDepthAddress,
kNumSearchDepthKinds = eSearchDepthAddress
};
//----------------------------------------------------------------------
// Connection Status Types
//----------------------------------------------------------------------

View File

@ -173,8 +173,8 @@ BreakpointResolverAddress::SearchCallback(SearchFilter &filter,
return Searcher::eCallbackReturnStop;
}
Searcher::Depth BreakpointResolverAddress::GetDepth() {
return Searcher::eDepthTarget;
lldb::SearchDepth BreakpointResolverAddress::GetDepth() {
return lldb::eSearchDepthTarget;
}
void BreakpointResolverAddress::GetDescription(Stream *s) {

View File

@ -257,8 +257,8 @@ BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
return Searcher::eCallbackReturnContinue;
}
Searcher::Depth BreakpointResolverFileLine::GetDepth() {
return Searcher::eDepthModule;
lldb::SearchDepth BreakpointResolverFileLine::GetDepth() {
return lldb::eSearchDepthModule;
}
void BreakpointResolverFileLine::GetDescription(Stream *s) {

View File

@ -157,8 +157,8 @@ BreakpointResolverFileRegex::SearchCallback(SearchFilter &filter,
return Searcher::eCallbackReturnContinue;
}
Searcher::Depth BreakpointResolverFileRegex::GetDepth() {
return Searcher::eDepthCompUnit;
lldb::SearchDepth BreakpointResolverFileRegex::GetDepth() {
return lldb::eSearchDepthCompUnit;
}
void BreakpointResolverFileRegex::GetDescription(Stream *s) {

View File

@ -396,8 +396,8 @@ BreakpointResolverName::SearchCallback(SearchFilter &filter,
return Searcher::eCallbackReturnContinue;
}
Searcher::Depth BreakpointResolverName::GetDepth() {
return Searcher::eDepthModule;
lldb::SearchDepth BreakpointResolverName::GetDepth() {
return lldb::eSearchDepthModule;
}
void BreakpointResolverName::GetDescription(Stream *s) {

View File

@ -366,8 +366,8 @@ CommandCompletions::SourceFileCompleter::SourceFileCompleter(
m_dir_name = partial_spec.GetDirectory().GetCString();
}
Searcher::Depth CommandCompletions::SourceFileCompleter::GetDepth() {
return eDepthCompUnit;
lldb::SearchDepth CommandCompletions::SourceFileCompleter::GetDepth() {
return lldb::eSearchDepthCompUnit;
}
Searcher::CallbackReturn
@ -458,8 +458,8 @@ CommandCompletions::SymbolCompleter::SymbolCompleter(
m_regex.Compile(regex_str);
}
Searcher::Depth CommandCompletions::SymbolCompleter::GetDepth() {
return eDepthModule;
lldb::SearchDepth CommandCompletions::SymbolCompleter::GetDepth() {
return lldb::eSearchDepthModule;
}
Searcher::CallbackReturn CommandCompletions::SymbolCompleter::SearchCallback(
@ -506,8 +506,8 @@ CommandCompletions::ModuleCompleter::ModuleCompleter(
m_dir_name = partial_spec.GetDirectory().GetCString();
}
Searcher::Depth CommandCompletions::ModuleCompleter::GetDepth() {
return eDepthModule;
lldb::SearchDepth CommandCompletions::ModuleCompleter::GetDepth() {
return lldb::eSearchDepthModule;
}
Searcher::CallbackReturn CommandCompletions::ModuleCompleter::SearchCallback(

View File

@ -78,8 +78,8 @@ AddressResolverFileLine::SearchCallback(SearchFilter &filter,
return Searcher::eCallbackReturnContinue;
}
Searcher::Depth AddressResolverFileLine::GetDepth() {
return Searcher::eDepthCompUnit;
lldb::SearchDepth AddressResolverFileLine::GetDepth() {
return lldb::eSearchDepthCompUnit;
}
void AddressResolverFileLine::GetDescription(Stream *s) {

View File

@ -186,8 +186,8 @@ AddressResolverName::SearchCallback(SearchFilter &filter,
return Searcher::eCallbackReturnContinue;
}
Searcher::Depth AddressResolverName::GetDepth() {
return Searcher::eDepthModule;
lldb::SearchDepth AddressResolverName::GetDepth() {
return lldb::eSearchDepthModule;
}
void AddressResolverName::GetDescription(Stream *s) {

View File

@ -68,8 +68,8 @@ FileLineResolver::SearchCallback(SearchFilter &filter, SymbolContext &context,
return Searcher::eCallbackReturnContinue;
}
Searcher::Depth FileLineResolver::GetDepth() {
return Searcher::eDepthCompUnit;
lldb::SearchDepth FileLineResolver::GetDepth() {
return lldb::eSearchDepthCompUnit;
}
void FileLineResolver::GetDescription(Stream *s) {

View File

@ -207,7 +207,7 @@ void SearchFilter::Search(Searcher &searcher) {
return;
empty_sc.target_sp = m_target_sp;
if (searcher.GetDepth() == Searcher::eDepthTarget)
if (searcher.GetDepth() == lldb::eSearchDepthTarget)
searcher.SearchCallback(*this, empty_sc, nullptr, false);
else
DoModuleIteration(empty_sc, searcher);
@ -220,7 +220,7 @@ void SearchFilter::SearchInModuleList(Searcher &searcher, ModuleList &modules) {
return;
empty_sc.target_sp = m_target_sp;
if (searcher.GetDepth() == Searcher::eDepthTarget)
if (searcher.GetDepth() == lldb::eSearchDepthTarget)
searcher.SearchCallback(*this, empty_sc, nullptr, false);
else {
std::lock_guard<std::recursive_mutex> guard(modules.GetMutex());
@ -247,9 +247,9 @@ SearchFilter::DoModuleIteration(const lldb::ModuleSP &module_sp,
Searcher::CallbackReturn
SearchFilter::DoModuleIteration(const SymbolContext &context,
Searcher &searcher) {
if (searcher.GetDepth() >= Searcher::eDepthModule) {
if (searcher.GetDepth() >= lldb::eSearchDepthModule) {
if (context.module_sp) {
if (searcher.GetDepth() == Searcher::eDepthModule) {
if (searcher.GetDepth() == lldb::eSearchDepthModule) {
SymbolContext matchingContext(context.module_sp.get());
searcher.SearchCallback(*this, matchingContext, nullptr, false);
} else {
@ -267,7 +267,7 @@ SearchFilter::DoModuleIteration(const SymbolContext &context,
if (!ModulePasses(module_sp))
continue;
if (searcher.GetDepth() == Searcher::eDepthModule) {
if (searcher.GetDepth() == lldb::eSearchDepthModule) {
SymbolContext matchingContext(m_target_sp, module_sp);
Searcher::CallbackReturn shouldContinue =
@ -301,7 +301,7 @@ SearchFilter::DoCUIteration(const ModuleSP &module_sp,
if (!CompUnitPasses(*(cu_sp.get())))
continue;
if (searcher.GetDepth() == Searcher::eDepthCompUnit) {
if (searcher.GetDepth() == lldb::eSearchDepthCompUnit) {
SymbolContext matchingContext(m_target_sp, module_sp, cu_sp.get());
shouldContinue =
@ -421,7 +421,7 @@ void SearchFilterByModule::Search(Searcher &searcher) {
if (!m_target_sp)
return;
if (searcher.GetDepth() == Searcher::eDepthTarget) {
if (searcher.GetDepth() == lldb::eSearchDepthTarget) {
SymbolContext empty_sc;
empty_sc.target_sp = m_target_sp;
searcher.SearchCallback(*this, empty_sc, nullptr, false);
@ -570,7 +570,7 @@ void SearchFilterByModuleList::Search(Searcher &searcher) {
if (!m_target_sp)
return;
if (searcher.GetDepth() == Searcher::eDepthTarget) {
if (searcher.GetDepth() == lldb::eSearchDepthTarget) {
SymbolContext empty_sc;
empty_sc.target_sp = m_target_sp;
searcher.SearchCallback(*this, empty_sc, nullptr, false);
@ -773,7 +773,7 @@ void SearchFilterByModuleListAndCU::Search(Searcher &searcher) {
if (!m_target_sp)
return;
if (searcher.GetDepth() == Searcher::eDepthTarget) {
if (searcher.GetDepth() == lldb::eSearchDepthTarget) {
SymbolContext empty_sc;
empty_sc.target_sp = m_target_sp;
searcher.SearchCallback(*this, empty_sc, nullptr, false);
@ -797,7 +797,7 @@ void SearchFilterByModuleListAndCU::Search(Searcher &searcher) {
SymbolContext matchingContext(m_target_sp, module_sp);
Searcher::CallbackReturn shouldContinue;
if (searcher.GetDepth() == Searcher::eDepthModule) {
if (searcher.GetDepth() == lldb::eSearchDepthModule) {
shouldContinue = DoModuleIteration(matchingContext, searcher);
if (shouldContinue == Searcher::eCallbackReturnStop)
return;

View File

@ -74,7 +74,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override { return Searcher::eDepthModule; }
lldb::SearchDepth GetDepth() override { return lldb::eSearchDepthModule; }
lldb::BreakpointResolverSP
CopyForBreakpoint(Breakpoint &breakpoint) override {
@ -124,7 +124,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override { return Searcher::eDepthModule; }
lldb::SearchDepth GetDepth() override { return lldb::eSearchDepthModule; }
lldb::BreakpointResolverSP
CopyForBreakpoint(Breakpoint &breakpoint) override {
@ -269,7 +269,7 @@ public:
SymbolContext &context, Address *addr,
bool containing) override;
Searcher::Depth GetDepth() override { return Searcher::eDepthModule; }
lldb::SearchDepth GetDepth() override { return lldb::eSearchDepthModule; }
lldb::BreakpointResolverSP
CopyForBreakpoint(Breakpoint &breakpoint) override {

View File

@ -125,11 +125,11 @@ public:
return eCallbackReturnStop;
}
Searcher::Depth GetDepth() override {
lldb::SearchDepth GetDepth() override {
if (SetActualResolver())
return m_actual_resolver_sp->GetDepth();
else
return eDepthTarget;
return lldb::eSearchDepthTarget;
}
void GetDescription(Stream *s) override {