Skip to content

Commit 18ef8d7

Browse files
[lldb] Call FixUpPointer in WritePointerToMemory (#152798)
In architectures where pointers may contain metadata, such as arm64e, the metadata may need to be cleaned prior to sending this pointer to be used in expression evaluation generated code. This patch is a step towards allowing consumers of pointers to decide whether they want to keep or remove metadata, as opposed to discarding metadata at the moment pointers are created. See #150537. This was tested running the LLDB test suite on arm64e.
1 parent 81b576e commit 18ef8d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lldb/source/Expression/IRMemoryMap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t process_address,
640640
lldb::addr_t address, Status &error) {
641641
error.Clear();
642642

643+
if (auto process_sp = GetProcessWP().lock())
644+
address = process_sp->FixAnyAddress(address);
645+
643646
Scalar scalar(address);
644647

645648
WriteScalarToMemory(process_address, scalar, GetAddressByteSize(), error);

0 commit comments

Comments
 (0)