Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/include/lldb/Expression/IRMemoryMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class IRMemoryMap {
size_t size, Status &error);
void WriteScalarToMemory(lldb::addr_t process_address, Scalar &scalar,
size_t size, Status &error);
void WritePointerToMemory(lldb::addr_t process_address, lldb::addr_t address,
void WritePointerToMemory(lldb::addr_t process_address, lldb::addr_t pointer,
Status &error);
void ReadMemory(uint8_t *bytes, lldb::addr_t process_address, size_t size,
Status &error);
Expand Down
10 changes: 5 additions & 5 deletions lldb/source/Expression/IRMemoryMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,19 +637,19 @@ void IRMemoryMap::WriteScalarToMemory(lldb::addr_t process_address,
}

void IRMemoryMap::WritePointerToMemory(lldb::addr_t process_address,
lldb::addr_t address, Status &error) {
lldb::addr_t pointer, Status &error) {
error.Clear();

/// Only ask the Process to fix the address if this address belongs to the
/// Only ask the Process to fix `pointer` if the address belongs to the
/// process. An address belongs to the process if the Allocation policy is not
/// eAllocationPolicyHostOnly.
auto it = FindAllocation(address, 1);
auto it = FindAllocation(pointer, 1);
if (it == m_allocations.end() ||
it->second.m_policy != AllocationPolicy::eAllocationPolicyHostOnly)
if (auto process_sp = GetProcessWP().lock())
address = process_sp->FixAnyAddress(address);
pointer = process_sp->FixAnyAddress(pointer);

Scalar scalar(address);
Scalar scalar(pointer);

WriteScalarToMemory(process_address, scalar, GetAddressByteSize(), error);
}
Expand Down
Loading