[Lldb-commits] [lldb] [lldb] Call FixUpPointer in WritePointerToMemory (try 2) (PR #153585)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 14 08:11:13 PDT 2025


================
@@ -640,6 +640,13 @@ void IRMemoryMap::WritePointerToMemory(lldb::addr_t process_address,
                                        lldb::addr_t address, Status &error) {
   error.Clear();
 
+  /// Only ask the Process to fix the address if this address belongs to the
+  /// process (host allocations are stored in m_data).
+  if (auto it = FindAllocation(process_address, 1);
+      it != m_allocations.end() && it->second.m_data.GetByteSize() == 0)
+    if (auto process_sp = GetProcessWP().lock())
+      address = process_sp->FixAnyAddress(address);
----------------
felipepiovezan wrote:

> Also could we have an overlap between host and debugee memory addresses?

Probably, in the sense that these are all just numbers. But I'm not sure I follow the concern here: IRMemoryMap is supposed to track which address comes from where, so it's not clear why overlapping is a concern? It is the job IRMemoryMap to think about overlaps when it is creating `Allocation`s, not during `WritePointerToMemory`.

https://github.com/llvm/llvm-project/pull/153585


More information about the lldb-commits mailing list