Skip to content

Commit

Permalink
Fix qMemoryRegionInfo packet to return current value for address afte…
Browse files Browse the repository at this point in the history
…r the last memory region

Differential revision: http://reviews.llvm.org/D10899

llvm-svn: 241333
  • Loading branch information
Tamas Berghammer committed Jul 3, 2015
1 parent 623652a commit 09839c3
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2702,12 +2702,25 @@ NativeProcessLinux::GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInf
// The target memory address comes somewhere after the region we just parsed.
}

// If we made it here, we didn't find an entry that contained the given address.
error.SetErrorString ("address comes after final region");

if (log)
log->Printf ("NativeProcessLinux::%s failed to find map entry for address 0x%" PRIx64 ": %s", __FUNCTION__, load_addr, error.AsCString ());

// If we made it here, we didn't find an entry that contained the given address. Return the
// load_addr as start and the amount of bytes betwwen load address and the end of the memory as
// size.
range_info.GetRange ().SetRangeBase (load_addr);
switch (m_arch.GetAddressByteSize())
{
case 4:
range_info.GetRange ().SetByteSize (0x100000000ull - load_addr);
break;
case 8:
range_info.GetRange ().SetByteSize (0ull - load_addr);
break;
default:
assert(false && "Unrecognized data byte size");
break;
}
range_info.SetReadable (MemoryRegionInfo::OptionalBool::eNo);
range_info.SetWritable (MemoryRegionInfo::OptionalBool::eNo);
range_info.SetExecutable (MemoryRegionInfo::OptionalBool::eNo);
return error;
}

Expand Down

0 comments on commit 09839c3

Please sign in to comment.