Skip to content

Commit 54d8193

Browse files
authored
Return high address masks correctly in Process (llvm#78379)
In https://reviews.llvm.org/D151292 I added the ability to track address masks separately for high and low memory addresses, a capability of AArch64. I did my testing with manual address mask settings (via target.process.highmem-virtual-addressable-bits) but didn't have a real corefile that included this metadata and required it. My intention is that when the high address mask isn't specified, by the user (via the setting) or the Process plugin, we fall back to using the low address mask. The low and high address mask is the same for almost all environments. But the patch I wrote never uses the Process plugin high address mask if it was set, e.g. from corefile metadata. This patch corrects that. I also have an old patch in Phabractor that was approved to add FixAddress methods to SBProcess; I need to pick that patch up and finish it (I wanted to add an enum to specify which mask is being requested iirc), so I can do address masks tests in API tests. rdar://120926000
1 parent cbb46d9 commit 54d8193

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lldb/source/Target/Process.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5694,12 +5694,16 @@ lldb::addr_t Process::GetDataAddressMask() {
56945694
lldb::addr_t Process::GetHighmemCodeAddressMask() {
56955695
if (uint32_t num_bits_setting = GetHighmemVirtualAddressableBits())
56965696
return ~((1ULL << num_bits_setting) - 1);
5697+
if (m_highmem_code_address_mask)
5698+
return m_highmem_code_address_mask;
56975699
return GetCodeAddressMask();
56985700
}
56995701

57005702
lldb::addr_t Process::GetHighmemDataAddressMask() {
57015703
if (uint32_t num_bits_setting = GetHighmemVirtualAddressableBits())
57025704
return ~((1ULL << num_bits_setting) - 1);
5705+
if (m_highmem_data_address_mask)
5706+
return m_highmem_data_address_mask;
57035707
return GetDataAddressMask();
57045708
}
57055709

0 commit comments

Comments
 (0)