• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ lldb::SBFileSpec类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: log

bool
SBModule::SetPlatformFileSpec (const lldb::SBFileSpec &platform_file)
{
    bool result = false;
    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    
    ModuleSP module_sp (GetSP ());
    if (module_sp)
    {
        module_sp->SetPlatformFileSpec(*platform_file);
        result = true;
    }
    
    if (log)
    {
        log->Printf ("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s%s%s)) => %i", 
                     module_sp.get(), 
                     platform_file.get(),
                     platform_file->GetDirectory().GetCString(),
                     platform_file->GetDirectory() ? "/" : "",
                     platform_file->GetFilename().GetCString(),
                     result);
    }
    return result;
}
开发者ID:carlokok,项目名称:lldb,代码行数:25,代码来源:SBModule.cpp


示例2: ref

void
SBLineEntry::SetFileSpec (lldb::SBFileSpec filespec)
{
    if (filespec.IsValid())
        ref().file = filespec.ref();
    else
        ref().file.Clear();
}
开发者ID:2asoft,项目名称:freebsd,代码行数:8,代码来源:SBLineEntry.cpp


示例3: LLDB_RECORD_METHOD

void SBLineEntry::SetFileSpec(lldb::SBFileSpec filespec) {
  LLDB_RECORD_METHOD(void, SBLineEntry, SetFileSpec, (lldb::SBFileSpec),
                     filespec);

  if (filespec.IsValid())
    ref().file = filespec.ref();
  else
    ref().file.Clear();
}
开发者ID:llvm-project,项目名称:lldb,代码行数:9,代码来源:SBLineEntry.cpp


示例4: SetRemoteInstallFileSpec

bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) {
  ModuleSP module_sp(GetSP());
  if (module_sp) {
    module_sp->SetRemoteInstallFileSpec(file.ref());
    return true;
  }
  return false;
}
开发者ID:krytarowski,项目名称:lldb,代码行数:8,代码来源:SBModule.cpp


示例5: SetPlatformFileSpec

bool SBModule::SetPlatformFileSpec(const lldb::SBFileSpec &platform_file) {
  bool result = false;
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));

  ModuleSP module_sp(GetSP());
  if (module_sp) {
    module_sp->SetPlatformFileSpec(*platform_file);
    result = true;
  }

  if (log)
    log->Printf("SBModule(%p)::SetPlatformFileSpec (SBFileSpec(%p (%s)) => %i",
                static_cast<void *>(module_sp.get()),
                static_cast<const void *>(platform_file.get()),
                platform_file->GetPath().c_str(), result);
  return result;
}
开发者ID:krytarowski,项目名称:lldb,代码行数:17,代码来源:SBModule.cpp


示例6: SBCommandReturnObject

void
SBCommandInterpreter::HandleCommandsFromFile (lldb::SBFileSpec &file,
                                              lldb::SBExecutionContext &override_context,
                                              lldb::SBCommandInterpreterRunOptions &options,
                                              lldb::SBCommandReturnObject result)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    if (log)
    {
        SBStream s;
        file.GetDescription (s);
        log->Printf ("SBCommandInterpreter(%p)::HandleCommandsFromFile (file=\"%s\", SBCommandReturnObject(%p))",
                     static_cast<void*>(m_opaque_ptr), s.GetData(),
                     static_cast<void*>(result.get()));
    }

    if (!IsValid())
    {
        result->AppendError ("SBCommandInterpreter is not valid.");
        result->SetStatus (eReturnStatusFailed);
        return;
    }

    if (!file.IsValid())
    {
        SBStream s;
        file.GetDescription (s);
        result->AppendErrorWithFormat ("File is not valid: %s.", s.GetData());
        result->SetStatus (eReturnStatusFailed);
    }

    FileSpec tmp_spec = file.ref();
    ExecutionContext ctx, *ctx_ptr;
    if (override_context.get())
    {
        ctx = override_context.get()->Lock(true);
        ctx_ptr = &ctx;
    }
    else
       ctx_ptr = nullptr;

    m_opaque_ptr->HandleCommandsFromFile (tmp_spec, ctx_ptr, options.ref(), result.ref());
}
开发者ID:cadets,项目名称:lldb,代码行数:44,代码来源:SBCommandInterpreter.cpp


示例7: JumpToLine

