[Lldb-commits] [lldb] [lldb] Handle an empty SBMemoryRegionInfo from scripted process (PR #115963)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 14 11:34:59 PST 2024


================
@@ -288,8 +288,15 @@ Status ScriptedProcess::DoGetMemoryRegionInfo(lldb::addr_t load_addr,
                                               MemoryRegionInfo &region) {
   Status error;
   if (auto region_or_err =
-          GetInterface().GetMemoryRegionContainingAddress(load_addr, error))
+          GetInterface().GetMemoryRegionContainingAddress(load_addr, error)) {
     region = *region_or_err;
+    if (region.GetRange().GetRangeBase() == 0 &&
+        (region.GetRange().GetByteSize() == 0 ||
+         region.GetRange().GetByteSize() == LLDB_INVALID_ADDRESS)) {
----------------
jasonmolenda wrote:

I see what you mean for checking the address is contained within the range, and rejecting it if not, this works too.

Right now if a stub returns {0, UINT64_MAX} and we don't have a memory allocation packet, IRMemory::FindSpace will find no available virtual address space and all expressions will fail.

My opposition to {0, UINT64_MAX} being accepted is that it's meaningless.  No processor actually has 64-bits of addressing, so telling me that all memory is addressable is obviously wrong.  It will break IRMemoryMap::FindSpace's algorithm, and this response tells us nothing more than if qMemoryRegionInfo was an unsupported packet.

https://github.com/llvm/llvm-project/pull/115963


More information about the lldb-commits mailing list