DWARF says line number 0 is a valid line number - used to indicate a source line...
authorJim Ingham <jingham@apple.com>
Fri, 27 Sep 2013 01:15:46 +0000 (01:15 +0000)
committerJim Ingham <jingham@apple.com>
Fri, 27 Sep 2013 01:15:46 +0000 (01:15 +0000)
not have breakpoints set on it inserted into code that does have a valid line number.  So allow
that line number, and the ThreadPlanStepRange should just continue stepping over 0 line ranges
as if they had the same line number as whatever we were previously stepping through.

llvm-svn: 191477

lldb/include/lldb/lldb-defines.h
lldb/source/Symbol/LineEntry.cpp
lldb/source/Target/ThreadPlanStepRange.cpp

index ab44391..bca905e 100644 (file)
@@ -82,6 +82,7 @@
 #define LLDB_INVALID_FRAME_ID           UINT32_MAX
 #define LLDB_INVALID_SIGNAL_NUMBER      INT32_MAX
 #define LLDB_INVALID_OFFSET             UINT64_MAX // Must match max of lldb::offset_t
+#define LLDB_INVALID_LINE_NUMBER        UINT32_MAX
 
 //----------------------------------------------------------------------
 /// CPU Type defintions
index 10dc552..08a2392 100644 (file)
@@ -17,7 +17,7 @@ using namespace lldb_private;
 LineEntry::LineEntry() :
     range(),
     file(),
-    line(0),
+    line(LLDB_INVALID_LINE_NUMBER),
     column(0),
     is_start_of_statement(0),
     is_start_of_basic_block(0),
@@ -58,7 +58,7 @@ LineEntry::Clear()
 {
     range.Clear();
     file.Clear();
-    line = 0;
+    line = LLDB_INVALID_LINE_NUMBER;
     column = 0;
     is_start_of_statement = 0;
     is_start_of_basic_block = 0;
@@ -71,7 +71,7 @@ LineEntry::Clear()
 bool
 LineEntry::IsValid() const
 {
-    return range.GetBaseAddress().IsValid() && line != 0;
+    return range.GetBaseAddress().IsValid() && line != LLDB_INVALID_LINE_NUMBER;
 }
 
 bool
index a74f29a..510a627 100644 (file)
@@ -173,6 +173,25 @@ ThreadPlanStepRange::InRange ()
                         log->Printf ("Step range plan stepped to another range of same line: %s", s.GetData());
                     }
                 }
+                else if (new_context.line_entry.line == 0)
+                {
+                    new_context.line_entry.line = m_addr_context.line_entry.line;
+                    m_addr_context = new_context;
+                    AddRange(m_addr_context.line_entry.range);
+                    ret_value = true;
+                    if (log)
+                    {
+                        StreamString s;
+                        m_addr_context.line_entry.Dump (&s,
+                                                        m_thread.CalculateTarget().get(),
+                                                        true,
+                                                        Address::DumpStyleLoadAddress,
+                                                        Address::DumpStyleLoadAddress,
+                                                        true);
+
+                        log->Printf ("Step range plan stepped to a range at linenumber 0 stepping through that range: %s", s.GetData());
+                    }
+                }
                 else if (new_context.line_entry.range.GetBaseAddress().GetLoadAddress(m_thread.CalculateTarget().get())
                          != pc_load_addr)
                 {