aboutsummaryrefslogtreecommitdiff
path: root/source/Symbol/LineTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Symbol/LineTable.cpp')
-rw-r--r--source/Symbol/LineTable.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/Symbol/LineTable.cpp b/source/Symbol/LineTable.cpp
index 02ab0c126117..3cb305302927 100644
--- a/source/Symbol/LineTable.cpp
+++ b/source/Symbol/LineTable.cpp
@@ -11,8 +11,8 @@
#include "lldb/Core/Address.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
-#include "lldb/Core/Stream.h"
#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Utility/Stream.h"
#include <algorithm>
using namespace lldb;
@@ -230,6 +230,14 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
}
}
}
+ 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
@@ -501,6 +509,7 @@ LineTable *LineTable::LinkLineTable(const FileRangeMap &file_range_map) {
if (terminate_previous_entry && !sequence.m_entries.empty()) {
assert(prev_file_addr != LLDB_INVALID_ADDRESS);
+ UNUSED_IF_ASSERT_DISABLED(prev_file_addr);
sequence.m_entries.push_back(sequence.m_entries.back());
if (prev_end_entry_linked_file_addr == LLDB_INVALID_ADDRESS)
prev_end_entry_linked_file_addr =