summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectThread.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-02-13 00:31:47 +0000
committerJim Ingham <jingham@apple.com>2016-02-13 00:31:47 +0000
commitcbf6f9b2436d8f743b00131bd7c3333e7f8e813e (patch)
tree293c6a29ae35c30a9b7132ce224b465b3059b450 /lldb/source/Commands/CommandObjectThread.cpp
parent1debba54a71804331f995f4d7dae2a7d77dd9b26 (diff)
downloadbcm5719-llvm-cbf6f9b2436d8f743b00131bd7c3333e7f8e813e.tar.gz
bcm5719-llvm-cbf6f9b2436d8f743b00131bd7c3333e7f8e813e.zip
Adding an SBThread::StepInto that takes an end-line, also moved the code that figures
out the address range for the step to SymbolContext. llvm-svn: 260772
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp75
1 files changed, 15 insertions, 60 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 123ebbb1546..4ff59d3bf96 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -606,75 +606,30 @@ protected:
if (frame->HasDebugInformation ())
{
- AddressRange range = frame->GetSymbolContext(eSymbolContextEverything).line_entry.range;
+ AddressRange range;
+ SymbolContext sc = frame->GetSymbolContext(eSymbolContextEverything);
if (m_options.m_end_line != LLDB_INVALID_LINE_NUMBER)
{
- SymbolContext sc = frame->GetSymbolContext(eSymbolContextEverything);
- if (sc.line_entry.line > m_options.m_end_line)
+ Error error;
+ if (!sc.GetAddressRangeFromHereToEndLine(m_options.m_end_line, range, error))
{
- result.AppendErrorWithFormat("end line option %d must be after the current line: %d",
- m_options.m_end_line,
- sc.line_entry.line);
+ result.AppendErrorWithFormat("invalid end-line option: %s.", error.AsCString());
result.SetStatus(eReturnStatusFailed);
return false;
}
-
- CompileUnit *cu = sc.comp_unit;
- uint32_t line_index = 0;
- bool found = false;
- while (1)
- {
- LineEntry this_line;
- line_index = cu->FindLineEntry(line_index, sc.line_entry.line, nullptr, false, &this_line);
- if (line_index == UINT32_MAX)
- break;
- if (LineEntry::Compare(this_line, sc.line_entry) == 0)
- {
- found = true;
- break;
- }
- }
- LineEntry end_entry;
- if (!found)
- {
- // Can't find the index of the SymbolContext's line entry in the SymbolContext's CompUnit.
- result.AppendErrorWithFormat("Can't find the current line entry in the CompUnit - can't process "
- "the end-line option");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- line_index = cu->FindLineEntry(line_index, m_options.m_end_line, nullptr, false, &end_entry);
- if (line_index == UINT32_MAX)
- {
- result.AppendErrorWithFormat("could not find a line table entry corresponding "
- "to end line number %d",
- m_options.m_end_line);
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- Block *func_block = sc.GetFunctionBlock();
- if (func_block && func_block->GetRangeIndexContainingAddress(end_entry.range.GetBaseAddress()) == UINT32_MAX)
- {
- result.AppendErrorWithFormat("end line number %d is not contained within the current function.",
- m_options.m_end_line);
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- lldb::addr_t range_size = end_entry.range.GetBaseAddress().GetFileAddress()
- - range.GetBaseAddress().GetFileAddress();
- range.SetByteSize(range_size);
+ }
+ else
+ {
+ range = sc.line_entry.range;
}
new_plan_sp = thread->QueueThreadPlanForStepInRange (abort_other_plans,
- range,
- frame->GetSymbolContext(eSymbolContextEverything),
- m_options.m_step_in_target.c_str(),
- stop_other_threads,
- m_options.m_step_in_avoid_no_debug,
- m_options.m_step_out_avoid_no_debug);
+ range,
+ frame->GetSymbolContext(eSymbolContextEverything),
+ m_options.m_step_in_target.c_str(),
+ stop_other_threads,
+ m_options.m_step_in_avoid_no_debug,
+ m_options.m_step_out_avoid_no_debug);
if (new_plan_sp && !m_options.m_avoid_regexp.empty())
{
OpenPOWER on IntegriCloud