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

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 14 13:24:32 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)) {
----------------
labath wrote:

I guess the reason I don't like that is that it just feels like a very special case. Like if I send two regions, each covering half the address space, then I'm sort of saying the same thing, but unlike the single region, this response will get accepted. It also doesn't handle the case of a 32 bit address space being full. The fact that this breaks all of expression evaluation might be sort of a good thing actually, as it means the problem is likely to be caught.

If you feel strongly about this, then I don't want to stand in your way, but I would rather not have this special case.

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


More information about the lldb-commits mailing list