[Lldb-commits] [lldb] r298289 - Fix a problem with line tables & .o files that start with code with no line table entries.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 20 12:19:03 PDT 2017


Author: jingham
Date: Mon Mar 20 14:19:03 2017
New Revision: 298289

URL: http://llvm.org/viewvc/llvm-project?rev=298289&view=rev
Log:
Fix a problem with line tables & .o files that start with code with no line table entries.

If you have code before the first line table entry when debugging with .o files on macOS, the 
LineTable entry search code was assigning all that code to the first line table entry. Don't do that.

<rdar://problem/31095765>

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

Modified: lldb/trunk/source/Symbol/LineTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineTable.cpp?rev=298289&r1=298288&r2=298289&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/LineTable.cpp (original)
+++ lldb/trunk/source/Symbol/LineTable.cpp Mon Mar 20 14:19:03 2017
@@ -230,6 +230,14 @@ bool LineTable::FindLineEntryByAddress(c
             }
           }
         }
+        else
+        {
+          // There might be code in the containing objfile before the first line
+          // table entry.  Make sure that does not get considered part of the first
+          // line table entry.
+          if (pos->file_addr > so_addr.GetFileAddress())
+            return false;
+        }
 
         // Make sure we have a valid match and that the match isn't a
         // terminating




More information about the lldb-commits mailing list