[Lldb-commits] [lldb] r191477 - DWARF says line number 0 is a valid line number - used to indicate a source line that should
Jim Ingham
jingham at apple.com
Thu Sep 26 18:15:46 PDT 2013
Author: jingham
Date: Thu Sep 26 20:15:46 2013
New Revision: 191477
URL: http://llvm.org/viewvc/llvm-project?rev=191477&view=rev
Log:
DWARF says line number 0 is a valid line number - used to indicate a source line that should
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.
Modified:
lldb/trunk/include/lldb/lldb-defines.h
lldb/trunk/source/Symbol/LineEntry.cpp
lldb/trunk/source/Target/ThreadPlanStepRange.cpp
Modified: lldb/trunk/include/lldb/lldb-defines.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-defines.h?rev=191477&r1=191476&r2=191477&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-defines.h (original)
+++ lldb/trunk/include/lldb/lldb-defines.h Thu Sep 26 20:15:46 2013
@@ -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
Modified: lldb/trunk/source/Symbol/LineEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineEntry.cpp?rev=191477&r1=191476&r2=191477&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/LineEntry.cpp (original)
+++ lldb/trunk/source/Symbol/LineEntry.cpp Thu Sep 26 20:15:46 2013
@@ -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
Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=191477&r1=191476&r2=191477&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Thu Sep 26 20:15:46 2013
@@ -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)
{
More information about the lldb-commits
mailing list