================
@@ -710,16 +710,13 @@ bool DYLDRendezvous::FindMetadata(const char *name, 
PThreadField field,
   target.GetImages().FindSymbolsWithNameAndType(ConstString(name),
                                                 eSymbolTypeAny, list);
   if (list.IsEmpty())
-  return false;
-
-  Address address = list[0].symbol->GetAddress();
-  addr_t addr = address.GetLoadAddress(&target);
-  if (addr == LLDB_INVALID_ADDRESS)
     return false;
 
+  Address address = list[0].symbol->GetAddress();
+  address.SetOffset(address.GetOffset() + field * sizeof(uint32_t));
   Status error;
-  value = (uint32_t)m_process->ReadUnsignedIntegerFromMemory(
-      addr + field * sizeof(uint32_t), sizeof(uint32_t), 0, error);
+  value =
+      target.ReadUnsignedIntegerFromMemory(address, sizeof(uint32_t), 0, 
error);
----------------
clayborg wrote:

Make a comment here as to why we read from the target like "Read from target 
memory as this allows us to try process memory and fallback to reading from 
read only sections from the object files. Here we are reading read only data 
from libpthread.so to find data in the thread specific area for the data we 
want and this won't be saved into process memory due to it being read only.

https://github.com/llvm/llvm-project/pull/67470
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to