[Lldb-commits] [PATCH] D115508: Reland "[lldb] Remove non address bits when looking up memory regions"

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 13 05:39:49 PST 2022


DavidSpickett added inline comments.


================
Comment at: lldb/source/Commands/CommandObjectMemory.cpp:1668
+    if (argc > 1 || (argc == 0 && load_addr == LLDB_INVALID_ADDRESS) ||
+        (abi && (abi->FixDataAddress(load_addr) != load_addr))) {
       result.AppendErrorWithFormat("'%s' takes one argument:\nUsage: %s\n",
----------------
omjavaid wrote:
> Perhaps this condition should only run when argument is not equal to 1. When user supplies an argument which has non-address-bits set, load_addr may not be equal to value returned by FixDataAddress(load_address). This will fire a invalid argument error which according to comment above we do not intend?
> 
> 
Took me a while to figure out how to trigger it but you're right.

```
(lldb) memory region 0
<...>
(lldb) memory region
<...repeat the command a bunch of times...>
(lldb)
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
<m_prev_end_addr now has non-address bits>
(lldb) memory region 12345
error: 'memory region' takes one argument:
Usage: memory region ADDR
<error despite 12345 not being tagged>
```

I'll fix this issue.

For the simpler case where you have no previous address, or one with no non-address bits, that works. (and is covered by the included test)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115508/new/

https://reviews.llvm.org/D115508



More information about the lldb-commits mailing list