当前位置: 首页>>代码示例>>C++>>正文


C++ Thread::QueueThreadPlanForStepSingleInstruction方法代码示例

本文整理汇总了C++中Thread::QueueThreadPlanForStepSingleInstruction方法的典型用法代码示例。如果您正苦于以下问题:C++ Thread::QueueThreadPlanForStepSingleInstruction方法的具体用法?C++ Thread::QueueThreadPlanForStepSingleInstruction怎么用?C++ Thread::QueueThreadPlanForStepSingleInstruction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Thread的用法示例。


在下文中一共展示了Thread::QueueThreadPlanForStepSingleInstruction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: StepOver

void SBThread::StepOver(lldb::RunMode stop_other_threads) {
  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)::StepOver (stop_other_threads='%s')",
                static_cast<void *>(exe_ctx.GetThreadPtr()),
                Thread::RunModeAsCString(stop_other_threads));

  if (exe_ctx.HasThreadScope()) {
    Thread *thread = exe_ctx.GetThreadPtr();
    bool abort_other_plans = false;
    StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));

    ThreadPlanSP new_plan_sp;
    if (frame_sp) {
      if (frame_sp->HasDebugInformation()) {
        const LazyBool avoid_no_debug = eLazyBoolCalculate;
        SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
        new_plan_sp = thread->QueueThreadPlanForStepOverRange(
            abort_other_plans, sc.line_entry, sc, stop_other_threads,
            avoid_no_debug);
      } else {
        new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
            true, abort_other_plans, stop_other_threads);
      }
    }

    // This returns an error, we should use it!
    ResumeNewPlan(exe_ctx, new_plan_sp.get());
  }
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:34,代码来源:SBThread.cpp

示例2: StepInto

void SBThread::StepInto(const char *target_name, uint32_t end_line,
                        SBError &error, lldb::RunMode stop_other_threads) {
  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)::StepInto (target_name='%s', stop_other_threads='%s')",
        static_cast<void *>(exe_ctx.GetThreadPtr()),
        target_name ? target_name : "<NULL>",
        Thread::RunModeAsCString(stop_other_threads));

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

    Thread *thread = exe_ctx.GetThreadPtr();
    StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
    ThreadPlanSP new_plan_sp;

    if (frame_sp && frame_sp->HasDebugInformation()) {
      SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
      AddressRange range;
      if (end_line == LLDB_INVALID_LINE_NUMBER)
        range = sc.line_entry.range;
      else {
        if (!sc.GetAddressRangeFromHereToEndLine(end_line, range, error.ref()))
          return;
      }

      const LazyBool step_out_avoids_code_without_debug_info =
          eLazyBoolCalculate;
      const LazyBool step_in_avoids_code_without_debug_info =
          eLazyBoolCalculate;
      new_plan_sp = thread->QueueThreadPlanForStepInRange(
          abort_other_plans, range, sc, target_name, stop_other_threads,
          step_in_avoids_code_without_debug_info,
          step_out_avoids_code_without_debug_info);
    } else {
      new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
          false, abort_other_plans, stop_other_threads);
    }

    error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
  }
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:47,代码来源:SBThread.cpp

示例3: exe_ctx

void
SBThread::StepInto (const char *target_name, lldb::RunMode stop_other_threads)
{
    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)::StepInto (target_name='%s', stop_other_threads='%s')",
                     exe_ctx.GetThreadPtr(),
                     target_name? target_name: "<NULL>",
                     Thread::RunModeAsCString (stop_other_threads));
    
    if (exe_ctx.HasThreadScope())
    {
        bool abort_other_plans = false;

        Thread *thread = exe_ctx.GetThreadPtr();
        StackFrameSP frame_sp(thread->GetStackFrameAtIndex (0));
        ThreadPlanSP new_plan_sp;

        if (frame_sp && frame_sp->HasDebugInformation ())
        {
            bool avoid_code_without_debug_info = true;
            SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
            new_plan_sp = thread->QueueThreadPlanForStepInRange (abort_other_plans,
                                                              sc.line_entry.range,
                                                              sc,
                                                              target_name,
                                                              stop_other_threads,
                                                              avoid_code_without_debug_info);
        }
        else
        {
            new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction (false,
                                                                        abort_other_plans, 
                                                                        stop_other_threads);
        }
        
        // This returns an error, we should use it!
        ResumeNewPlan (exe_ctx, new_plan_sp.get());
    }
}
开发者ID:nrgmilk,项目名称:freebsd,代码行数:44,代码来源:SBThread.cpp

示例4: StepInstruction

void SBThread::StepInstruction(bool step_over) {
  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)::StepInstruction (step_over=%i)",
                static_cast<void *>(exe_ctx.GetThreadPtr()), step_over);

  if (exe_ctx.HasThreadScope()) {
    Thread *thread = exe_ctx.GetThreadPtr();
    ThreadPlanSP new_plan_sp(
        thread->QueueThreadPlanForStepSingleInstruction(step_over, true, true));

    // This returns an error, we should use it!
    ResumeNewPlan(exe_ctx, new_plan_sp.get());
  }
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:19,代码来源:SBThread.cpp


注:本文中的Thread::QueueThreadPlanForStepSingleInstruction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。