本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}