Exemplo n.º 1
0
void
SBThread::StepOutOfFrame (lldb::SBFrame &sb_frame)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    Mutex::Locker api_locker;
    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);

    StackFrameSP frame_sp (sb_frame.GetFrameSP());
    if (log)
    {
        SBStream frame_desc_strm;
        sb_frame.GetDescription (frame_desc_strm);
        log->Printf ("SBThread(%p)::StepOutOfFrame (frame = SBFrame(%p): %s)", exe_ctx.GetThreadPtr(), frame_sp.get(), frame_desc_strm.GetData());
    }

    if (exe_ctx.HasThreadScope())
    {
        bool abort_other_plans = false;
        bool stop_other_threads = false;
        Thread *thread = exe_ctx.GetThreadPtr();

        ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut (abort_other_plans,
                                                                    NULL, 
                                                                    false, 
                                                                    stop_other_threads, 
                                                                    eVoteYes, 
                                                                    eVoteNoOpinion,
                                                                    frame_sp->GetFrameIndex()));
                                                                    
        // This returns an error, we should use it!
        ResumeNewPlan (exe_ctx, new_plan_sp.get());
    }
}
Exemplo n.º 2
0
void
SBThread::StepOut ()
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    Mutex::Locker api_locker;
    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);


    if (log)
        log->Printf ("SBThread(%p)::StepOut ()", exe_ctx.GetThreadPtr());
    
    if (exe_ctx.HasThreadScope())
    {
        bool abort_other_plans = false;
        bool stop_other_threads = false;

        Thread *thread = exe_ctx.GetThreadPtr();

        ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut (abort_other_plans,
                                                                  NULL, 
                                                                  false, 
                                                                  stop_other_threads, 
                                                                  eVoteYes, 
                                                                  eVoteNoOpinion,
                                                                  0));
                                                                  
        // This returns an error, we should use it!
        ResumeNewPlan (exe_ctx, new_plan_sp.get());
    }
}
Exemplo n.º 3
0
void SBThread::StepOut() {
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));

  std::unique_lock<std::recursive_mutex> lock;
  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);

  if (log)
    log->Printf("SBThread(%p)::StepOut ()",
                static_cast<void *>(exe_ctx.GetThreadPtr()));

  if (exe_ctx.HasThreadScope()) {
    bool abort_other_plans = false;
    bool stop_other_threads = false;

    Thread *thread = exe_ctx.GetThreadPtr();

    const LazyBool avoid_no_debug = eLazyBoolCalculate;
    ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
        abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
        eVoteNoOpinion, 0, avoid_no_debug));

    // This returns an error, we should use it!
    ResumeNewPlan(exe_ctx, new_plan_sp.get());
  }
}
Exemplo n.º 4
0
void SBThread::StepOutOfFrame(lldb::SBFrame &sb_frame) {
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));

  std::unique_lock<std::recursive_mutex> lock;
  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);

  if (!sb_frame.IsValid()) {
    if (log)
      log->Printf(
          "SBThread(%p)::StepOutOfFrame passed an invalid frame, returning.",
          static_cast<void *>(exe_ctx.GetThreadPtr()));
    return;
  }

  StackFrameSP frame_sp(sb_frame.GetFrameSP());
  if (log) {
    SBStream frame_desc_strm;
    sb_frame.GetDescription(frame_desc_strm);
    log->Printf("SBThread(%p)::StepOutOfFrame (frame = SBFrame(%p): %s)",
                static_cast<void *>(exe_ctx.GetThreadPtr()),
                static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
  }

  if (exe_ctx.HasThreadScope()) {
    bool abort_other_plans = false;
    bool stop_other_threads = false;
    Thread *thread = exe_ctx.GetThreadPtr();
    if (sb_frame.GetThread().GetThreadID() != thread->GetID()) {
      log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another "
                  "thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
                  static_cast<void *>(exe_ctx.GetThreadPtr()),
                  sb_frame.GetThread().GetThreadID(), thread->GetID());
    }

    ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
        abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
        eVoteNoOpinion, frame_sp->GetFrameIndex()));

    // This returns an error, we should use it!
    ResumeNewPlan(exe_ctx, new_plan_sp.get());
  }
}