forked from OSchip/llvm-project
Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected.
llvm-svn: 112221
This commit is contained in:
parent
17da935964
commit
2976d00adb
|
@ -99,10 +99,10 @@ public:
|
|||
GetNumTargets ();
|
||||
|
||||
lldb::SBTarget
|
||||
GetCurrentTarget ();
|
||||
GetSelectedTarget ();
|
||||
|
||||
void
|
||||
UpdateCurrentThread (lldb::SBProcess &process);
|
||||
UpdateSelectedThread (lldb::SBProcess &process);
|
||||
|
||||
lldb::SBSourceManager &
|
||||
GetSourceManager ();
|
||||
|
|
|
@ -58,10 +58,10 @@ public:
|
|||
GetSTDERR (char *dst, size_t dst_len) const;
|
||||
|
||||
void
|
||||
ReportCurrentState (const lldb::SBEvent &event, FILE *out) const;
|
||||
ReportEventState (const lldb::SBEvent &event, FILE *out) const;
|
||||
|
||||
void
|
||||
AppendCurrentStateReport (const lldb::SBEvent &event, lldb::SBCommandReturnObject &result);
|
||||
AppendEventStateReport (const lldb::SBEvent &event, lldb::SBCommandReturnObject &result);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Thread related functions
|
||||
|
@ -76,13 +76,13 @@ public:
|
|||
GetThreadByID (lldb::tid_t sb_thread_id);
|
||||
|
||||
lldb::SBThread
|
||||
GetCurrentThread () const;
|
||||
GetSelectedThread () const;
|
||||
|
||||
bool
|
||||
SetCurrentThread (const lldb::SBThread &thread);
|
||||
SetSelectedThread (const lldb::SBThread &thread);
|
||||
|
||||
bool
|
||||
SetCurrentThreadByID (uint32_t tid);
|
||||
SetSelectedThreadByID (uint32_t tid);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Stepping related functions
|
||||
|
|
|
@ -82,9 +82,6 @@ public:
|
|||
bool
|
||||
DeleteTargetFromList (lldb_private::TargetList *list);
|
||||
|
||||
bool
|
||||
MakeCurrentTarget ();
|
||||
|
||||
lldb::SBBreakpoint
|
||||
BreakpointCreateByLocation (const char *file, uint32_t line);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
GetQueueName() const;
|
||||
|
||||
void
|
||||
DisplayFramesForCurrentContext (FILE *out,
|
||||
DisplayFramesForSelectedContext (FILE *out,
|
||||
FILE *err,
|
||||
uint32_t first_frame,
|
||||
uint32_t num_frames,
|
||||
|
@ -62,7 +62,7 @@ public:
|
|||
uint32_t source_lines_after = 3);
|
||||
|
||||
bool
|
||||
DisplaySingleFrameForCurrentContext (FILE *out,
|
||||
DisplaySingleFrameForSelectedContext (FILE *out,
|
||||
FILE *err,
|
||||
lldb::SBFrame &frame,
|
||||
bool show_frame_info,
|
||||
|
|
|
@ -112,10 +112,6 @@ protected:
|
|||
#endif
|
||||
|
||||
private:
|
||||
//
|
||||
// lldb_private::ExecutionContext
|
||||
// GetCurrentExecutionContext ();
|
||||
//
|
||||
lldb::ValueObjectSP m_opaque_sp;
|
||||
};
|
||||
|
||||
|
|
|
@ -101,10 +101,10 @@ public:
|
|||
GetSourceManager ();
|
||||
|
||||
lldb::TargetSP
|
||||
GetCurrentTarget ();
|
||||
GetSelectedTarget ();
|
||||
|
||||
ExecutionContext
|
||||
GetCurrentExecutionContext();
|
||||
GetSelectedExecutionContext();
|
||||
//------------------------------------------------------------------
|
||||
/// Get accessor for the target list.
|
||||
///
|
||||
|
|
|
@ -41,14 +41,14 @@ public:
|
|||
|
||||
// Mark a stack frame as the current frame
|
||||
uint32_t
|
||||
SetCurrentFrame (lldb_private::StackFrame *frame);
|
||||
SetSelectedFrame (lldb_private::StackFrame *frame);
|
||||
|
||||
uint32_t
|
||||
GetCurrentFrameIndex () const;
|
||||
GetSelectedFrameIndex () const;
|
||||
|
||||
// Mark a stack frame as the current frame using the frame index
|
||||
void
|
||||
SetCurrentFrameByIndex (uint32_t idx);
|
||||
SetSelectedFrameByIndex (uint32_t idx);
|
||||
|
||||
void
|
||||
Clear ();
|
||||
|
@ -90,7 +90,7 @@ protected:
|
|||
collection m_unwind_frames;
|
||||
collection m_inline_frames;
|
||||
InlinedFrameInfoCollection m_inlined_info;
|
||||
uint32_t m_current_frame_idx;
|
||||
uint32_t m_selected_frame_idx;
|
||||
bool m_show_inlined_frames;
|
||||
|
||||
private:
|
||||
|
|
|
@ -181,13 +181,13 @@ public:
|
|||
SignalIfRunning (lldb::pid_t pid, int signo);
|
||||
|
||||
uint32_t
|
||||
SetCurrentTarget (Target *target);
|
||||
SetSelectedTarget (Target *target);
|
||||
|
||||
void
|
||||
SetCurrentTargetWithIndex (uint32_t idx);
|
||||
SetSelectedTargetWithIndex (uint32_t idx);
|
||||
|
||||
lldb::TargetSP
|
||||
GetCurrentTarget ();
|
||||
GetSelectedTarget ();
|
||||
|
||||
|
||||
protected:
|
||||
|
@ -197,7 +197,7 @@ protected:
|
|||
//------------------------------------------------------------------
|
||||
collection m_target_list;
|
||||
mutable Mutex m_target_list_mutex;
|
||||
uint32_t m_current_target_idx;
|
||||
uint32_t m_selected_target_idx;
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN (TargetList);
|
||||
};
|
||||
|
|
|
@ -177,13 +177,13 @@ public:
|
|||
GetStackFrameAtIndex (uint32_t idx);
|
||||
|
||||
lldb::StackFrameSP
|
||||
GetCurrentFrame ();
|
||||
GetSelectedFrame ();
|
||||
|
||||
uint32_t
|
||||
SetCurrentFrame (lldb_private::StackFrame *frame);
|
||||
SetSelectedFrame (lldb_private::StackFrame *frame);
|
||||
|
||||
void
|
||||
SetCurrentFrameByIndex (uint32_t frame_idx);
|
||||
SetSelectedFrameByIndex (uint32_t frame_idx);
|
||||
|
||||
virtual RegisterContext *
|
||||
GetRegisterContext () = 0;
|
||||
|
|
|
@ -46,13 +46,13 @@ public:
|
|||
AddThread (lldb::ThreadSP &thread_sp);
|
||||
|
||||
lldb::ThreadSP
|
||||
GetCurrentThread ();
|
||||
GetSelectedThread ();
|
||||
|
||||
bool
|
||||
SetCurrentThreadByID (lldb::tid_t tid);
|
||||
SetSelectedThreadByID (lldb::tid_t tid);
|
||||
|
||||
bool
|
||||
SetCurrentThreadByIndexID (uint32_t index_id);
|
||||
SetSelectedThreadByIndexID (uint32_t index_id);
|
||||
|
||||
void
|
||||
Clear();
|
||||
|
@ -109,7 +109,7 @@ protected:
|
|||
uint32_t m_stop_id; ///< The process stop ID that this thread list is valid for.
|
||||
collection m_threads; ///< The threads for this process.
|
||||
mutable Mutex m_threads_mutex;
|
||||
lldb::tid_t m_current_tid; ///< For targets that need the notion of a current thread.
|
||||
lldb::tid_t m_selected_tid; ///< For targets that need the notion of a current thread.
|
||||
|
||||
private:
|
||||
ThreadList ();
|
||||
|
|
|
@ -166,7 +166,7 @@ SBCommandInterpreter::GetProcess ()
|
|||
if (m_opaque_ptr)
|
||||
{
|
||||
Debugger &debugger = m_opaque_ptr->GetDebugger();
|
||||
Target *target = debugger.GetCurrentTarget().get();
|
||||
Target *target = debugger.GetSelectedTarget().get();
|
||||
if (target)
|
||||
process.SetProcess(target->GetProcessSP());
|
||||
}
|
||||
|
|
|
@ -215,16 +215,16 @@ SBDebugger::HandleProcessEvent (const SBProcess &process, const SBEvent &event,
|
|||
|
||||
bool is_stopped = StateIsStoppedState (event_state);
|
||||
if (!is_stopped)
|
||||
process.ReportCurrentState (event, out);
|
||||
process.ReportEventState (event, out);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SBDebugger::UpdateCurrentThread (SBProcess &process)
|
||||
SBDebugger::UpdateSelectedThread (SBProcess &process)
|
||||
{
|
||||
if (process.IsValid())
|
||||
{
|
||||
SBThread curr_thread = process.GetCurrentThread ();
|
||||
SBThread curr_thread = process.GetSelectedThread ();
|
||||
SBThread thread;
|
||||
StopReason curr_thread_stop_reason = eStopReasonInvalid;
|
||||
if (curr_thread.IsValid())
|
||||
|
@ -270,9 +270,9 @@ SBDebugger::UpdateCurrentThread (SBProcess &process)
|
|||
}
|
||||
}
|
||||
if (plan_thread.IsValid())
|
||||
process.SetCurrentThreadByID (plan_thread.GetThreadID());
|
||||
process.SetSelectedThreadByID (plan_thread.GetThreadID());
|
||||
else if (other_thread.IsValid())
|
||||
process.SetCurrentThreadByID (other_thread.GetThreadID());
|
||||
process.SetSelectedThreadByID (other_thread.GetThreadID());
|
||||
else
|
||||
{
|
||||
if (curr_thread.IsValid())
|
||||
|
@ -281,7 +281,7 @@ SBDebugger::UpdateCurrentThread (SBProcess &process)
|
|||
thread = process.GetThreadAtIndex(0);
|
||||
|
||||
if (thread.IsValid())
|
||||
process.SetCurrentThreadByID (thread.GetThreadID());
|
||||
process.SetSelectedThreadByID (thread.GetThreadID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ SBDebugger::CreateTargetWithFileAndArch (const char *filename, const char *archn
|
|||
|
||||
if (error.Success())
|
||||
{
|
||||
m_opaque_sp->GetTargetList().SetCurrentTarget (target_sp.get());
|
||||
m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
|
||||
target.reset(target_sp);
|
||||
}
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ SBDebugger::CreateTarget (const char *filename)
|
|||
|
||||
if (error.Success())
|
||||
{
|
||||
m_opaque_sp->GetTargetList().SetCurrentTarget (target_sp.get());
|
||||
m_opaque_sp->GetTargetList().SetSelectedTarget (target_sp.get());
|
||||
target.reset (target_sp);
|
||||
}
|
||||
}
|
||||
|
@ -509,11 +509,11 @@ SBDebugger::GetNumTargets ()
|
|||
}
|
||||
|
||||
SBTarget
|
||||
SBDebugger::GetCurrentTarget ()
|
||||
SBDebugger::GetSelectedTarget ()
|
||||
{
|
||||
SBTarget sb_target;
|
||||
if (m_opaque_sp)
|
||||
sb_target.reset(m_opaque_sp->GetTargetList().GetCurrentTarget ());
|
||||
sb_target.reset(m_opaque_sp->GetTargetList().GetSelectedTarget ());
|
||||
return sb_target;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,11 +97,11 @@ SBProcess::GetNumThreads ()
|
|||
}
|
||||
|
||||
SBThread
|
||||
SBProcess::GetCurrentThread () const
|
||||
SBProcess::GetSelectedThread () const
|
||||
{
|
||||
SBThread sb_thread;
|
||||
if (m_opaque_sp)
|
||||
sb_thread.SetThread (m_opaque_sp->GetThreadList().GetCurrentThread());
|
||||
sb_thread.SetThread (m_opaque_sp->GetThreadList().GetSelectedThread());
|
||||
return sb_thread;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ SBProcess::GetSTDERR (char *dst, size_t dst_len) const
|
|||
}
|
||||
|
||||
void
|
||||
SBProcess::ReportCurrentState (const SBEvent &event, FILE *out) const
|
||||
SBProcess::ReportEventState (const SBEvent &event, FILE *out) const
|
||||
{
|
||||
if (out == NULL)
|
||||
return;
|
||||
|
@ -173,7 +173,7 @@ SBProcess::ReportCurrentState (const SBEvent &event, FILE *out) const
|
|||
}
|
||||
|
||||
void
|
||||
SBProcess::AppendCurrentStateReport (const SBEvent &event, SBCommandReturnObject &result)
|
||||
SBProcess::AppendEventStateReport (const SBEvent &event, SBCommandReturnObject &result)
|
||||
{
|
||||
if (m_opaque_sp != NULL)
|
||||
{
|
||||
|
@ -190,18 +190,18 @@ SBProcess::AppendCurrentStateReport (const SBEvent &event, SBCommandReturnObject
|
|||
}
|
||||
|
||||
bool
|
||||
SBProcess::SetCurrentThread (const SBThread &thread)
|
||||
SBProcess::SetSelectedThread (const SBThread &thread)
|
||||
{
|
||||
if (m_opaque_sp != NULL)
|
||||
return m_opaque_sp->GetThreadList().SetCurrentThreadByID (thread.GetThreadID());
|
||||
return m_opaque_sp->GetThreadList().SetSelectedThreadByID (thread.GetThreadID());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
SBProcess::SetCurrentThreadByID (uint32_t tid)
|
||||
SBProcess::SetSelectedThreadByID (uint32_t tid)
|
||||
{
|
||||
if (m_opaque_sp != NULL)
|
||||
return m_opaque_sp->GetThreadList().SetCurrentThreadByID (tid);
|
||||
return m_opaque_sp->GetThreadList().SetSelectedThreadByID (tid);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ SBProcess::WaitUntilProcessHasStopped (SBCommandReturnObject &result)
|
|||
{
|
||||
state = m_opaque_sp->WaitForStateChangedEvents (NULL, event_sp);
|
||||
SBEvent event (event_sp);
|
||||
AppendCurrentStateReport (event, result);
|
||||
AppendEventStateReport (event, result);
|
||||
state_changed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,17 +166,6 @@ SBTarget::DeleteTargetFromList (TargetList *list)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
SBTarget::MakeCurrentTarget ()
|
||||
{
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
m_opaque_sp->GetDebugger().GetTargetList().SetCurrentTarget (m_opaque_sp.get());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
SBTarget::operator == (const SBTarget &rhs) const
|
||||
{
|
||||
|
|
|
@ -219,7 +219,7 @@ SBThread::GetQueueName () const
|
|||
|
||||
|
||||
void
|
||||
SBThread::DisplayFramesForCurrentContext (FILE *out,
|
||||
SBThread::DisplayFramesForSelectedContext (FILE *out,
|
||||
FILE *err,
|
||||
uint32_t first_frame,
|
||||
uint32_t num_frames,
|
||||
|
@ -247,7 +247,7 @@ SBThread::DisplayFramesForCurrentContext (FILE *out,
|
|||
break;
|
||||
|
||||
SBFrame sb_frame (frame_sp);
|
||||
if (DisplaySingleFrameForCurrentContext (out,
|
||||
if (DisplaySingleFrameForSelectedContext (out,
|
||||
err,
|
||||
sb_frame,
|
||||
show_frame_info,
|
||||
|
@ -260,13 +260,13 @@ SBThread::DisplayFramesForCurrentContext (FILE *out,
|
|||
}
|
||||
|
||||
bool
|
||||
SBThread::DisplaySingleFrameForCurrentContext (FILE *out,
|
||||
FILE *err,
|
||||
SBFrame &frame,
|
||||
bool show_frame_info,
|
||||
bool show_source,
|
||||
uint32_t source_lines_after,
|
||||
uint32_t source_lines_before)
|
||||
SBThread::DisplaySingleFrameForSelectedContext (FILE *out,
|
||||
FILE *err,
|
||||
SBFrame &frame,
|
||||
bool show_frame_info,
|
||||
bool show_source,
|
||||
uint32_t source_lines_after,
|
||||
uint32_t source_lines_before)
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
|
@ -349,7 +349,7 @@ SBThread::StepOver (lldb::RunMode stop_other_threads)
|
|||
|
||||
Process &process = m_opaque_sp->GetProcess();
|
||||
// Why do we need to set the current thread by ID here???
|
||||
process.GetThreadList().SetCurrentThreadByID (m_opaque_sp->GetID());
|
||||
process.GetThreadList().SetSelectedThreadByID (m_opaque_sp->GetID());
|
||||
process.Resume();
|
||||
}
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ SBThread::StepInto (lldb::RunMode stop_other_threads)
|
|||
|
||||
Process &process = m_opaque_sp->GetProcess();
|
||||
// Why do we need to set the current thread by ID here???
|
||||
process.GetThreadList().SetCurrentThreadByID (m_opaque_sp->GetID());
|
||||
process.GetThreadList().SetSelectedThreadByID (m_opaque_sp->GetID());
|
||||
process.Resume();
|
||||
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ SBThread::StepOut ()
|
|||
m_opaque_sp->QueueThreadPlanForStepOut (abort_other_plans, NULL, false, stop_other_threads, eVoteYes, eVoteNoOpinion);
|
||||
|
||||
Process &process = m_opaque_sp->GetProcess();
|
||||
process.GetThreadList().SetCurrentThreadByID (m_opaque_sp->GetID());
|
||||
process.GetThreadList().SetSelectedThreadByID (m_opaque_sp->GetID());
|
||||
process.Resume();
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ SBThread::StepInstruction (bool step_over)
|
|||
{
|
||||
m_opaque_sp->QueueThreadPlanForStepSingleInstruction (step_over, true, true);
|
||||
Process &process = m_opaque_sp->GetProcess();
|
||||
process.GetThreadList().SetCurrentThreadByID (m_opaque_sp->GetID());
|
||||
process.GetThreadList().SetSelectedThreadByID (m_opaque_sp->GetID());
|
||||
process.Resume();
|
||||
}
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ SBThread::RunToAddress (lldb::addr_t addr)
|
|||
|
||||
m_opaque_sp->QueueThreadPlanForRunToAddress (abort_other_plans, target_addr, stop_other_threads);
|
||||
Process &process = m_opaque_sp->GetProcess();
|
||||
process.GetThreadList().SetCurrentThreadByID (m_opaque_sp->GetID());
|
||||
process.GetThreadList().SetSelectedThreadByID (m_opaque_sp->GetID());
|
||||
process.Resume();
|
||||
}
|
||||
|
||||
|
|
|
@ -302,42 +302,6 @@ SBValue::TypeIsPtrType ()
|
|||
return is_ptr_type;
|
||||
}
|
||||
|
||||
|
||||
//lldb_private::ExecutionContext
|
||||
//SBValue::GetCurrentExecutionContext ()
|
||||
//{
|
||||
// lldb_private::Process *process = NULL;
|
||||
// lldb_private::Thread *thread = NULL;
|
||||
// lldb_private::StackFrame *frame = NULL;
|
||||
//
|
||||
// SBTarget sb_target = SBDebugger::GetCurrentTarget();
|
||||
// if (sb_target.IsValid())
|
||||
// {
|
||||
// SBProcess sb_process = sb_target.GetProcess();
|
||||
// if (sb_process.IsValid())
|
||||
// {
|
||||
// process = sb_process.get();
|
||||
// SBThread sb_thread = sb_process.GetCurrentThread();
|
||||
// if (sb_thread.IsValid())
|
||||
// {
|
||||
// thread = sb_thread.GetLLDBObjectPtr();
|
||||
// frame = thread->GetStackFrameAtIndex(0).get();
|
||||
// lldb_private::ExecutionContext exe_context (process, thread, frame);
|
||||
// return exe_context;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// lldb_private::ExecutionContext exe_context (process, NULL, NULL);
|
||||
// return exe_context;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// lldb_private::ExecutionContext exe_context (NULL, NULL, NULL);
|
||||
// return exe_context;
|
||||
//}
|
||||
//
|
||||
//
|
||||
void *
|
||||
SBValue::GetOpaqueType()
|
||||
{
|
||||
|
|
|
@ -102,7 +102,7 @@ CommandCompletions::SourceFiles
|
|||
|
||||
if (searcher == NULL)
|
||||
{
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetCurrentTarget();
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
|
||||
SearchFilter null_searcher (target_sp);
|
||||
completer.DoCompletion (&null_searcher);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ CommandCompletions::Modules
|
|||
|
||||
if (searcher == NULL)
|
||||
{
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetCurrentTarget();
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
|
||||
SearchFilter null_searcher (target_sp);
|
||||
completer.DoCompletion (&null_searcher);
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ CommandCompletions::Symbols
|
|||
|
||||
if (searcher == NULL)
|
||||
{
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetCurrentTarget();
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
|
||||
SearchFilter null_searcher (target_sp);
|
||||
completer.DoCompletion (&null_searcher);
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ CommandObjectArgs::Execute
|
|||
return false;
|
||||
}
|
||||
|
||||
lldb::StackFrameSP thread_cur_frame = thread->GetCurrentFrame ();
|
||||
lldb::StackFrameSP thread_cur_frame = thread->GetSelectedFrame ();
|
||||
if (!thread_cur_frame)
|
||||
{
|
||||
result.AppendError ("The current thread has no current frame.");
|
||||
|
|
|
@ -273,7 +273,7 @@ CommandObjectBreakpointSet::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("Invalid target, set executable file using 'file' command.");
|
||||
|
@ -706,7 +706,7 @@ CommandObjectBreakpointList::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("Invalid target, set executable file using 'file' command.");
|
||||
|
@ -797,7 +797,7 @@ CommandObjectBreakpointEnable::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("Invalid target, set executable file using 'file' command.");
|
||||
|
@ -897,7 +897,7 @@ CommandObjectBreakpointDisable::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("Invalid target, set executable file using 'file' command.");
|
||||
|
@ -993,7 +993,7 @@ CommandObjectBreakpointDelete::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("Invalid target, set executable file using 'file' command.");
|
||||
|
@ -1240,7 +1240,7 @@ CommandObjectBreakpointModify::Execute
|
|||
return false;
|
||||
}
|
||||
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("Invalid target, set executable file using 'file' command.");
|
||||
|
|
|
@ -213,7 +213,7 @@ CommandObjectBreakpointCommandAdd::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
|
||||
if (target == NULL)
|
||||
{
|
||||
|
@ -417,7 +417,7 @@ CommandObjectBreakpointCommandRemove::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
|
||||
if (target == NULL)
|
||||
{
|
||||
|
@ -503,7 +503,7 @@ CommandObjectBreakpointCommandList::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
|
||||
if (target == NULL)
|
||||
{
|
||||
|
|
|
@ -160,7 +160,7 @@ CommandObjectDisassemble::Execute
|
|||
CommandReturnObject &result
|
||||
)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
|
|
@ -132,7 +132,7 @@ CommandObjectFile::Execute
|
|||
|
||||
if (target_sp)
|
||||
{
|
||||
debugger.GetTargetList().SetCurrentTarget(target_sp.get());
|
||||
debugger.GetTargetList().SetSelectedTarget(target_sp.get());
|
||||
result.AppendMessageWithFormat ("Current executable set to '%s' (%s).\n", file_path, target_sp->GetArchitecture().AsCString());
|
||||
result.SetStatus (eReturnStatusSuccessFinishNoResult);
|
||||
}
|
||||
|
|
|
@ -109,8 +109,8 @@ public:
|
|||
const uint32_t frame_idx = Args::StringToUInt32 (frame_idx_cstr, UINT32_MAX, 0);
|
||||
if (frame_idx < num_frames)
|
||||
{
|
||||
exe_ctx.thread->SetCurrentFrameByIndex (frame_idx);
|
||||
exe_ctx.frame = exe_ctx.thread->GetCurrentFrame ().get();
|
||||
exe_ctx.thread->SetSelectedFrameByIndex (frame_idx);
|
||||
exe_ctx.frame = exe_ctx.thread->GetSelectedFrame ().get();
|
||||
|
||||
if (exe_ctx.frame)
|
||||
{
|
||||
|
|
|
@ -579,7 +579,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
@ -687,7 +687,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
@ -794,7 +794,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
@ -901,7 +901,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
@ -1070,7 +1070,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
@ -1438,7 +1438,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
|
|
@ -124,7 +124,7 @@ public:
|
|||
Args& launch_args,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
bool synchronous_execution = interpreter.GetSynchronous ();
|
||||
// bool launched = false;
|
||||
// bool stopped_after_launch = false;
|
||||
|
@ -377,7 +377,7 @@ public:
|
|||
if (process && process->IsAlive())
|
||||
return true;
|
||||
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
// No target has been set yet, for now do host completion. Otherwise I don't know how we would
|
||||
|
@ -436,7 +436,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
|
||||
Process *process = interpreter.GetDebugger().GetExecutionContext().process;
|
||||
if (process)
|
||||
|
@ -470,7 +470,7 @@ public:
|
|||
result.AppendError(error.AsCString("Error creating empty target"));
|
||||
return false;
|
||||
}
|
||||
interpreter.GetDebugger().GetTargetList().SetCurrentTarget(target);
|
||||
interpreter.GetDebugger().GetTargetList().SetSelectedTarget(target);
|
||||
}
|
||||
|
||||
// Record the old executable module, we want to issue a warning if the process of attaching changed the
|
||||
|
|
|
@ -267,7 +267,7 @@ public:
|
|||
if (!m_options.symbol_name.empty())
|
||||
{
|
||||
// Displaying the source for a symbol:
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
@ -441,7 +441,7 @@ public:
|
|||
else
|
||||
{
|
||||
const char *filename = m_options.file_name.c_str();
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target == NULL)
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target)
|
||||
{
|
||||
uint32_t argc = command.GetArgumentCount();
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target)
|
||||
{
|
||||
bool notify = true;
|
||||
|
@ -148,7 +148,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target)
|
||||
{
|
||||
uint32_t argc = command.GetArgumentCount();
|
||||
|
@ -231,7 +231,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target)
|
||||
{
|
||||
if (command.GetArgumentCount() != 0)
|
||||
|
@ -272,7 +272,7 @@ public:
|
|||
Args& command,
|
||||
CommandReturnObject &result)
|
||||
{
|
||||
Target *target = interpreter.GetDebugger().GetCurrentTarget().get();
|
||||
Target *target = interpreter.GetDebugger().GetSelectedTarget().get();
|
||||
if (target)
|
||||
{
|
||||
if (command.GetArgumentCount() != 1)
|
||||
|
@ -337,8 +337,8 @@ public:
|
|||
// const uint32_t frame_idx = Args::StringToUInt32 (frame_idx_cstr, UINT32_MAX, 0);
|
||||
// if (frame_idx < num_frames)
|
||||
// {
|
||||
// exe_ctx.thread->SetCurrentFrameByIndex (frame_idx);
|
||||
// exe_ctx.frame = exe_ctx.thread->GetCurrentFrame ().get();
|
||||
// exe_ctx.thread->SetSelectedFrameByIndex (frame_idx);
|
||||
// exe_ctx.frame = exe_ctx.thread->GetSelectedFrame ().get();
|
||||
//
|
||||
// if (exe_ctx.frame)
|
||||
// {
|
||||
|
|
|
@ -55,7 +55,7 @@ lldb_private::DisplayThreadInfo
|
|||
}
|
||||
|
||||
strm.Indent();
|
||||
strm.Printf("%c ", thread->GetProcess().GetThreadList().GetCurrentThread().get() == thread ? '*' : ' ');
|
||||
strm.Printf("%c ", thread->GetProcess().GetThreadList().GetSelectedThread().get() == thread ? '*' : ' ');
|
||||
|
||||
// Show one frame with only the first showing source
|
||||
if (show_source)
|
||||
|
@ -465,7 +465,7 @@ public:
|
|||
|
||||
if (command.GetArgumentCount() == 0)
|
||||
{
|
||||
thread = process->GetThreadList().GetCurrentThread().get();
|
||||
thread = process->GetThreadList().GetSelectedThread().get();
|
||||
if (thread == NULL)
|
||||
{
|
||||
result.AppendError ("no current thread in process");
|
||||
|
@ -525,7 +525,7 @@ public:
|
|||
else
|
||||
new_plan = thread->QueueThreadPlanForStepSingleInstruction (false, abort_other_plans, bool_stop_other_threads);
|
||||
|
||||
process->GetThreadList().SetCurrentThreadByID (thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
process->Resume ();
|
||||
}
|
||||
else if (m_step_type == eStepTypeOver)
|
||||
|
@ -549,19 +549,19 @@ public:
|
|||
// Maybe there should be a parameter to control this.
|
||||
new_plan->SetOkayToDiscard(false);
|
||||
|
||||
process->GetThreadList().SetCurrentThreadByID (thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
process->Resume ();
|
||||
}
|
||||
else if (m_step_type == eStepTypeTrace)
|
||||
{
|
||||
thread->QueueThreadPlanForStepSingleInstruction (false, abort_other_plans, bool_stop_other_threads);
|
||||
process->GetThreadList().SetCurrentThreadByID (thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
process->Resume ();
|
||||
}
|
||||
else if (m_step_type == eStepTypeTraceOver)
|
||||
{
|
||||
thread->QueueThreadPlanForStepSingleInstruction (true, abort_other_plans, bool_stop_other_threads);
|
||||
process->GetThreadList().SetCurrentThreadByID (thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
process->Resume ();
|
||||
}
|
||||
else if (m_step_type == eStepTypeOut)
|
||||
|
@ -573,7 +573,7 @@ public:
|
|||
// Maybe there should be a parameter to control this.
|
||||
new_plan->SetOkayToDiscard(false);
|
||||
|
||||
process->GetThreadList().SetCurrentThreadByID (thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
process->Resume ();
|
||||
}
|
||||
else
|
||||
|
@ -591,7 +591,7 @@ public:
|
|||
// {
|
||||
// state = process->WaitForStateChangedEvents (NULL, event_sp);
|
||||
// }
|
||||
process->GetThreadList().SetCurrentThreadByID (thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID (thread->GetID());
|
||||
result.SetDidChangeProcessState (true);
|
||||
result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state));
|
||||
result.SetStatus (eReturnStatusSuccessFinishNoResult);
|
||||
|
@ -665,7 +665,7 @@ public:
|
|||
{
|
||||
bool synchronous_execution = interpreter.GetSynchronous ();
|
||||
|
||||
if (!interpreter.GetDebugger().GetCurrentTarget().get())
|
||||
if (!interpreter.GetDebugger().GetSelectedTarget().get())
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
result.SetStatus (eReturnStatusFailed);
|
||||
|
@ -725,7 +725,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
Thread *current_thread = process->GetThreadList().GetCurrentThread().get();
|
||||
Thread *current_thread = process->GetThreadList().GetSelectedThread().get();
|
||||
if (current_thread == NULL)
|
||||
{
|
||||
result.AppendError ("the process doesn't have a current thread");
|
||||
|
@ -917,7 +917,7 @@ public:
|
|||
{
|
||||
bool synchronous_execution = interpreter.GetSynchronous ();
|
||||
|
||||
if (!interpreter.GetDebugger().GetCurrentTarget().get())
|
||||
if (!interpreter.GetDebugger().GetSelectedTarget().get())
|
||||
{
|
||||
result.AppendError ("invalid target, set executable file using 'file' command");
|
||||
result.SetStatus (eReturnStatusFailed);
|
||||
|
@ -953,7 +953,7 @@ public:
|
|||
|
||||
if (m_options.m_thread_idx == LLDB_INVALID_THREAD_ID)
|
||||
{
|
||||
thread = process->GetThreadList().GetCurrentThread().get();
|
||||
thread = process->GetThreadList().GetSelectedThread().get();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1033,7 +1033,7 @@ public:
|
|||
|
||||
}
|
||||
|
||||
process->GetThreadList().SetCurrentThreadByID (m_options.m_thread_idx);
|
||||
process->GetThreadList().SetSelectedThreadByID (m_options.m_thread_idx);
|
||||
Error error (process->Resume ());
|
||||
if (error.Success())
|
||||
{
|
||||
|
@ -1129,7 +1129,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
process->GetThreadList().SetCurrentThreadByID(new_thread->GetID());
|
||||
process->GetThreadList().SetSelectedThreadByID(new_thread->GetID());
|
||||
|
||||
DisplayThreadInfo (interpreter,
|
||||
result.GetOutputStream(),
|
||||
|
|
|
@ -240,18 +240,18 @@ Debugger::GetListener ()
|
|||
|
||||
|
||||
TargetSP
|
||||
Debugger::GetCurrentTarget ()
|
||||
Debugger::GetSelectedTarget ()
|
||||
{
|
||||
return m_target_list.GetCurrentTarget ();
|
||||
return m_target_list.GetSelectedTarget ();
|
||||
}
|
||||
|
||||
ExecutionContext
|
||||
Debugger::GetCurrentExecutionContext ()
|
||||
Debugger::GetSelectedExecutionContext ()
|
||||
{
|
||||
ExecutionContext exe_ctx;
|
||||
exe_ctx.Clear();
|
||||
|
||||
lldb::TargetSP target_sp = GetCurrentTarget();
|
||||
lldb::TargetSP target_sp = GetSelectedTarget();
|
||||
exe_ctx.target = target_sp.get();
|
||||
|
||||
if (target_sp)
|
||||
|
@ -259,12 +259,12 @@ Debugger::GetCurrentExecutionContext ()
|
|||
exe_ctx.process = target_sp->GetProcessSP().get();
|
||||
if (exe_ctx.process && exe_ctx.process->IsRunning() == false)
|
||||
{
|
||||
exe_ctx.thread = exe_ctx.process->GetThreadList().GetCurrentThread().get();
|
||||
exe_ctx.thread = exe_ctx.process->GetThreadList().GetSelectedThread().get();
|
||||
if (exe_ctx.thread == NULL)
|
||||
exe_ctx.thread = exe_ctx.process->GetThreadList().GetThreadAtIndex(0).get();
|
||||
if (exe_ctx.thread)
|
||||
{
|
||||
exe_ctx.frame = exe_ctx.thread->GetCurrentFrame().get();
|
||||
exe_ctx.frame = exe_ctx.thread->GetSelectedFrame().get();
|
||||
if (exe_ctx.frame == NULL)
|
||||
exe_ctx.frame = exe_ctx.thread->GetStackFrameAtIndex (0).get();
|
||||
}
|
||||
|
@ -301,7 +301,7 @@ Debugger::DispatchInput (const char *bytes, size_t bytes_len)
|
|||
return;
|
||||
|
||||
// TODO: implement the STDIO to the process as an input reader...
|
||||
TargetSP target = GetCurrentTarget();
|
||||
TargetSP target = GetSelectedTarget();
|
||||
if (target.get() != NULL)
|
||||
{
|
||||
ProcessSP process_sp = target->GetProcessSP();
|
||||
|
@ -473,19 +473,19 @@ Debugger::UpdateExecutionContext (ExecutionContext *override_context)
|
|||
}
|
||||
else
|
||||
{
|
||||
TargetSP target_sp (GetCurrentTarget());
|
||||
TargetSP target_sp (GetSelectedTarget());
|
||||
if (target_sp)
|
||||
{
|
||||
m_exe_ctx.target = target_sp.get();
|
||||
m_exe_ctx.process = target_sp->GetProcessSP().get();
|
||||
if (m_exe_ctx.process && m_exe_ctx.process->IsRunning() == false)
|
||||
{
|
||||
m_exe_ctx.thread = m_exe_ctx.process->GetThreadList().GetCurrentThread().get();
|
||||
m_exe_ctx.thread = m_exe_ctx.process->GetThreadList().GetSelectedThread().get();
|
||||
if (m_exe_ctx.thread == NULL)
|
||||
m_exe_ctx.thread = m_exe_ctx.process->GetThreadList().GetThreadAtIndex(0).get();
|
||||
if (m_exe_ctx.thread)
|
||||
{
|
||||
m_exe_ctx.frame = m_exe_ctx.thread->GetCurrentFrame().get();
|
||||
m_exe_ctx.frame = m_exe_ctx.thread->GetSelectedFrame().get();
|
||||
if (m_exe_ctx.frame == NULL)
|
||||
m_exe_ctx.frame = m_exe_ctx.thread->GetStackFrameAtIndex (0).get();
|
||||
}
|
||||
|
|
|
@ -746,7 +746,7 @@ Options::HandleOptionArgumentCompletion
|
|||
if (module_name)
|
||||
{
|
||||
FileSpec module_spec(module_name);
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetCurrentTarget();
|
||||
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
|
||||
// Search filters require a target...
|
||||
if (target_sp != NULL)
|
||||
filter_ap.reset (new SearchFilterByModule (target_sp, module_spec));
|
||||
|
|
|
@ -338,7 +338,7 @@ while ($pid)
|
|||
}
|
||||
elsif ( $pid_state == $lldb::eStateStopped )
|
||||
{
|
||||
my $tid = lldb::PDProcessGetCurrentThread ( $pid );
|
||||
my $tid = lldb::PDProcessGetSelectedThread ( $pid );
|
||||
my $pc = lldb::PDThreadGetRegisterHexValueByName($pid, $tid, $lldb::PD_REGISTER_SET_ALL, "eip", 0);
|
||||
$pc != 0 and printf("pc = 0x%8.8x ", $pc);
|
||||
# my $sp = lldb::PDThreadGetRegisterHexValueByName($pid, $tid, $lldb::PD_REGISTER_SET_ALL, "esp", 0);
|
||||
|
|
|
@ -41,9 +41,9 @@ ExecutionContext::ExecutionContext (Target* t, bool fill_current_process_thread_
|
|||
process = t->GetProcessSP().get();
|
||||
if (process)
|
||||
{
|
||||
thread = process->GetThreadList().GetCurrentThread().get();
|
||||
thread = process->GetThreadList().GetSelectedThread().get();
|
||||
if (thread)
|
||||
frame = thread->GetCurrentFrame().get();
|
||||
frame = thread->GetSelectedFrame().get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ StackFrameList::StackFrameList(Thread &thread, StackFrameList *prev_frames, bool
|
|||
m_mutex (Mutex::eMutexTypeRecursive),
|
||||
m_unwind_frames (),
|
||||
m_inline_frames (),
|
||||
m_current_frame_idx (0)
|
||||
m_selected_frame_idx (0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -306,15 +306,15 @@ StackFrameList::SetInlineFrameAtIndex (uint32_t idx, StackFrameSP &frame_sp)
|
|||
}
|
||||
|
||||
uint32_t
|
||||
StackFrameList::GetCurrentFrameIndex () const
|
||||
StackFrameList::GetSelectedFrameIndex () const
|
||||
{
|
||||
Mutex::Locker locker (m_mutex);
|
||||
return m_current_frame_idx;
|
||||
return m_selected_frame_idx;
|
||||
}
|
||||
|
||||
|
||||
uint32_t
|
||||
StackFrameList::SetCurrentFrame (lldb_private::StackFrame *frame)
|
||||
StackFrameList::SetSelectedFrame (lldb_private::StackFrame *frame)
|
||||
{
|
||||
Mutex::Locker locker (m_mutex);
|
||||
const_iterator pos;
|
||||
|
@ -324,20 +324,20 @@ StackFrameList::SetCurrentFrame (lldb_private::StackFrame *frame)
|
|||
{
|
||||
if (pos->get() == frame)
|
||||
{
|
||||
m_current_frame_idx = std::distance (begin, pos);
|
||||
return m_current_frame_idx;
|
||||
m_selected_frame_idx = std::distance (begin, pos);
|
||||
return m_selected_frame_idx;
|
||||
}
|
||||
}
|
||||
m_current_frame_idx = 0;
|
||||
return m_current_frame_idx;
|
||||
m_selected_frame_idx = 0;
|
||||
return m_selected_frame_idx;
|
||||
}
|
||||
|
||||
// Mark a stack frame as the current frame using the frame index
|
||||
void
|
||||
StackFrameList::SetCurrentFrameByIndex (uint32_t idx)
|
||||
StackFrameList::SetSelectedFrameByIndex (uint32_t idx)
|
||||
{
|
||||
Mutex::Locker locker (m_mutex);
|
||||
m_current_frame_idx = idx;
|
||||
m_selected_frame_idx = idx;
|
||||
}
|
||||
|
||||
// The thread has been run, reset the number stack frames to zero so we can
|
||||
|
|
|
@ -30,7 +30,7 @@ TargetList::TargetList() :
|
|||
Broadcaster("TargetList"),
|
||||
m_target_list(),
|
||||
m_target_list_mutex (Mutex::eMutexTypeRecursive),
|
||||
m_current_target_idx (0)
|
||||
m_selected_target_idx (0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ TargetList::CreateTarget
|
|||
if (target_sp.get())
|
||||
{
|
||||
Mutex::Locker locker(m_target_list_mutex);
|
||||
m_current_target_idx = m_target_list.size();
|
||||
m_selected_target_idx = m_target_list.size();
|
||||
m_target_list.push_back(target_sp);
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ TargetList::CreateTarget
|
|||
// {
|
||||
// error.Clear();
|
||||
// Mutex::Locker locker(m_target_list_mutex);
|
||||
// m_current_target_idx = m_target_list.size();
|
||||
// m_selected_target_idx = m_target_list.size();
|
||||
// m_target_list.push_back(target_sp);
|
||||
// }
|
||||
// }
|
||||
|
@ -334,7 +334,7 @@ TargetList::GetTargetAtIndex (uint32_t idx) const
|
|||
}
|
||||
|
||||
uint32_t
|
||||
TargetList::SetCurrentTarget (Target* target)
|
||||
TargetList::SetSelectedTarget (Target* target)
|
||||
{
|
||||
Mutex::Locker locker (m_target_list_mutex);
|
||||
collection::const_iterator pos,
|
||||
|
@ -344,19 +344,19 @@ TargetList::SetCurrentTarget (Target* target)
|
|||
{
|
||||
if (pos->get() == target)
|
||||
{
|
||||
m_current_target_idx = std::distance (begin, pos);
|
||||
return m_current_target_idx;
|
||||
m_selected_target_idx = std::distance (begin, pos);
|
||||
return m_selected_target_idx;
|
||||
}
|
||||
}
|
||||
m_current_target_idx = 0;
|
||||
return m_current_target_idx;
|
||||
m_selected_target_idx = 0;
|
||||
return m_selected_target_idx;
|
||||
}
|
||||
|
||||
lldb::TargetSP
|
||||
TargetList::GetCurrentTarget ()
|
||||
TargetList::GetSelectedTarget ()
|
||||
{
|
||||
Mutex::Locker locker (m_target_list_mutex);
|
||||
if (m_current_target_idx >= m_target_list.size())
|
||||
m_current_target_idx = 0;
|
||||
return GetTargetAtIndex (m_current_target_idx);
|
||||
if (m_selected_target_idx >= m_target_list.size())
|
||||
m_selected_target_idx = 0;
|
||||
return GetTargetAtIndex (m_selected_target_idx);
|
||||
}
|
||||
|
|
|
@ -823,21 +823,21 @@ Thread::GetStackFrameAtIndex (uint32_t idx)
|
|||
}
|
||||
|
||||
lldb::StackFrameSP
|
||||
Thread::GetCurrentFrame ()
|
||||
Thread::GetSelectedFrame ()
|
||||
{
|
||||
return GetStackFrameAtIndex (GetStackFrameList().GetCurrentFrameIndex());
|
||||
return GetStackFrameAtIndex (GetStackFrameList().GetSelectedFrameIndex());
|
||||
}
|
||||
|
||||
uint32_t
|
||||
Thread::SetCurrentFrame (lldb_private::StackFrame *frame)
|
||||
Thread::SetSelectedFrame (lldb_private::StackFrame *frame)
|
||||
{
|
||||
return GetStackFrameList().SetCurrentFrame(frame);
|
||||
return GetStackFrameList().SetSelectedFrame(frame);
|
||||
}
|
||||
|
||||
void
|
||||
Thread::SetCurrentFrameByIndex (uint32_t idx)
|
||||
Thread::SetSelectedFrameByIndex (uint32_t idx)
|
||||
{
|
||||
GetStackFrameList().SetCurrentFrameByIndex(idx);
|
||||
GetStackFrameList().SetSelectedFrameByIndex(idx);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -23,7 +23,7 @@ ThreadList::ThreadList (Process *process) :
|
|||
m_stop_id (0),
|
||||
m_threads(),
|
||||
m_threads_mutex (Mutex::eMutexTypeRecursive),
|
||||
m_current_tid (LLDB_INVALID_THREAD_ID)
|
||||
m_selected_tid (LLDB_INVALID_THREAD_ID)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ ThreadList::ThreadList (const ThreadList &rhs) :
|
|||
m_stop_id (),
|
||||
m_threads (),
|
||||
m_threads_mutex (Mutex::eMutexTypeRecursive),
|
||||
m_current_tid ()
|
||||
m_selected_tid ()
|
||||
{
|
||||
// Use the assignment operator since it uses the mutex
|
||||
*this = rhs;
|
||||
|
@ -50,7 +50,7 @@ ThreadList::operator = (const ThreadList& rhs)
|
|||
m_process = rhs.m_process;
|
||||
m_stop_id = rhs.m_stop_id;
|
||||
m_threads = rhs.m_threads;
|
||||
m_current_tid = rhs.m_current_tid;
|
||||
m_selected_tid = rhs.m_selected_tid;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ ThreadList::Clear()
|
|||
{
|
||||
m_stop_id = 0;
|
||||
m_threads.clear();
|
||||
m_current_tid = LLDB_INVALID_THREAD_ID;
|
||||
m_selected_tid = LLDB_INVALID_THREAD_ID;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -376,7 +376,7 @@ ThreadList::WillResume ()
|
|||
// You can't say "stop others" and also want yourself to be suspended.
|
||||
assert (thread_sp->GetCurrentPlan()->RunState() != eStateSuspended);
|
||||
|
||||
if (thread_sp == GetCurrentThread())
|
||||
if (thread_sp == GetSelectedThread())
|
||||
{
|
||||
run_only_current_thread = true;
|
||||
run_me_only_list.Clear();
|
||||
|
@ -415,7 +415,7 @@ ThreadList::WillResume ()
|
|||
|
||||
if (run_only_current_thread)
|
||||
{
|
||||
thread_to_run = GetCurrentThread();
|
||||
thread_to_run = GetSelectedThread();
|
||||
}
|
||||
else if (run_me_only_list.GetSize (false) == 1)
|
||||
{
|
||||
|
@ -456,34 +456,34 @@ ThreadList::DidResume ()
|
|||
}
|
||||
|
||||
ThreadSP
|
||||
ThreadList::GetCurrentThread ()
|
||||
ThreadList::GetSelectedThread ()
|
||||
{
|
||||
Mutex::Locker locker(m_threads_mutex);
|
||||
return FindThreadByID(m_current_tid);
|
||||
return FindThreadByID(m_selected_tid);
|
||||
}
|
||||
|
||||
bool
|
||||
ThreadList::SetCurrentThreadByID (lldb::tid_t tid)
|
||||
ThreadList::SetSelectedThreadByID (lldb::tid_t tid)
|
||||
{
|
||||
Mutex::Locker locker(m_threads_mutex);
|
||||
if (FindThreadByID(tid).get())
|
||||
m_current_tid = tid;
|
||||
m_selected_tid = tid;
|
||||
else
|
||||
m_current_tid = LLDB_INVALID_THREAD_ID;
|
||||
m_selected_tid = LLDB_INVALID_THREAD_ID;
|
||||
|
||||
return m_current_tid != LLDB_INVALID_THREAD_ID;
|
||||
return m_selected_tid != LLDB_INVALID_THREAD_ID;
|
||||
}
|
||||
|
||||
bool
|
||||
ThreadList::SetCurrentThreadByIndexID (uint32_t index_id)
|
||||
ThreadList::SetSelectedThreadByIndexID (uint32_t index_id)
|
||||
{
|
||||
Mutex::Locker locker(m_threads_mutex);
|
||||
ThreadSP thread_sp (FindThreadByIndexID(index_id));
|
||||
if (thread_sp.get())
|
||||
m_current_tid = thread_sp->GetID();
|
||||
m_selected_tid = thread_sp->GetID();
|
||||
else
|
||||
m_current_tid = LLDB_INVALID_THREAD_ID;
|
||||
m_selected_tid = LLDB_INVALID_THREAD_ID;
|
||||
|
||||
return m_current_tid != LLDB_INVALID_THREAD_ID;
|
||||
return m_selected_tid != LLDB_INVALID_THREAD_ID;
|
||||
}
|
||||
|
||||
|
|
|
@ -603,7 +603,7 @@ Driver::GetProcessSTDOUT ()
|
|||
// The process has stuff waiting for stdout; get it and write it out to the appropriate place.
|
||||
char stdio_buffer[1024];
|
||||
size_t len;
|
||||
while ((len = m_debugger.GetCurrentTarget().GetProcess().GetSTDOUT (stdio_buffer, sizeof (stdio_buffer))) > 0)
|
||||
while ((len = m_debugger.GetSelectedTarget().GetProcess().GetSTDOUT (stdio_buffer, sizeof (stdio_buffer))) > 0)
|
||||
m_io_channel_ap->OutWrite (stdio_buffer, len);
|
||||
}
|
||||
|
||||
|
@ -613,18 +613,18 @@ Driver::GetProcessSTDERR ()
|
|||
// The process has stuff waiting for stderr; get it and write it out to the appropriate place.
|
||||
char stdio_buffer[1024];
|
||||
size_t len;
|
||||
while ((len = m_debugger.GetCurrentTarget().GetProcess().GetSTDERR (stdio_buffer, sizeof (stdio_buffer))) > 0)
|
||||
while ((len = m_debugger.GetSelectedTarget().GetProcess().GetSTDERR (stdio_buffer, sizeof (stdio_buffer))) > 0)
|
||||
m_io_channel_ap->ErrWrite (stdio_buffer, len);
|
||||
}
|
||||
|
||||
void
|
||||
Driver::UpdateCurrentThread ()
|
||||
Driver::UpdateSelectedThread ()
|
||||
{
|
||||
using namespace lldb;
|
||||
SBProcess process(m_debugger.GetCurrentTarget().GetProcess());
|
||||
SBProcess process(m_debugger.GetSelectedTarget().GetProcess());
|
||||
if (process.IsValid())
|
||||
{
|
||||
SBThread curr_thread (process.GetCurrentThread());
|
||||
SBThread curr_thread (process.GetSelectedThread());
|
||||
SBThread thread;
|
||||
StopReason curr_thread_stop_reason = eStopReasonInvalid;
|
||||
curr_thread_stop_reason = curr_thread.GetStopReason();
|
||||
|
@ -664,9 +664,9 @@ Driver::UpdateCurrentThread ()
|
|||
}
|
||||
}
|
||||
if (plan_thread.IsValid())
|
||||
process.SetCurrentThread (plan_thread);
|
||||
process.SetSelectedThread (plan_thread);
|
||||
else if (other_thread.IsValid())
|
||||
process.SetCurrentThread (other_thread);
|
||||
process.SetSelectedThread (other_thread);
|
||||
else
|
||||
{
|
||||
if (curr_thread.IsValid())
|
||||
|
@ -675,7 +675,7 @@ Driver::UpdateCurrentThread ()
|
|||
thread = process.GetThreadAtIndex(0);
|
||||
|
||||
if (thread.IsValid())
|
||||
process.SetCurrentThread (thread);
|
||||
process.SetSelectedThread (thread);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -756,7 +756,7 @@ Driver::HandleProcessEvent (const SBEvent &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
UpdateCurrentThread ();
|
||||
UpdateSelectedThread ();
|
||||
m_debugger.HandleCommand("process status");
|
||||
m_io_channel_ap->RefreshPrompt();
|
||||
}
|
||||
|
@ -1201,7 +1201,7 @@ Driver::MainLoop ()
|
|||
else
|
||||
done = HandleIOEvent (event);
|
||||
}
|
||||
else if (event.BroadcasterMatchesRef (m_debugger.GetCurrentTarget().GetProcess().GetBroadcaster()))
|
||||
else if (event.BroadcasterMatchesRef (m_debugger.GetSelectedTarget().GetProcess().GetBroadcaster()))
|
||||
{
|
||||
HandleProcessEvent (event);
|
||||
}
|
||||
|
@ -1231,7 +1231,7 @@ Driver::MainLoop ()
|
|||
}
|
||||
}
|
||||
|
||||
SBProcess process = m_debugger.GetCurrentTarget().GetProcess();
|
||||
SBProcess process = m_debugger.GetSelectedTarget().GetProcess();
|
||||
if (process.IsValid())
|
||||
process.Destroy();
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ private:
|
|||
GetProcessSTDERR ();
|
||||
|
||||
void
|
||||
UpdateCurrentThread ();
|
||||
UpdateSelectedThread ();
|
||||
|
||||
void
|
||||
CloseIOChannelFile ();
|
||||
|
|
Loading…
Reference in New Issue