[Lldb-commits] [lldb] r131470 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp

Greg Clayton gclayton at apple.com
Tue May 17 10:37:43 PDT 2011


Author: gclayton
Date: Tue May 17 12:37:43 2011
New Revision: 131470

URL: http://llvm.org/viewvc/llvm-project?rev=131470&view=rev
Log:
Removed some assertions that could crash the controlling program
and turned them into warnings to stderr.


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=131470&r1=131469&r2=131470&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Tue May 17 12:37:43 2011
@@ -400,7 +400,7 @@
 bool
 DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t* offset_ptr, Prologue* prologue)
 {
-//  const uint32_t prologue_offset = *offset_ptr;
+    const uint32_t prologue_offset = *offset_ptr;
 
     //DEBUG_PRINTF("0x%8.8x: ParsePrologue()\n", *offset_ptr);
 
@@ -453,7 +453,11 @@
             break;
     }
 
-    assert(*offset_ptr == end_prologue_offset);
+    if (*offset_ptr != end_prologue_offset)
+    {
+        fprintf (stderr, "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8x\n", 
+                 prologue_offset, end_prologue_offset, *offset_ptr);
+    }
     return end_prologue_offset;
 }
 
@@ -532,7 +536,11 @@
         }
     }
 
-    assert(offset == end_prologue_offset);
+    if (offset != end_prologue_offset)
+    {
+        fprintf (stderr, "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8x\n", 
+                 stmt_list, end_prologue_offset, offset);
+    }
     return end_prologue_offset;
 }
 
@@ -576,8 +584,6 @@
 
     const dw_offset_t end_offset = debug_line_offset + prologue->total_length + sizeof(prologue->total_length);
 
-    assert(debug_line_data.ValidOffset(end_offset-1));
-
     State state(prologue, log, callback, userData);
 
     while (*offset_ptr < end_offset)





More information about the lldb-commits mailing list