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


C++ SystemRuntime类代码示例

本文整理汇总了C++中SystemRuntime的典型用法代码示例。如果您正苦于以下问题:C++ SystemRuntime类的具体用法?C++ SystemRuntime怎么用?C++ SystemRuntime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: exe_ctx

SBThread
SBThread::GetExtendedBacktrace (const char *type)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    Mutex::Locker api_locker;
    ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
    SBThread sb_origin_thread;

    if (exe_ctx.HasThreadScope())
    {
        Process::StopLocker stop_locker;
        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
        {
            ThreadSP real_thread(exe_ctx.GetThreadPtr());
            if (real_thread)
            {
                ConstString type_const (type);
                SystemRuntime *runtime = exe_ctx.GetProcessPtr()->GetSystemRuntime();
                if (runtime)
                {
                    ThreadSP origin_thread = runtime->GetExtendedBacktrace (real_thread, type_const);
                    sb_origin_thread.SetThread (origin_thread);
                }
            }
        }
        else
        {
            if (log)
                log->Printf ("SBThread(%p)::GetExtendedBacktrace() => error: process is running", exe_ctx.GetThreadPtr());
        }
    }

    return sb_origin_thread;
}
开发者ID:nrgmilk,项目名称:freebsd,代码行数:34,代码来源:SBThread.cpp

示例2: process_sp

const char *ThreadGDBRemote::GetQueueName() {
  // If our cached queue info is valid, then someone called
  // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned
  // from the stop reply packet. In this case we trust that the info is valid
  // in m_dispatch_queue_name without refetching it
  if (CachedQueueInfoIsValid()) {
    if (m_dispatch_queue_name.empty())
      return nullptr;
    else
      return m_dispatch_queue_name.c_str();
  }
  // Always re-fetch the dispatch queue name since it can change

  if (m_associated_with_libdispatch_queue == eLazyBoolNo)
    return nullptr;

  if (m_thread_dispatch_qaddr != 0 &&
      m_thread_dispatch_qaddr != LLDB_INVALID_ADDRESS) {
    ProcessSP process_sp(GetProcess());
    if (process_sp) {
      SystemRuntime *runtime = process_sp->GetSystemRuntime();
      if (runtime)
        m_dispatch_queue_name =
            runtime->GetQueueNameFromThreadQAddress(m_thread_dispatch_qaddr);
      else
        m_dispatch_queue_name.clear();

      if (!m_dispatch_queue_name.empty())
        return m_dispatch_queue_name.c_str();
    }
  }
  return nullptr;
}
开发者ID:llvm-project,项目名称:lldb,代码行数:33,代码来源:ThreadGDBRemote.cpp

示例3: process_sp

