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.

llvm-svn: 191477
This commit is contained in:
Jim Ingham 2013-09-27 01:15:46 +00:00
parent e4483cf959
commit 2b89a53181
3 changed files with 23 additions and 3 deletions

View 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

View 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

View 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)
{