[Lldb-commits] [lldb] r155398 - in /lldb/trunk/source: Breakpoint/BreakpointResolverFileLine.cpp Core/Module.cpp Core/SearchFilter.cpp

Greg Clayton gclayton at apple.com
Mon Apr 23 15:00:21 PDT 2012


Author: gclayton
Date: Mon Apr 23 17:00:21 2012
New Revision: 155398

URL: http://llvm.org/viewvc/llvm-project?rev=155398&view=rev
Log:
<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.


Modified:
    lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
    lldb/trunk/source/Core/Module.cpp
    lldb/trunk/source/Core/SearchFilter.cpp

Modified: lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=155398&r1=155397&r2=155398&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp Mon Apr 23 17:00:21 2012
@@ -72,8 +72,11 @@
     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)

Modified: lldb/trunk/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=155398&r1=155397&r2=155398&view=diff
==============================================================================
--- lldb/trunk/source/Core/Module.cpp (original)
+++ lldb/trunk/source/Core/Module.cpp Mon Apr 23 17:00:21 2012
@@ -535,8 +535,11 @@
     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;
 }

Modified: lldb/trunk/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/SearchFilter.cpp?rev=155398&r1=155397&r2=155398&view=diff
==============================================================================
--- lldb/trunk/source/Core/SearchFilter.cpp (original)
+++ lldb/trunk/source/Core/SearchFilter.cpp Mon Apr 23 17:00:21 2012
@@ -247,25 +247,27 @@
         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 @@
                 {
                     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;
+                        }
                     }
                 }
             }





More information about the lldb-commits mailing list