Skip to content

Commit 6863992

Browse files
committed
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 (cherry picked from commit 54d8193)
1 parent 71521cf commit 6863992

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
@@ -5850,12 +5850,16 @@ lldb::addr_t Process::GetDataAddressMask() {
58505850
lldb::addr_t Process::GetHighmemCodeAddressMask() {
58515851
if (uint32_t num_bits_setting = GetHighmemVirtualAddressableBits())
58525852
return ~((1ULL << num_bits_setting) - 1);
5853+
if (m_highmem_code_address_mask)
5854+
return m_highmem_code_address_mask;
58535855
return GetCodeAddressMask();
58545856
}
58555857

58565858
lldb::addr_t Process::GetHighmemDataAddressMask() {
58575859
if (uint32_t num_bits_setting = GetHighmemVirtualAddressableBits())
58585860
return ~((1ULL << num_bits_setting) - 1);
5861+
if (m_highmem_data_address_mask)
5862+
return m_highmem_data_address_mask;
58595863
return GetDataAddressMask();
58605864
}
58615865

0 commit comments

Comments
 (0)