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


C++ SBError::SetErrorString方法代码示例

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


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

示例1: log

size_t
SBProcess::ReadMemory (addr_t addr, void *dst, size_t dst_len, SBError &sb_error)
{
    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    size_t bytes_read = 0;

    ProcessSP process_sp(GetSP());

    if (log)
    {
        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%zu, SBError (%p))...",
                     process_sp.get(), 
                     addr, 
                     dst, 
                     dst_len, 
                     sb_error.get());
    }
    
    if (process_sp)
    {
        Process::StopLocker stop_locker;
        if (stop_locker.TryLock(&process_sp->GetRunLock()))
        {
            Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
            bytes_read = process_sp->ReadMemory (addr, dst, dst_len, sb_error.ref());
        }
        else
        {
            if (log)
                log->Printf ("SBProcess(%p)::ReadMemory() => error: process is running", process_sp.get());
            sb_error.SetErrorString("process is running");
        }
    }
    else
    {
        sb_error.SetErrorString ("SBProcess is invalid");
    }

    if (log)
    {
        SBStream sstr;
        sb_error.GetDescription (sstr);
        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%zu, SBError (%p): %s) => %zu", 
                     process_sp.get(), 
                     addr, 
                     dst, 
                     dst_len, 
                     sb_error.get(), 
                     sstr.GetData(),
                     bytes_read);
    }

    return bytes_read;
}
开发者ID:ztianjin,项目名称:lldb,代码行数:55,代码来源:SBProcess.cpp

示例2: SBThreadPlan

SBThreadPlan
SBThreadPlan::QueueThreadPlanForStepInRange(SBAddress &sb_start_address,
                                            lldb::addr_t size, SBError &error) {
  if (m_opaque_sp) {
    Address *start_address = sb_start_address.get();
    if (!start_address) {
      return SBThreadPlan();
    }

    AddressRange range(*start_address, size);
    SymbolContext sc;
    start_address->CalculateSymbolContext(&sc);

    Status plan_status;
    SBThreadPlan plan =
        SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForStepInRange(
            false, range, sc, NULL, eAllThreads, plan_status));

    if (plan_status.Fail())
      error.SetErrorString(plan_status.AsCString());

    return plan;
  } else {
    return SBThreadPlan();
  }
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:26,代码来源:SBThreadPlan.cpp

示例3:

SBError
SBDebugger::RunREPL (lldb::LanguageType language, const char *repl_options)
{
    SBError error;
    if (m_opaque_sp)
        error.ref() = m_opaque_sp->RunREPL(language, repl_options);
    else
        error.SetErrorString ("invalid debugger");
    return error;
}
开发者ID:wiltonlazary,项目名称:swift-lldb,代码行数:10,代码来源:SBDebugger.cpp

示例4: api_locker

uint64_t
SBValue::GetValueAsUnsigned(SBError& error, uint64_t fail_value)
{
    error.Clear();
    if (m_opaque_sp)
    {
        if (m_opaque_sp->GetUpdatePoint().GetTargetSP())
        {
            Mutex::Locker api_locker (m_opaque_sp->GetUpdatePoint().GetTargetSP()->GetAPIMutex());
            Scalar scalar;
            if (m_opaque_sp->ResolveValue (scalar))
                return scalar.GetRawBits64(fail_value);
            else
                error.SetErrorString("could not get value");
        }
        else
            error.SetErrorString("could not get target");
    }
    error.SetErrorString("invalid SBValue");
    return fail_value;
}
开发者ID:markpeek,项目名称:lldb,代码行数:21,代码来源:SBValue.cpp

示例5: value_sp

bool
SBValue::SetData (lldb::SBData &data, SBError &error)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
    ValueLocker locker;
    lldb::ValueObjectSP value_sp(GetSP(locker));
    bool ret = true;
    
    if (value_sp)
    {
        DataExtractor *data_extractor = data.get();
        
        if (!data_extractor)
        {
            if (log)
                log->Printf ("SBValue(%p)::SetData() => error: no data to set", value_sp.get());
            
            error.SetErrorString("No data to set");
            ret = false;
        }
        else
        {
            Error set_error;
            
            value_sp->SetData(*data_extractor, set_error);
            
            if (!set_error.Success())
            {
                error.SetErrorStringWithFormat("Couldn't set data: %s", set_error.AsCString());
                ret = false;
            }
        }
    }
    else
    {
        error.SetErrorStringWithFormat ("Couldn't set data: could not get SBValue: %s", locker.GetError().AsCString());
        ret = false;
    }
    
    if (log)
        log->Printf ("SBValue(%p)::SetData (%p) => %s",
                     value_sp.get(),
                     data.get(),
                     ret ? "true" : "false");
    return ret;
}
开发者ID:ChaosJohn,项目名称:freebsd,代码行数:46,代码来源:SBValue.cpp

示例6: log

size_t
SBProcess::ReadMemory (addr_t addr, void *dst, size_t dst_len, SBError &sb_error)
{
    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));

    size_t bytes_read = 0;

    if (log)
    {
        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%zu, SBError (%p))...",
                     m_opaque_sp.get(), 
                     addr, 
                     dst, 
                     (uint32_t) dst_len, 
                     sb_error.get());
    }

    if (m_opaque_sp)
    {
        Error error;
        Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
        bytes_read = m_opaque_sp->ReadMemory (addr, dst, dst_len, error);
        sb_error.SetError (error);
    }
    else
    {
        sb_error.SetErrorString ("SBProcess is invalid");
    }

    if (log)
    {
        SBStream sstr;
        sb_error.GetDescription (sstr);
        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%zu, SBError (%p): %s) => %d", 
                     m_opaque_sp.get(), 
                     addr, 
                     dst, 
                     (uint32_t) dst_len, 
                     sb_error.get(), 
                     sstr.GetData(),
                     (uint32_t) bytes_read);
    }

    return bytes_read;
}
开发者ID:eightcien,项目名称:lldb,代码行数:45,代码来源:SBProcess.cpp

示例7: QueueThreadPlanForRunToAddress

SBThreadPlan SBThreadPlan::QueueThreadPlanForRunToAddress(SBAddress sb_address,
                                                          SBError &error) {
  if (m_opaque_sp) {
    Address *address = sb_address.get();
    if (!address)
      return SBThreadPlan();

    Status plan_status;
    SBThreadPlan plan =
        SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForRunToAddress(
            false, *address, false, plan_status));

    if (plan_status.Fail())
      error.SetErrorString(plan_status.AsCString());

    return plan;
  } else {
    return SBThreadPlan();
  }
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:20,代码来源:SBThreadPlan.cpp


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