summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectType.cpp12
3 files changed, 15 insertions, 6 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index cef99b759dd..857440b7af7 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -708,7 +708,7 @@ protected:
if (m_options.m_ignore > 0)
{
- ThreadSP sel_thread_sp(process->GetThreadList().GetSelectedThread());
+ ThreadSP sel_thread_sp(GetDefaultThread()->shared_from_this());
if (sel_thread_sp)
{
StopInfoSP stop_info_sp = sel_thread_sp->GetStopInfo();
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index fa273d6b7d9..988eb5026a8 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -509,7 +509,8 @@ protected:
if (command.GetArgumentCount() == 0)
{
- thread = process->GetThreadList().GetSelectedThread().get();
+ thread = GetDefaultThread();
+
if (thread == nullptr)
{
result.AppendError ("no selected thread in process");
@@ -919,7 +920,7 @@ public:
// lock before calling process->Resume below.
Mutex::Locker locker (process->GetThreadList().GetMutex());
const uint32_t num_threads = process->GetThreadList().GetSize();
- Thread *current_thread = process->GetThreadList().GetSelectedThread().get();
+ Thread *current_thread = GetDefaultThread();
if (current_thread == nullptr)
{
result.AppendError ("the process doesn't have a current thread");
@@ -1170,7 +1171,7 @@ protected:
if (m_options.m_thread_idx == LLDB_INVALID_THREAD_ID)
{
- thread = process->GetThreadList().GetSelectedThread().get();
+ thread = GetDefaultThread();
}
else
{
diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp
index acbcdbb69ef..971506bd9e0 100644
--- a/lldb/source/Commands/CommandObjectType.cpp
+++ b/lldb/source/Commands/CommandObjectType.cpp
@@ -3423,8 +3423,16 @@ protected:
bool
DoExecute (const char *command, CommandReturnObject &result) override
{
- auto target_sp = m_interpreter.GetDebugger().GetSelectedTarget();
- auto frame_sp = target_sp->GetProcessSP()->GetThreadList().GetSelectedThread()->GetSelectedFrame();
+ TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget();
+ Thread *thread = GetDefaultThread();
+ if (!thread)
+ {
+ result.AppendError("no default thread");
+ result.SetStatus(lldb::eReturnStatusFailed);
+ return false;
+ }
+
+ StackFrameSP frame_sp = thread->GetSelectedFrame();
ValueObjectSP result_valobj_sp;
EvaluateExpressionOptions options;
lldb::ExpressionResults expr_result = target_sp->EvaluateExpression(command, frame_sp.get(), result_valobj_sp, options);
OpenPOWER on IntegriCloud