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


C++ DataBufferSP::reset方法代码示例

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


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

示例1: DataBufferHeap

bool
RegisterContextWindows_x86::ReadAllRegisterValues(lldb::DataBufferSP &data_sp)
{
    if (!CacheAllRegisterValues())
        return false;
    if (data_sp->GetByteSize() < sizeof(m_context))
    {
        data_sp.reset(new DataBufferHeap(sizeof(CONTEXT), 0));
    }
    memcpy(data_sp->GetBytes(), &m_context, sizeof(m_context));
    return true;
}
开发者ID:johndpope,项目名称:lldb,代码行数:12,代码来源:RegisterContextWindows_x86.cpp

示例2: GetGPRSize

bool RegisterContextPOSIXProcessMonitor_arm64::ReadAllRegisterValues(
    lldb::DataBufferSP &data_sp) {
  bool success = false;
  data_sp.reset(new lldb_private::DataBufferHeap(REG_CONTEXT_SIZE, 0));
  if (data_sp && ReadGPR() && ReadFPR()) {
    uint8_t *dst = data_sp->GetBytes();
    success = dst != 0;

    if (success) {
      ::memcpy(dst, &m_gpr_arm64, GetGPRSize());
      dst += GetGPRSize();
      ::memcpy(dst, &m_fpr, sizeof m_fpr);
    }
  }
  return success;
}
开发者ID:CodaFi,项目名称:swift-lldb,代码行数:16,代码来源:RegisterContextPOSIXProcessMonitor_arm64.cpp

示例3: DataBufferHeap

bool RegisterContextDarwin_arm64::ReadAllRegisterValues(
    lldb::DataBufferSP &data_sp) {
  data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
  if (data_sp && ReadGPR(false) == KERN_SUCCESS &&
      ReadFPU(false) == KERN_SUCCESS && ReadEXC(false) == KERN_SUCCESS) {
    uint8_t *dst = data_sp->GetBytes();
    ::memcpy(dst, &gpr, sizeof(gpr));
    dst += sizeof(gpr);

    ::memcpy(dst, &fpu, sizeof(fpu));
    dst += sizeof(gpr);

    ::memcpy(dst, &exc, sizeof(exc));
    return true;
  }
  return false;
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:17,代码来源:RegisterContextDarwin_arm64.cpp

示例4: DataBufferHeap

Status NativeRegisterContextLinux_s390x::ReadAllRegisterValues(
    lldb::DataBufferSP &data_sp) {
  Status error;

  data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
  if (!data_sp) {
    error.SetErrorStringWithFormat(
        "failed to allocate DataBufferHeap instance of size %" PRIu64,
        REG_CONTEXT_SIZE);
    return error;
  }

  uint8_t *dst = data_sp->GetBytes();
  if (dst == nullptr) {
    error.SetErrorStringWithFormat("DataBufferHeap instance of size %" PRIu64
                                   " returned a null pointer",
                                   REG_CONTEXT_SIZE);
    return error;
  }

  error = DoReadGPR(dst, sizeof(s390_regs));
  dst += sizeof(s390_regs);
  if (error.Fail())
    return error;

  error = DoReadFPR(dst, sizeof(s390_fp_regs));
  dst += sizeof(s390_fp_regs);
  if (error.Fail())
    return error;

  // Ignore errors if the regset is unsupported (happens on older kernels).
  DoReadRegisterSet(NT_S390_SYSTEM_CALL, dst, 4);
  dst += 4;

  // To enable inferior function calls while the process is stopped in
  // an interrupted system call, we need to clear the system call flag.
  // It will be restored to its original value by WriteAllRegisterValues.
  // Again we ignore error if the regset is unsupported.
  uint32_t system_call = 0;
  DoWriteRegisterSet(NT_S390_SYSTEM_CALL, &system_call, 4);

  return error;
}
开发者ID:emaste,项目名称:lldb,代码行数:43,代码来源:NativeRegisterContextLinux_s390x.cpp

示例5: DataBufferHeap

Error
NativeRegisterContextLinux_mips64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
{
    Error error;

    data_sp.reset (new DataBufferHeap (REG_CONTEXT_SIZE, 0));
    if (!data_sp)
    {
        error.SetErrorStringWithFormat ("failed to allocate DataBufferHeap instance of size %" PRIu64, REG_CONTEXT_SIZE);
        return error;
    }

    error = ReadGPR();
    if (!error.Success())
    {
        error.SetErrorString ("ReadGPR() failed");
        return error;
    }

    error = ReadCP1();
    if (!error.Success())
    {
        error.SetErrorString ("ReadCP1() failed");
        return error;
    }

    uint8_t *dst = data_sp->GetBytes ();
    if (dst == nullptr)
    {
        error.SetErrorStringWithFormat ("DataBufferHeap instance of size %" PRIu64 " returned a null pointer", REG_CONTEXT_SIZE);
        return error;
    }

    ::memcpy (dst, &m_gpr, GetRegisterInfoInterface ().GetGPRSize ());
    dst += GetRegisterInfoInterface ().GetGPRSize ();

    ::memcpy (dst, &m_fpr, GetFPRSize ());
    dst += GetFPRSize ();

    ::memcpy (dst, &m_msa, sizeof(MSA_linux_mips));

    return error;
}
开发者ID:k06a,项目名称:lldb,代码行数:43,代码来源:NativeRegisterContextLinux_mips64.cpp


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