summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverFileLine.cpp7
-rw-r--r--lldb/source/Core/Module.cpp7
-rw-r--r--lldb/source/Core/SearchFilter.cpp43
3 files changed, 34 insertions, 23 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
index 69f2cca3877..ca24377077d 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -72,8 +72,11 @@ BreakpointResolverFileLine::SearchCallback
for (uint32_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (context.module_sp->GetCompileUnitAtIndex (i));
- if (filter.CompUnitPasses(*(cu_sp.get())))
- cu_sp->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, false, eSymbolContextEverything, sc_list);
+ if (cu_sp)
+ {
+ if (filter.CompUnitPasses(*cu_sp))
+ cu_sp->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, false, eSymbolContextEverything, sc_list);
+ }
}
while (sc_list.GetSize() > 0)
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 30e9e17ec04..d2606576aa0 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -535,8 +535,11 @@ Module::FindCompileUnits (const FileSpec &path,
for (uint32_t i=0; i<num_compile_units; ++i)
{
sc.comp_unit = GetCompileUnitAtIndex(i).get();
- if (FileSpec::Equal (*sc.comp_unit, path, compare_directory))
- sc_list.Append(sc);
+ if (sc.comp_unit)
+ {
+ if (FileSpec::Equal (*sc.comp_unit, path, compare_directory))
+ sc_list.Append(sc);
+ }
}
return sc_list.GetSize() - start_size;
}
diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp
index 342e988c147..8601835e7c4 100644
--- a/lldb/source/Core/SearchFilter.cpp
+++ b/lldb/source/Core/SearchFilter.cpp
@@ -247,25 +247,27 @@ SearchFilter::DoCUIteration (const ModuleSP &module_sp, const SymbolContext &con
for (uint32_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (module_sp->GetCompileUnitAtIndex (i));
- if (!CompUnitPasses (*(cu_sp.get())))
- continue;
-
- if (searcher.GetDepth () == Searcher::eDepthCompUnit)
+ if (cu_sp)
{
- SymbolContext matchingContext(m_target_sp, module_sp, cu_sp.get());
+ if (!CompUnitPasses (*(cu_sp.get())))
+ continue;
- shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
+ if (searcher.GetDepth () == Searcher::eDepthCompUnit)
+ {
+ SymbolContext matchingContext(m_target_sp, module_sp, cu_sp.get());
- if (shouldContinue == Searcher::eCallbackReturnPop)
- return Searcher::eCallbackReturnContinue;
- else if (shouldContinue == Searcher::eCallbackReturnStop)
- return shouldContinue;
- }
- else
- {
- // FIXME Descend to block.
- }
+ shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
+ if (shouldContinue == Searcher::eCallbackReturnPop)
+ return Searcher::eCallbackReturnContinue;
+ else if (shouldContinue == Searcher::eCallbackReturnStop)
+ return shouldContinue;
+ }
+ else
+ {
+ // FIXME Descend to block.
+ }
+ }
}
}
else
@@ -781,11 +783,14 @@ SearchFilterByModuleListAndCU::Search (Searcher &searcher)
{
CompUnitSP cu_sp = module_sp->GetCompileUnitAtIndex(cu_idx);
matchingContext.comp_unit = cu_sp.get();
- if (m_cu_spec_list.FindFileIndex(0, static_cast<FileSpec>(matchingContext.comp_unit), false) != UINT32_MAX)
+ if (matchingContext.comp_unit)
{
- shouldContinue = DoCUIteration(module_sp, matchingContext, searcher);
- if (shouldContinue == Searcher::eCallbackReturnStop)
- return;
+ if (m_cu_spec_list.FindFileIndex(0, *matchingContext.comp_unit, false) != UINT32_MAX)
+ {
+ shouldContinue = DoCUIteration(module_sp, matchingContext, searcher);
+ if (shouldContinue == Searcher::eCallbackReturnStop)
+ return;
+ }
}
}
}
OpenPOWER on IntegriCloud