<rdar://problem/13308704>

Fixing a problem where ValueObject::GetPointeeData() would not accept "partial" valid reads (i.e. asking for 10 items and getting only 5 back)
While suboptimal, this situation is not a flat-out failure and could well be caused by legit scenarios, such as hitting a page boundary

Among others, this allows data formatters to print char* buffers allocated under libgmalloc

llvm-svn: 193704
This commit is contained in:
Enrico Granata
2013-10-30 17:52:44 +00:00
parent 82509b6675
commit 5e1480c5dc

View File

@@ -1030,7 +1030,7 @@ ValueObject::GetPointeeData (DataExtractor& data,
{
heap_buf_ptr->SetByteSize(bytes);
size_t bytes_read = process->ReadMemory(addr + offset, heap_buf_ptr->GetBytes(), bytes, error);
if (error.Success())
if (error.Success() || bytes_read > 0)
{
data.SetData(data_sp);
return bytes_read;