[Lldb-commits] [lldb] [lldb] Ignore the top byte in address_ranges_helper.py (PR #185802)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 11 01:57:23 PDT 2026
================
@@ -31,21 +37,20 @@ def GetRangeFromAddrValue(test_base, addr, shrink=False):
If 'shrink' is True, the address range will be reduced to not exceed 2K.
"""
region = lldb.SBMemoryRegionInfo()
+ addr_val = strip_tbi(addr.GetValueAsUnsigned())
test_base.assertTrue(
- test_base.process.GetMemoryRegionInfo(
- addr.GetValueAsUnsigned(), region
- ).Success(),
+ test_base.process.GetMemoryRegionInfo(addr_val, region).Success(),
)
test_base.assertTrue(region.IsReadable())
test_base.assertFalse(region.IsExecutable())
- base = region.GetRegionBase()
- end = region.GetRegionEnd()
+ base = strip_tbi(region.GetRegionBase())
+ end = strip_tbi(region.GetRegionEnd())
----------------
DavidSpickett wrote:
I don't think we have ever said that non-address bits must not be set for a region address. The information comes from https://lldb.llvm.org/resources/lldbgdbremote.html#qmemoryregioninfo-addr.
Though in practice, Linux's regions will never have non-address bits set.
I'd be interested to know if stripping here is just because in theory the tag byte could be set, or because it actually is on these systems. Even if it's the former, there's a good argument to apply it to all addresses for consistency anyway.
https://github.com/llvm/llvm-project/pull/185802
More information about the lldb-commits
mailing list