SBError SBThread::JumpToLine(lldb::SBFileSpec &file_spec, uint32_t line) {
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
  SBError sb_error;

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

  if (log)
    log->Printf("SBThread(%p)::JumpToLine (file+line = %s:%u)",
                static_cast<void *>(exe_ctx.GetThreadPtr()),
                file_spec->GetPath().c_str(), line);

  if (!exe_ctx.HasThreadScope()) {
    sb_error.SetErrorString("this SBThread object is invalid");
    return sb_error;
  }

  Thread *thread = exe_ctx.GetThreadPtr();

  Status err = thread->JumpToLine(file_spec.get(), line, true);
  sb_error.SetError(err);
  return sb_error;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:23,代码来源:SBThread.cpp


示例8: CMICMDBASE_GETOPTION

//++
//------------------------------------------------------------------------------------
// Details: The invoker requires this function. The command does work in this
// function.
//          The command is likely to communicate with the LLDB SBDebugger in
//          here.
//          Synopsis: -symbol-list-lines file
//          Ref:
//          http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Symbol-Query.html#GDB_002fMI-Symbol-Query
// Type:    Overridden.
// Args:    None.
// Return:  MIstatus::success - Functional succeeded.
//          MIstatus::failure - Functional failed.
// Throws:  None.
//--
bool CMICmdCmdSymbolListLines::Execute() {
  CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile);

  const auto &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
  if (rSessionInfo.GetTarget() == rSessionInfo.GetDebugger().GetDummyTarget()) {
    SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_CURRENT),
                                   m_cmdData.strMiCmd.c_str()));
    return MIstatus::failure;
  }

  const lldb::SBFileSpec source_file_spec(pArgFile->GetValue().c_str(), true);
  const char *source_file_name = source_file_spec.GetFilename();
  const char *source_file_directory = source_file_spec.GetDirectory();
  const bool has_path = source_file_directory;

  lldb::SBSymbolContextList sc_cu_list =
      CMICmnLLDBDebugSessionInfo::Instance().GetTarget().FindCompileUnits(
          source_file_spec);

  bool found_something = false;
  for (uint32_t i = 0, e = sc_cu_list.GetSize(); i < e; ++i) {
    const lldb::SBCompileUnit cu =
        sc_cu_list.GetContextAtIndex(i).GetCompileUnit();
    for (uint32_t j = 0, e = cu.GetNumLineEntries(); j < e; ++j) {
      const lldb::SBLineEntry line = cu.GetLineEntryAtIndex(j);
      const lldb::SBFileSpec line_spec = line.GetFileSpec();
      if (line_spec.GetFilename() == source_file_name) {
        if (has_path && (line_spec.GetDirectory() != source_file_directory))
          continue;
        // We don't need a line with start address equals to end one,
        // so just skip it.
        const lldb::SBAddress line_start_address = line.GetStartAddress();
        const lldb::SBAddress line_end_address = line.GetEndAddress();
        if (line_start_address == line_end_address)
          continue;
        // We have a matching line.
        found_something = true;
        m_resultList.Add(CreateMITuplePCLine(
            line_start_address.GetFileAddress(),
            line.GetLine()));
      }
    }
  }
  if (!found_something) {
    SetError(MIRSRC(IDS_UTIL_FILE_ERR_INVALID_PATHNAME));
    return MIstatus::failure;
  }
  return MIstatus::success;
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:64,代码来源:MICmdCmdSymbol.cpp


示例9: exe_ctx

SBError
SBThread::JumpToLine (lldb::SBFileSpec &file_spec, uint32_t line)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    SBError sb_error;

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

    if (log)
        log->Printf ("SBThread(%p)::JumpToLine (file+line = %s:%u)", exe_ctx.GetThreadPtr(), file_spec->GetPath().c_str(), line);

    if (!exe_ctx.HasThreadScope())
    {
        sb_error.SetErrorString("this SBThread object is invalid");
        return sb_error;
    }

    Thread *thread = exe_ctx.GetThreadPtr();

    Error err = thread->JumpToLine (file_spec.get(), line, true);
    sb_error.SetError (err);
    return sb_error;
}
开发者ID:nrgmilk,项目名称:freebsd,代码行数:24,代码来源:SBThread.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ lldb::SBFrame类代码示例发布时间:2022-05-31
下一篇:
C++ lldb::SBEvent类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap