[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
Wed Jan 21 06:28:41 PST 2026
================
@@ -1752,16 +1752,17 @@ class CommandObjectMemoryRegion : public CommandObjectParsed {
return;
}
} else if (argc > 1 ||
- // 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.
- (argc == 0 && !m_memory_region_options.m_all &&
- 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))) {
+ (!m_memory_region_options.m_all &&
+ (
+ // 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.
+ (argc == 0 && 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))))) {
----------------
DavidSpickett wrote:
If the diff is confusing, another way to look at this is:
* I added `!m_memory_region_options.m_all &&` to the second condition.
* Then I factored `!m_memory_region_options.m_all &&` out of both of them.
The bug was that both conditions should have started with `!m_memory_region_options.m_all &&`.
https://github.com/llvm/llvm-project/pull/177176
More information about the lldb-commits
mailing list