Skip to content

Commit 6fde782

Browse files
committed
fixup: Use 'Target::ReadMemory()' for live debug sessions
1 parent 17210b1 commit 6fde782

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

lldb/source/ValueObject/ValueObject.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -734,22 +734,17 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx,
734734
} break;
735735
case eAddressTypeLoad: {
736736
ExecutionContext exe_ctx(GetExecutionContextRef());
737-
heap_buf_ptr->SetByteSize(bytes);
738-
size_t bytes_read = 0;
739-
if (Process *process = exe_ctx.GetProcessPtr();
740-
process && process->IsLiveDebugSession()) {
741-
bytes_read = process->ReadMemory(
742-
addr + offset, heap_buf_ptr->GetBytes(), bytes, error);
743-
} else if (Target *target = exe_ctx.GetTargetPtr()) {
737+
if (Target *target = exe_ctx.GetTargetPtr()) {
738+
heap_buf_ptr->SetByteSize(bytes);
744739
Address target_addr;
745740
target_addr.SetLoadAddress(addr + offset, target);
746-
bytes_read =
741+
size_t bytes_read =
747742
target->ReadMemory(target_addr, heap_buf_ptr->GetBytes(), bytes,
748743
error, /*force_live_memory=*/true);
749-
}
750-
if (error.Success() || bytes_read > 0) {
751-
data.SetData(data_sp);
752-
return bytes_read;
744+
if (error.Success() || bytes_read > 0) {
745+
data.SetData(data_sp);
746+
return bytes_read;
747+
}
753748
}
754749
} break;
755750
case eAddressTypeHost: {

0 commit comments

Comments
 (0)