QueueKind ThreadGDBRemote::GetQueueKind() {
  // If our cached queue info is valid, then someone called
  // ThreadGDBRemote::SetQueueInfo(...)
  // with valid information that was gleaned from the stop reply packet. In this
  // case we trust
  // that the info is valid in m_dispatch_queue_name without refetching it
  if (CachedQueueInfoIsValid()) {
    return m_queue_kind;
  }

  if (m_associated_with_libdispatch_queue == eLazyBoolNo)
    return eQueueKindUnknown;

  if (m_thread_dispatch_qaddr != 0 &&
      m_thread_dispatch_qaddr != LLDB_INVALID_ADDRESS) {
    ProcessSP process_sp(GetProcess());
    if (process_sp) {
      SystemRuntime *runtime = process_sp->GetSystemRuntime();
      if (runtime)
        m_queue_kind = runtime->GetQueueKind(m_thread_dispatch_qaddr);
      return m_queue_kind;
    }
  }
  return eQueueKindUnknown;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:25,代码来源:ThreadGDBRemote.cpp

示例4: process_sp

uint32_t
SBProcess::GetNumExtendedBacktraceTypes ()
{
    ProcessSP process_sp(GetSP());
    if (process_sp && process_sp->GetSystemRuntime())
    {
        SystemRuntime *runtime = process_sp->GetSystemRuntime();
        return runtime->GetExtendedBacktraceTypes().size();
    }
    return 0;
}
开发者ID:ATeamMac2014,项目名称:lldb,代码行数:11,代码来源:SBProcess.cpp

示例5: exe_ctx

SBThread SBThread::GetExtendedBacktraceThread(const char *type) {
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
  std::unique_lock<std::recursive_mutex> lock;
  ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
  SBThread sb_origin_thread;

  if (exe_ctx.HasThreadScope()) {
    Process::StopLocker stop_locker;
    if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock())) {
      ThreadSP real_thread(exe_ctx.GetThreadSP());
      if (real_thread) {
        ConstString type_const(type);
        Process *process = exe_ctx.GetProcessPtr();
        if (process) {
          SystemRuntime *runtime = process->GetSystemRuntime();
          if (runtime) {
            ThreadSP new_thread_sp(
                runtime->GetExtendedBacktraceThread(real_thread, type_const));
            if (new_thread_sp) {
              // Save this in the Process' ExtendedThreadList so a strong
              // pointer retains the
              // object.
              process->GetExtendedThreadList().AddThread(new_thread_sp);
              sb_origin_thread.SetThread(new_thread_sp);
              if (log) {
                const char *queue_name = new_thread_sp->GetQueueName();
                if (queue_name == NULL)
                  queue_name = "";
                log->Printf("SBThread(%p)::GetExtendedBacktraceThread() => new "
                            "extended Thread "
                            "created (%p) with queue_id 0x%" PRIx64
                            " queue name '%s'",
                            static_cast<void *>(exe_ctx.GetThreadPtr()),
                            static_cast<void *>(new_thread_sp.get()),
                            new_thread_sp->GetQueueID(), queue_name);
              }
            }
          }
        }
      }
    } else {
      if (log)
        log->Printf("SBThread(%p)::GetExtendedBacktraceThread() => error: "
                    "process is running",
                    static_cast<void *>(exe_ctx.GetThreadPtr()));
    }
  }

  if (log && sb_origin_thread.IsValid() == false)
    log->Printf("SBThread(%p)::GetExtendedBacktraceThread() is not returning a "
                "Valid thread",
                static_cast<void *>(exe_ctx.GetThreadPtr()));
  return sb_origin_thread;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:54,代码来源:SBThread.cpp

示例6: FetchEntireItem

void QueueItem::FetchEntireItem() {
  if (m_have_fetched_entire_item)
    return;
  ProcessSP process_sp = m_process_wp.lock();
  if (process_sp) {
    SystemRuntime *runtime = process_sp->GetSystemRuntime();
    if (runtime) {
      runtime->CompleteQueueItem(this, m_item_ref);
      m_have_fetched_entire_item = true;
    }
  }
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:12,代码来源:QueueItem.cpp

示例7: process_sp

queue_id_t
ThreadGDBRemote::GetQueueID ()
{
    if (m_thread_dispatch_qaddr != 0 || m_thread_dispatch_qaddr != LLDB_INVALID_ADDRESS)
    {
        ProcessSP process_sp (GetProcess());
        if (process_sp)
        {
            SystemRuntime *runtime = process_sp->GetSystemRuntime ();
            if (runtime)
            {
                return runtime->GetQueueIDFromThreadQAddress (m_thread_dispatch_qaddr);
            }
        }
    }
    return LLDB_INVALID_QUEUE_ID;
}
开发者ID:VanirLLVM,项目名称:toolchain_lldb,代码行数:17,代码来源:ThreadGDBRemote.cpp

示例8: process_sp

const char *
SBProcess::GetExtendedBacktraceTypeAtIndex (uint32_t idx)
{
    ProcessSP process_sp(GetSP());
    if (process_sp && process_sp->GetSystemRuntime())
    {
        SystemRuntime *runtime = process_sp->GetSystemRuntime();
        const std::vector<ConstString> &names = runtime->GetExtendedBacktraceTypes();
        if (idx < names.size())
        {
            return names[idx].AsCString();
        }
        else
        {
            Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
            if (log)
                log->Printf("SBProcess(%p)::GetExtendedBacktraceTypeAtIndex() => error: requested extended backtrace name out of bounds", process_sp.get());
        }
    }
    return NULL;
}
开发者ID:Galiro,项目名称:freebsd,代码行数:21,代码来源:SBProcess.cpp


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