summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/Thread.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Target/Thread.cpp323
1 files changed, 168 insertions, 155 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/Thread.cpp b/contrib/llvm/tools/lldb/source/Target/Thread.cpp
index 29ba86a..9f9da97 100644
--- a/contrib/llvm/tools/lldb/source/Target/Thread.cpp
+++ b/contrib/llvm/tools/lldb/source/Target/Thread.cpp
@@ -7,14 +7,20 @@
//
//===----------------------------------------------------------------------===//
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/FormatEntity.h"
+#include "lldb/Core/Module.h"
#include "lldb/Core/State.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Core/RegularExpression.h"
+#include "lldb/Core/ValueObject.h"
#include "lldb/Host/Host.h"
#include "lldb/Interpreter/OptionValueFileSpecList.h"
#include "lldb/Interpreter/OptionValueProperties.h"
@@ -23,7 +29,6 @@
#include "lldb/Target/ABI.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/ExecutionContext.h"
-#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StopInfo.h"
@@ -47,11 +52,9 @@
#include "Plugins/Process/Utility/UnwindLLDB.h"
#include "Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h"
-
using namespace lldb;
using namespace lldb_private;
-
const ThreadPropertiesSP &
Thread::GetGlobalProperties()
{
@@ -64,13 +67,13 @@ Thread::GetGlobalProperties()
static PropertyDefinition
g_properties[] =
{
- { "step-in-avoid-nodebug", OptionValue::eTypeBoolean, true, true, NULL, NULL, "If true, step-in will not stop in functions with no debug information." },
- { "step-out-avoid-nodebug", OptionValue::eTypeBoolean, true, false, NULL, NULL, "If true, when step-in/step-out/step-over leave the current frame, they will continue to step out till they come to a function with "
+ { "step-in-avoid-nodebug", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "If true, step-in will not stop in functions with no debug information." },
+ { "step-out-avoid-nodebug", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "If true, when step-in/step-out/step-over leave the current frame, they will continue to step out till they come to a function with "
"debug information. Passing a frame argument to step-out will override this option." },
- { "step-avoid-regexp", OptionValue::eTypeRegex , true , 0, "^std::", NULL, "A regular expression defining functions step-in won't stop in." },
- { "step-avoid-libraries", OptionValue::eTypeFileSpecList , true , 0, NULL, NULL, "A list of libraries that source stepping won't stop in." },
- { "trace-thread", OptionValue::eTypeBoolean, false, false, NULL, NULL, "If true, this thread will single-step and log execution." },
- { NULL , OptionValue::eTypeInvalid, false, 0 , NULL, NULL, NULL }
+ { "step-avoid-regexp", OptionValue::eTypeRegex , true , 0, "^std::", nullptr, "A regular expression defining functions step-in won't stop in." },
+ { "step-avoid-libraries", OptionValue::eTypeFileSpecList , true , 0, nullptr, nullptr, "A list of libraries that source stepping won't stop in." },
+ { "trace-thread", OptionValue::eTypeBoolean, false, false, nullptr, nullptr, "If true, this thread will single-step and log execution." },
+ { nullptr , OptionValue::eTypeInvalid, false, 0 , nullptr, nullptr, nullptr }
};
enum {
@@ -81,7 +84,6 @@ enum {
ePropertyEnableThreadTrace
};
-
class ThreadOptionValueProperties : public OptionValueProperties
{
public:
@@ -98,8 +100,8 @@ public:
{
}
- virtual const Property *
- GetPropertyAtIndex (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+ const Property *
+ GetPropertyAtIndex(const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const override
{
// When getting the value for a key from the thread options, we will always
// try and grab the setting from the current thread if there is one. Else we just
@@ -118,8 +120,6 @@ public:
}
};
-
-
ThreadProperties::ThreadProperties (bool is_global) :
Properties ()
{
@@ -132,22 +132,20 @@ ThreadProperties::ThreadProperties (bool is_global) :
m_collection_sp.reset (new ThreadOptionValueProperties(Thread::GetGlobalProperties().get()));
}
-ThreadProperties::~ThreadProperties()
-{
-}
+ThreadProperties::~ThreadProperties() = default;
const RegularExpression *
ThreadProperties::GetSymbolsToAvoidRegexp()
{
const uint32_t idx = ePropertyStepAvoidRegex;
- return m_collection_sp->GetPropertyAtIndexAsOptionValueRegex (NULL, idx);
+ return m_collection_sp->GetPropertyAtIndexAsOptionValueRegex(nullptr, idx);
}
FileSpecList &
ThreadProperties::GetLibrariesToAvoid() const
{
const uint32_t idx = ePropertyStepAvoidLibraries;
- OptionValueFileSpecList *option_value = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList (NULL, false, idx);
+ OptionValueFileSpecList *option_value = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr, false, idx);
assert(option_value);
return option_value->GetCurrentValue();
}
@@ -156,29 +154,27 @@ bool
ThreadProperties::GetTraceEnabledState() const
{
const uint32_t idx = ePropertyEnableThreadTrace;
- return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, g_properties[idx].default_uint_value != 0);
}
bool
ThreadProperties::GetStepInAvoidsNoDebug() const
{
const uint32_t idx = ePropertyStepInAvoidsNoDebug;
- return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, g_properties[idx].default_uint_value != 0);
}
bool
ThreadProperties::GetStepOutAvoidsNoDebug() const
{
const uint32_t idx = ePropertyStepOutAvoidsNoDebug;
- return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx, g_properties[idx].default_uint_value != 0);
}
-
//------------------------------------------------------------------
// Thread Event Data
//------------------------------------------------------------------
-
const ConstString &
Thread::ThreadEventData::GetFlavorString ()
{
@@ -204,14 +200,11 @@ Thread::ThreadEventData::ThreadEventData () :
{
}
-Thread::ThreadEventData::~ThreadEventData ()
-{
-}
+Thread::ThreadEventData::~ThreadEventData() = default;
void
Thread::ThreadEventData::Dump (Stream *s) const
{
-
}
const Thread::ThreadEventData *
@@ -223,7 +216,7 @@ Thread::ThreadEventData::GetEventDataFromEvent (const Event *event_ptr)
if (event_data && event_data->GetFlavor() == ThreadEventData::GetFlavorString())
return static_cast <const ThreadEventData *> (event_ptr->GetData());
}
- return NULL;
+ return nullptr;
}
ThreadSP
@@ -308,7 +301,6 @@ Thread::Thread (Process &process, lldb::tid_t tid, bool use_invalid_index_id) :
QueueFundamentalPlan(true);
}
-
Thread::~Thread()
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
@@ -360,12 +352,22 @@ Thread::BroadcastSelectedFrameChange(StackID &new_frame_id)
BroadcastEvent(eBroadcastBitSelectedFrameChanged, new ThreadEventData (this->shared_from_this(), new_frame_id));
}
+lldb::StackFrameSP
+Thread::GetSelectedFrame()
+{
+ StackFrameListSP stack_frame_list_sp(GetStackFrameList());
+ StackFrameSP frame_sp = stack_frame_list_sp->GetFrameAtIndex (stack_frame_list_sp->GetSelectedFrameIndex());
+ FunctionOptimizationWarning (frame_sp.get());
+ return frame_sp;
+}
+
uint32_t
Thread::SetSelectedFrame (lldb_private::StackFrame *frame, bool broadcast)
{
uint32_t ret_value = GetStackFrameList()->SetSelectedFrame(frame);
if (broadcast)
BroadcastSelectedFrameChange(frame->GetStackID());
+ FunctionOptimizationWarning (frame);
return ret_value;
}
@@ -378,6 +380,7 @@ Thread::SetSelectedFrameByIndex (uint32_t frame_idx, bool broadcast)
GetStackFrameList()->SetSelectedFrame(frame_sp.get());
if (broadcast)
BroadcastSelectedFrameChange(frame_sp->GetStackID());
+ FunctionOptimizationWarning (frame_sp.get());
return true;
}
else
@@ -403,6 +406,7 @@ Thread::SetSelectedFrameByIndexNoisily (uint32_t frame_idx, Stream &output_strea
bool show_frame_info = true;
bool show_source = !already_shown;
+ FunctionOptimizationWarning (frame_sp.get());
return frame_sp->GetStatus (output_stream, show_frame_info, show_source);
}
return false;
@@ -411,6 +415,15 @@ Thread::SetSelectedFrameByIndexNoisily (uint32_t frame_idx, Stream &output_strea
return false;
}
+void
+Thread::FunctionOptimizationWarning (StackFrame *frame)
+{
+ if (frame && frame->HasDebugInformation() && GetProcess()->GetWarningsOptimization())
+ {
+ SymbolContext sc = frame->GetSymbolContext (eSymbolContextFunction | eSymbolContextModule);
+ GetProcess()->PrintWarningOptimization (sc);
+ }
+}
lldb::StopInfoSP
Thread::GetStopInfo ()
@@ -464,7 +477,7 @@ Thread::GetPrivateStopInfo ()
if (!m_stop_info_sp)
{
- if (CalculateStopInfo() == false)
+ if (!CalculateStopInfo())
SetStopInfo (StopInfoSP());
}
}
@@ -490,7 +503,6 @@ Thread::GetPrivateStopInfo ()
return m_stop_info_sp;
}
-
lldb::StopReason
Thread::GetStopReason()
{
@@ -500,7 +512,15 @@ Thread::GetStopReason()
return eStopReasonNone;
}
-
+bool
+Thread::StopInfoIsUpToDate() const
+{
+ ProcessSP process_sp (GetProcess());
+ if (process_sp)
+ return m_stop_info_stop_id == process_sp->GetStopID();
+ else
+ return true; // Process is no longer around so stop info is always up to date...
+}
void
Thread::SetStopInfo (const lldb::StopInfoSP &stop_info_sp)
@@ -650,7 +670,6 @@ Thread::SetupForResume ()
{
if (GetResumeState() != eStateSuspended)
{
-
// If we're at a breakpoint push the step-over breakpoint plan. Do this before
// telling the current plan it will resume, since we might change what the current
// plan is.
@@ -707,14 +726,17 @@ Thread::ShouldResume (StateType resume_state)
m_discarded_plan_stack.clear();
m_override_should_notify = eLazyBoolCalculate;
- m_temporary_resume_state = resume_state;
+ StateType prev_resume_state = GetTemporaryResumeState();
+
+ SetTemporaryResumeState(resume_state);
lldb::ThreadSP backing_thread_sp (GetBackingThread ());
if (backing_thread_sp)
- backing_thread_sp->m_temporary_resume_state = resume_state;
+ backing_thread_sp->SetTemporaryResumeState(resume_state);
- // Make sure m_stop_info_sp is valid
- GetPrivateStopInfo();
+ // Make sure m_stop_info_sp is valid. Don't do this for threads we suspended in the previous run.
+ if (prev_resume_state != eStateSuspended)
+ GetPrivateStopInfo();
// This is a little dubious, but we are trying to limit how often we actually fetch stop info from
// the target, 'cause that slows down single stepping. So assume that if we got to the point where
@@ -739,7 +761,7 @@ Thread::ShouldResume (StateType resume_state)
{
need_to_resume = plan_ptr->WillResume(resume_state, true);
- while ((plan_ptr = GetPreviousPlan(plan_ptr)) != NULL)
+ while ((plan_ptr = GetPreviousPlan(plan_ptr)) != nullptr)
{
plan_ptr->WillResume (resume_state, false);
}
@@ -804,7 +826,7 @@ Thread::ShouldStop (Event* event_ptr)
// thread caused the process to stop. NOTE: this must take place before
// the plan is moved from the current plan stack to the completed plan
// stack.
- if (ThreadStoppedForAReason() == false)
+ if (!ThreadStoppedForAReason())
{
if (log)
log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 " 0x%4.4" PRIx64 ", pc = 0x%16.16" PRIx64 ", should_stop = 0 (ignore since no stop reason)",
@@ -835,7 +857,7 @@ Thread::ShouldStop (Event* event_ptr)
// command on internal breakpoints. If a synchronous stop reason says we should not stop, then we don't have to
// do any more work on this stop.
StopInfoSP private_stop_info (GetPrivateStopInfo());
- if (private_stop_info && private_stop_info->ShouldStopSynchronous(event_ptr) == false)
+ if (private_stop_info && !private_stop_info->ShouldStopSynchronous(event_ptr))
{
if (log)
log->Printf ("StopInfo::ShouldStop async callback says we should not stop, returning ShouldStop of false.");
@@ -868,7 +890,7 @@ Thread::ShouldStop (Event* event_ptr)
// If the current plan doesn't explain the stop, then find one that
// does and let it handle the situation.
ThreadPlan *plan_ptr = current_plan;
- while ((plan_ptr = GetPreviousPlan(plan_ptr)) != NULL)
+ while ((plan_ptr = GetPreviousPlan(plan_ptr)) != nullptr)
{
if (plan_ptr->PlanExplainsStop(event_ptr))
{
@@ -891,17 +913,13 @@ Thread::ShouldStop (Event* event_ptr)
while ((current_plan = GetCurrentPlan()) != prev_plan_ptr);
// Now, if the responsible plan was not "Okay to discard" then we're done,
// otherwise we forward this to the next plan in the stack below.
- if (plan_ptr->IsMasterPlan() && !plan_ptr->OkayToDiscard())
- done_processing_current_plan = true;
- else
- done_processing_current_plan = false;
+ done_processing_current_plan = (plan_ptr->IsMasterPlan() && !plan_ptr->OkayToDiscard());
}
else
done_processing_current_plan = true;
break;
}
-
}
}
}
@@ -949,11 +967,10 @@ Thread::ShouldStop (Event* event_ptr)
}
else
{
-
PopPlan();
current_plan = GetCurrentPlan();
- if (current_plan == NULL)
+ if (current_plan == nullptr)
{
break;
}
@@ -968,7 +985,6 @@ Thread::ShouldStop (Event* event_ptr)
if (over_ride_stop)
should_stop = false;
-
}
// One other potential problem is that we set up a master plan, then stop in before it is complete - for instance
@@ -1103,10 +1119,7 @@ Thread::ShouldReportRun (Event* event_ptr)
bool
Thread::MatchesSpec (const ThreadSpec *spec)
{
- if (spec == NULL)
- return true;
-
- return spec->ThreadPassesBasicTests(*this);
+ return (spec == nullptr) ? true : spec->ThreadPassesBasicTests(*this);
}
void
@@ -1174,9 +1187,7 @@ Thread::GetCurrentPlan ()
{
// There will always be at least the base plan. If somebody is mucking with a
// thread with an empty plan stack, we should assert right away.
- if (m_plan_stack.empty())
- return NULL;
- return m_plan_stack.back().get();
+ return m_plan_stack.empty() ? nullptr : m_plan_stack.back().get();
}
ThreadPlanSP
@@ -1212,20 +1223,20 @@ Thread::GetReturnValueObject ()
return ValueObjectSP();
}
-ClangExpressionVariableSP
+ExpressionVariableSP
Thread::GetExpressionVariable ()
{
if (!m_completed_plan_stack.empty())
{
for (int i = m_completed_plan_stack.size() - 1; i >= 0; i--)
{
- ClangExpressionVariableSP expression_variable_sp;
+ ExpressionVariableSP expression_variable_sp;
expression_variable_sp = m_completed_plan_stack[i]->GetExpressionVariable();
if (expression_variable_sp)
return expression_variable_sp;
}
}
- return ClangExpressionVariableSP();
+ return ExpressionVariableSP();
}
bool
@@ -1259,8 +1270,8 @@ Thread::WasThreadPlanDiscarded (ThreadPlan *plan)
ThreadPlan *
Thread::GetPreviousPlan (ThreadPlan *current_plan)
{
- if (current_plan == NULL)
- return NULL;
+ if (current_plan == nullptr)
+ return nullptr;
int stack_size = m_completed_plan_stack.size();
for (int i = stack_size - 1; i > 0; i--)
@@ -1271,10 +1282,7 @@ Thread::GetPreviousPlan (ThreadPlan *current_plan)
if (stack_size > 0 && m_completed_plan_stack[0].get() == current_plan)
{
- if (m_plan_stack.size() > 0)
- return m_plan_stack.back().get();
- else
- return NULL;
+ return GetCurrentPlan();
}
stack_size = m_plan_stack.size();
@@ -1283,7 +1291,7 @@ Thread::GetPreviousPlan (ThreadPlan *current_plan)
if (current_plan == m_plan_stack[i].get())
return m_plan_stack[i-1].get();
}
- return NULL;
+ return nullptr;
}
void
@@ -1295,7 +1303,6 @@ Thread::QueueThreadPlan (ThreadPlanSP &thread_plan_sp, bool abort_other_plans)
PushPlan (thread_plan_sp);
}
-
void
Thread::EnableTracer (bool value, bool single_stepping)
{
@@ -1346,7 +1353,6 @@ Thread::DiscardUserThreadPlansUpToIndex (uint32_t thread_index)
DiscardThreadPlansUpToPlan(up_to_plan_ptr);
return true;
}
-
void
Thread::DiscardThreadPlansUpToPlan (lldb::ThreadPlanSP &up_to_plan_sp)
@@ -1364,10 +1370,10 @@ Thread::DiscardThreadPlansUpToPlan (ThreadPlan *up_to_plan_ptr)
int stack_size = m_plan_stack.size();
- // If the input plan is NULL, discard all plans. Otherwise make sure this plan is in the
+ // If the input plan is nullptr, discard all plans. Otherwise make sure this plan is in the
// stack, and if so discard up to and including it.
- if (up_to_plan_ptr == NULL)
+ if (up_to_plan_ptr == nullptr)
{
for (int i = stack_size - 1; i > 0; i--)
DiscardPlan();
@@ -1391,7 +1397,6 @@ Thread::DiscardThreadPlansUpToPlan (ThreadPlan *up_to_plan_ptr)
}
}
}
- return;
}
void
@@ -1415,7 +1420,6 @@ Thread::DiscardThreadPlans(bool force)
while (1)
{
-
int master_plan_idx;
bool discard = true;
@@ -1434,7 +1438,6 @@ Thread::DiscardThreadPlans(bool force)
// First pop all the dependent plans:
for (int i = m_plan_stack.size() - 1; i > master_plan_idx; i--)
{
-
// FIXME: Do we need a finalize here, or is the rule that "PrepareForStop"
// for the plan leaves it in a state that it is safe to pop the plan
// with no more notice?
@@ -1454,7 +1457,6 @@ Thread::DiscardThreadPlans(bool force)
// If the master plan doesn't want to get discarded, then we're done.
break;
}
-
}
}
@@ -1475,7 +1477,7 @@ Thread::UnwindInnermostExpression()
Error error;
int stack_size = m_plan_stack.size();
- // If the input plan is NULL, discard all plans. Otherwise make sure this plan is in the
+ // If the input plan is nullptr, discard all plans. Otherwise make sure this plan is in the
// stack, and if so discard up to and including it.
for (int i = stack_size - 1; i > 0; i--)
@@ -1490,7 +1492,6 @@ Thread::UnwindInnermostExpression()
return error;
}
-
ThreadPlanSP
Thread::QueueFundamentalPlan (bool abort_other_plans)
{
@@ -1500,12 +1501,9 @@ Thread::QueueFundamentalPlan (bool abort_other_plans)
}
ThreadPlanSP
-Thread::QueueThreadPlanForStepSingleInstruction
-(
- bool step_over,
- bool abort_other_plans,
- bool stop_other_threads
-)
+Thread::QueueThreadPlanForStepSingleInstruction(bool step_over,
+ bool abort_other_plans,
+ bool stop_other_threads)
{
ThreadPlanSP thread_plan_sp (new ThreadPlanStepInstruction (*this, step_over, stop_other_threads, eVoteNoOpinion, eVoteNoOpinion));
QueueThreadPlan (thread_plan_sp, abort_other_plans);
@@ -1513,14 +1511,11 @@ Thread::QueueThreadPlanForStepSingleInstruction
}
ThreadPlanSP
-Thread::QueueThreadPlanForStepOverRange
-(
- bool abort_other_plans,
- const AddressRange &range,
- const SymbolContext &addr_context,
- lldb::RunMode stop_other_threads,
- LazyBool step_out_avoids_code_withoug_debug_info
-)
+Thread::QueueThreadPlanForStepOverRange(bool abort_other_plans,
+ const AddressRange &range,
+ const SymbolContext &addr_context,
+ lldb::RunMode stop_other_threads,
+ LazyBool step_out_avoids_code_withoug_debug_info)
{
ThreadPlanSP thread_plan_sp;
thread_plan_sp.reset (new ThreadPlanStepOverRange (*this, range, addr_context, stop_other_threads, step_out_avoids_code_withoug_debug_info));
@@ -1529,17 +1524,29 @@ Thread::QueueThreadPlanForStepOverRange
return thread_plan_sp;
}
+// Call the QueueThreadPlanForStepOverRange method which takes an address range.
ThreadPlanSP
-Thread::QueueThreadPlanForStepInRange
-(
- bool abort_other_plans,
- const AddressRange &range,
- const SymbolContext &addr_context,
- const char *step_in_target,
- lldb::RunMode stop_other_threads,
- LazyBool step_in_avoids_code_without_debug_info,
- LazyBool step_out_avoids_code_without_debug_info
-)
+Thread::QueueThreadPlanForStepOverRange(bool abort_other_plans,
+ const LineEntry &line_entry,
+ const SymbolContext &addr_context,
+ lldb::RunMode stop_other_threads,
+ LazyBool step_out_avoids_code_withoug_debug_info)
+{
+ return QueueThreadPlanForStepOverRange (abort_other_plans,
+ line_entry.GetSameLineContiguousAddressRange(),
+ addr_context,
+ stop_other_threads,
+ step_out_avoids_code_withoug_debug_info);
+}
+
+ThreadPlanSP
+Thread::QueueThreadPlanForStepInRange(bool abort_other_plans,
+ const AddressRange &range,
+ const SymbolContext &addr_context,
+ const char *step_in_target,
+ lldb::RunMode stop_other_threads,
+ LazyBool step_in_avoids_code_without_debug_info,
+ LazyBool step_out_avoids_code_without_debug_info)
{
ThreadPlanSP thread_plan_sp (new ThreadPlanStepInRange (*this,
range,
@@ -1556,19 +1563,35 @@ Thread::QueueThreadPlanForStepInRange
return thread_plan_sp;
}
+// Call the QueueThreadPlanForStepInRange method which takes an address range.
+ThreadPlanSP
+Thread::QueueThreadPlanForStepInRange(bool abort_other_plans,
+ const LineEntry &line_entry,
+ const SymbolContext &addr_context,
+ const char *step_in_target,
+ lldb::RunMode stop_other_threads,
+ LazyBool step_in_avoids_code_without_debug_info,
+ LazyBool step_out_avoids_code_without_debug_info)
+{
+ return QueueThreadPlanForStepInRange (abort_other_plans,
+ line_entry.GetSameLineContiguousAddressRange(),
+ addr_context,
+ step_in_target,
+ stop_other_threads,
+ step_in_avoids_code_without_debug_info,
+ step_out_avoids_code_without_debug_info);
+}
+
ThreadPlanSP
-Thread::QueueThreadPlanForStepOut
-(
- bool abort_other_plans,
- SymbolContext *addr_context,
- bool first_insn,
- bool stop_other_threads,
- Vote stop_vote,
- Vote run_vote,
- uint32_t frame_idx,
- LazyBool step_out_avoids_code_withoug_debug_info
-)
+Thread::QueueThreadPlanForStepOut(bool abort_other_plans,
+ SymbolContext *addr_context,
+ bool first_insn,
+ bool stop_other_threads,
+ Vote stop_vote,
+ Vote run_vote,
+ uint32_t frame_idx,
+ LazyBool step_out_avoids_code_withoug_debug_info)
{
ThreadPlanSP thread_plan_sp (new ThreadPlanStepOut (*this,
addr_context,
@@ -1579,7 +1602,7 @@ Thread::QueueThreadPlanForStepOut
frame_idx,
step_out_avoids_code_withoug_debug_info));
- if (thread_plan_sp->ValidatePlan(NULL))
+ if (thread_plan_sp->ValidatePlan(nullptr))
{
QueueThreadPlan (thread_plan_sp, abort_other_plans);
return thread_plan_sp;
@@ -1591,16 +1614,13 @@ Thread::QueueThreadPlanForStepOut
}
ThreadPlanSP
-Thread::QueueThreadPlanForStepOutNoShouldStop
-(
- bool abort_other_plans,
- SymbolContext *addr_context,
- bool first_insn,
- bool stop_other_threads,
- Vote stop_vote,
- Vote run_vote,
- uint32_t frame_idx
-)
+Thread::QueueThreadPlanForStepOutNoShouldStop(bool abort_other_plans,
+ SymbolContext *addr_context,
+ bool first_insn,
+ bool stop_other_threads,
+ Vote stop_vote,
+ Vote run_vote,
+ uint32_t frame_idx)
{
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut (*this,
addr_context,
@@ -1614,7 +1634,7 @@ Thread::QueueThreadPlanForStepOutNoShouldStop
ThreadPlanStepOut *new_plan = static_cast<ThreadPlanStepOut *>(thread_plan_sp.get());
new_plan->ClearShouldStopHereCallbacks();
- if (thread_plan_sp->ValidatePlan(NULL))
+ if (thread_plan_sp->ValidatePlan(nullptr))
{
QueueThreadPlan (thread_plan_sp, abort_other_plans);
return thread_plan_sp;
@@ -1629,7 +1649,7 @@ ThreadPlanSP
Thread::QueueThreadPlanForStepThrough (StackID &return_stack_id, bool abort_other_plans, bool stop_other_threads)
{
ThreadPlanSP thread_plan_sp(new ThreadPlanStepThrough (*this, return_stack_id, stop_other_threads));
- if (!thread_plan_sp || !thread_plan_sp->ValidatePlan (NULL))
+ if (!thread_plan_sp || !thread_plan_sp->ValidatePlan(nullptr))
return ThreadPlanSP();
QueueThreadPlan (thread_plan_sp, abort_other_plans);
@@ -1677,7 +1697,6 @@ Thread::QueueThreadPlanForStepScripted (bool abort_other_plans,
}
else
return thread_plan_sp;
-
}
uint32_t
@@ -1768,7 +1787,6 @@ Thread::CalculateTarget ()
if (process_sp)
target_sp = process_sp->CalculateTarget();
return target_sp;
-
}
ProcessSP
@@ -1795,7 +1813,6 @@ Thread::CalculateExecutionContext (ExecutionContext &exe_ctx)
exe_ctx.SetContext (shared_from_this());
}
-
StackFrameListSP
Thread::GetStackFrameList ()
{
@@ -1839,7 +1856,6 @@ Thread::GetFrameWithConcreteFrameIndex (uint32_t unwind_idx)
return GetStackFrameList()->GetFrameWithConcreteFrameIndex (unwind_idx);
}
-
Error
Thread::ReturnFromFrameWithIndex (uint32_t frame_idx, lldb::ValueObjectSP return_value_sp, bool broadcast)
{
@@ -1886,12 +1902,12 @@ Thread::ReturnFromFrame (lldb::StackFrameSP frame_sp, lldb::ValueObjectSP return
// FIXME: ValueObject::Cast doesn't currently work correctly, at least not for scalars.
// Turn that back on when that works.
- if (/* DISABLES CODE */ (0) && sc.function != NULL)
+ if (/* DISABLES CODE */ (0) && sc.function != nullptr)
{
Type *function_type = sc.function->GetType();
if (function_type)
{
- ClangASTType return_type = sc.function->GetClangType().GetFunctionReturnType();
+ CompilerType return_type = sc.function->GetCompilerType().GetFunctionReturnType();
if (return_type)
{
StreamString s;
@@ -2024,7 +2040,7 @@ Thread::DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx)
{
ExecutionContext exe_ctx (shared_from_this());
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return;
StackFrameSP frame_sp;
@@ -2044,10 +2060,10 @@ Thread::DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx)
FormatEntity::Format(*thread_format,
strm,
- frame_sp ? &frame_sc : NULL,
+ frame_sp ? &frame_sc : nullptr,
&exe_ctx,
- NULL,
- NULL,
+ nullptr,
+ nullptr,
false,
false);
}
@@ -2119,7 +2135,6 @@ Thread::StopReasonAsCString (lldb::StopReason reason)
case eStopReasonInstrumentation: return "instrumentation break";
}
-
static char unknown_state_string[64];
snprintf(unknown_state_string, sizeof (unknown_state_string), "StopReason = %i", reason);
return unknown_state_string;
@@ -2176,7 +2191,7 @@ Thread::GetStatus (Stream &strm, uint32_t start_frame, uint32_t num_frames, uint
const bool show_frame_info = true;
- const char *selected_frame_marker = NULL;
+ const char *selected_frame_marker = nullptr;
if (num_frames == 1 || (GetID() != GetProcess()->GetThreadList().GetSelectedThread()->GetID()))
strm.IndentMore ();
else
@@ -2302,7 +2317,7 @@ Thread::GetStackFrameStatus (Stream& strm,
Unwind *
Thread::GetUnwinder ()
{
- if (m_unwinder_ap.get() == NULL)
+ if (!m_unwinder_ap)
{
const ArchSpec target_arch (CalculateTarget()->GetArchitecture ());
const llvm::Triple::ArchType machine = target_arch.GetMachine();
@@ -2332,7 +2347,6 @@ Thread::GetUnwinder ()
return m_unwinder_ap.get();
}
-
void
Thread::Flush ()
{
@@ -2364,7 +2378,6 @@ Thread::IsStillAtLastBreakpointHit ()
return false;
}
-
Error
Thread::StepIn (bool source_step,
LazyBool step_in_avoids_code_without_debug_info,
@@ -2383,13 +2396,13 @@ Thread::StepIn (bool source_step,
if (source_step && frame_sp && frame_sp->HasDebugInformation ())
{
SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
- new_plan_sp = QueueThreadPlanForStepInRange (abort_other_plans,
- sc.line_entry.range,
- sc,
- NULL,
- run_mode,
- step_in_avoids_code_without_debug_info,
- step_out_avoids_code_without_debug_info);
+ new_plan_sp = QueueThreadPlanForStepInRange(abort_other_plans,
+ sc.line_entry,
+ sc,
+ nullptr,
+ run_mode,
+ step_in_avoids_code_without_debug_info,
+ step_out_avoids_code_without_debug_info);
}
else
{
@@ -2430,7 +2443,7 @@ Thread::StepOver (bool source_step,
{
SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
new_plan_sp = QueueThreadPlanForStepOverRange (abort_other_plans,
- sc.line_entry.range,
+ sc.line_entry,
sc,
run_mode,
step_out_avoids_code_without_debug_info);
@@ -2467,13 +2480,13 @@ Thread::StepOut ()
const bool stop_other_threads = false;
const bool abort_other_plans = false;
- ThreadPlanSP new_plan_sp(QueueThreadPlanForStepOut (abort_other_plans,
- NULL,
- first_instruction,
- stop_other_threads,
- eVoteYes,
- eVoteNoOpinion,
- 0));
+ ThreadPlanSP new_plan_sp(QueueThreadPlanForStepOut(abort_other_plans,
+ nullptr,
+ first_instruction,
+ stop_other_threads,
+ eVoteYes,
+ eVoteNoOpinion,
+ 0));
new_plan_sp->SetIsMasterPlan(true);
new_plan_sp->SetOkayToDiscard(false);
OpenPOWER on IntegriCloud