[Lldb-commits] [lldb] r141338 - /lldb/trunk/source/Symbol/SymbolContext.cpp

Greg Clayton gclayton at apple.com
Thu Oct 6 16:32:32 PDT 2011


Author: gclayton
Date: Thu Oct  6 18:32:32 2011
New Revision: 141338

URL: http://llvm.org/viewvc/llvm-project?rev=141338&view=rev
Log:
<rdar://problem/10226227>

Fixed an assertion that was causing a crash. The bug describes a case where we have an inlined block that doesn't contain the frame PC that was used to lookup the symbol context in the first place. This really shouldn't happen, so
now we log if we run into this and don't assert.


Modified:
    lldb/trunk/source/Symbol/SymbolContext.cpp

Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=141338&r1=141337&r2=141338&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Thu Oct  6 18:32:32 2011
@@ -541,17 +541,35 @@
             // the line table.  So just use the call site info from our inlined block.
             
             AddressRange range;
-            bool got_range = curr_inlined_block->GetRangeContainingAddress (curr_frame_pc, range);
-            assert (got_range);
-            // To see there this new frame block it, we need to look at the
-            // call site information from 
-            const InlineFunctionInfo* curr_inlined_block_inlined_info = curr_inlined_block->GetInlinedFunctionInfo();
-            next_frame_pc = range.GetBaseAddress();
-            next_frame_sc.line_entry.range.GetBaseAddress() = next_frame_pc;
-            next_frame_sc.line_entry.file = curr_inlined_block_inlined_info->GetCallSite().GetFile();
-            next_frame_sc.line_entry.line = curr_inlined_block_inlined_info->GetCallSite().GetLine();
-            next_frame_sc.line_entry.column = curr_inlined_block_inlined_info->GetCallSite().GetColumn();
-            return true;
+            if (curr_inlined_block->GetRangeContainingAddress (curr_frame_pc, range))
+            {
+                // To see there this new frame block it, we need to look at the
+                // call site information from 
+                const InlineFunctionInfo* curr_inlined_block_inlined_info = curr_inlined_block->GetInlinedFunctionInfo();
+                next_frame_pc = range.GetBaseAddress();
+                next_frame_sc.line_entry.range.GetBaseAddress() = next_frame_pc;
+                next_frame_sc.line_entry.file = curr_inlined_block_inlined_info->GetCallSite().GetFile();
+                next_frame_sc.line_entry.line = curr_inlined_block_inlined_info->GetCallSite().GetLine();
+                next_frame_sc.line_entry.column = curr_inlined_block_inlined_info->GetCallSite().GetColumn();
+                return true;
+            }
+            else
+            {
+                LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SYMBOLS));
+
+                if (log)
+                {
+                    log->Printf ("warning: inlined block 0x%8.8x doesn't have a range that contains file address 0x%llx", 
+                                 curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress());
+                }
+#ifdef LLDB_CONFIGURATION_DEBUG
+                else
+                {
+                    fprintf (stderr, "warning: inlined block 0x%8.8x doesn't have a range that contains file address 0x%llx\n", 
+                             curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress());
+                }
+#endif
+            }
         }
     }
     





More information about the lldb-commits mailing list