if (section->GetFileSize()) {
const void *src = (void *)(uintptr_t)section->GetFileOffset();
- DataBufferSP data_sp(
- new lldb_private::DataBufferHeap(src, section->GetFileSize()));
- if (data_sp) {
- section_data.SetData(data_sp, 0, data_sp->GetByteSize());
- section_data.SetByteOrder(GetByteOrder());
- section_data.SetAddressByteSize(GetAddressByteSize());
- return section_data.GetByteSize();
- }
+ DataBufferSP data_sp =
+ std::make_shared<DataBufferHeap>(src, section->GetFileSize());
+ section_data.SetData(data_sp, 0, data_sp->GetByteSize());
+ section_data.SetByteOrder(GetByteOrder());
+ section_data.SetAddressByteSize(GetAddressByteSize());
+ return section_data.GetByteSize();
}
section_data.Clear();
return 0;
DataBufferSP &data_sp) {
bool success = false;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (data_sp && ReadGPR() && ReadFPR()) {
+ if (ReadGPR() && ReadFPR()) {
uint8_t *dst = data_sp->GetBytes();
success = dst != 0;
lldb::DataBufferSP &data_sp) {
bool success = false;
data_sp.reset(new lldb_private::DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (data_sp && ReadGPR() && ReadFPR()) {
+ if (ReadGPR() && ReadFPR()) {
uint8_t *dst = data_sp->GetBytes();
success = dst != 0;
DataBufferSP &data_sp) {
bool success = false;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (data_sp && ReadGPR() && ReadFPR()) {
+ if (ReadGPR() && ReadFPR()) {
uint8_t *dst = data_sp->GetBytes();
success = dst != 0;
DataBufferSP &data_sp) {
bool success = false;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (data_sp && ReadGPR() && ReadFPR()) {
+ if (ReadGPR() && ReadFPR()) {
uint8_t *dst = data_sp->GetBytes();
success = dst != 0;
DataBufferSP &data_sp) {
bool success = false;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (data_sp && ReadGPR() && ReadFPR()) {
+ if (ReadGPR() && ReadFPR()) {
uint8_t *dst = data_sp->GetBytes();
success = dst != 0;
Status error;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (!data_sp)
- return Status("failed to allocate DataBufferHeap instance of size %" PRIu64,
- (uint64_t)REG_CONTEXT_SIZE);
-
error = ReadGPR();
if (error.Fail())
return error;
Status error;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (!data_sp)
- return Status("failed to allocate DataBufferHeap instance of size %" PRIu64,
- REG_CONTEXT_SIZE);
-
error = ReadGPR();
if (error.Fail())
return error;
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;
- }
-
error = ReadGPR();
if (!error.Success()) {
error.SetErrorString("ReadGPR() failed");
Status error;
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
- if (!data_sp)
- return Status("failed to allocate DataBufferHeap instance of size %" PRIu64,
- REG_CONTEXT_SIZE);
-
error = ReadGPR();
if (error.Fail())
return error;
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
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;
- }
-
error = ReadRegisterSet(GPRegSet);
if (error.Fail())
return error;
bool RegisterContextDarwin_arm64::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
- if (data_sp && ReadGPR(false) == KERN_SUCCESS &&
- ReadFPU(false) == KERN_SUCCESS && ReadEXC(false) == KERN_SUCCESS) {
+ if (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);
bool RegisterContextDarwin_i386::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
- if (data_sp && ReadGPR(false) == 0 && ReadFPU(false) == 0 &&
- ReadEXC(false) == 0) {
+ if (ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) {
uint8_t *dst = data_sp->GetBytes();
::memcpy(dst, &gpr, sizeof(gpr));
dst += sizeof(gpr);
bool RegisterContextDarwin_x86_64::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
data_sp = std::make_shared<DataBufferHeap>(REG_CONTEXT_SIZE, 0);
- if (data_sp && ReadGPR(false) == 0 && ReadFPU(false) == 0 &&
- ReadEXC(false) == 0) {
+ if (ReadGPR(false) == 0 && ReadFPU(false) == 0 && ReadEXC(false) == 0) {
uint8_t *dst = data_sp->GetBytes();
::memcpy(dst, &gpr, sizeof(gpr));
dst += sizeof(gpr);