[Lldb-commits] [lldb] [lldb] Fix error when running "memory region --all" repeatedly (PR #177176)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 23 02:06:35 PST 2026


================
@@ -1735,7 +1735,24 @@ class CommandObjectMemoryRegion : public CommandObjectParsed {
     const size_t argc = command.GetArgumentCount();
     const lldb::ABISP &abi = process_sp->GetABI();
 
-    if (argc == 1) {
+    if (argc == 0) {
+      if (!m_memory_region_options.m_all) {
+        if ( // When we're repeating the command, the previous end
+             // address is used for load_addr. If that was 0xF...F then
+             // we must have reached the end of memory.
+            (load_addr == LLDB_INVALID_ADDRESS) ||
+            // If the target has non-address bits (tags, limited virtual
+            // address size, etc.), the end of mappable memory will be
+            // lower than that. So if we find any non-address bit set,
+            // we must be at the end of the mappable range.
+            (abi && (abi->FixAnyAddress(load_addr) != load_addr))) {
+          result.AppendErrorWithFormat(
----------------
DavidSpickett wrote:

Based on this PR's changes - https://github.com/llvm/llvm-project/pull/177559

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


More information about the lldb-commits mailing list