summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-04-23 22:00:21 +0000
committerGreg Clayton <gclayton@apple.com>2012-04-23 22:00:21 +0000
commit2dafd8ed4bc3a55e14c32794143f76c5f63218a0 (patch)
tree0aacc9bb2f56f4c99eab2ba25f18571d280a418a /lldb/source
parent3f8acfc3c40e8dad68a3deb13a9fbb31f1b82b99 (diff)
downloadbcm5719-llvm-2dafd8ed4bc3a55e14c32794143f76c5f63218a0.tar.gz
bcm5719-llvm-2dafd8ed4bc3a55e14c32794143f76c5f63218a0.zip
<rdar://problem/11282938>
Fixed an issue where we get NULL compile units back from the symbol vendor. We need symbol vendors to be able to quickly give an estimate of the compile units that they have without having to fully vette them first, so anyone getting compile units from a module should be able to deal with a NULL compile unit being returned for a given index. llvm-svn: 155398
Diffstat (limited to 'lldb/source')
-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