================
@@ -2209,7 +2209,13 @@ size_t Target::ReadMemory(const Address &addr, void 
*dst, size_t dst_len,
   if (!file_cache_read_buffer && resolved_addr.IsSectionOffset()) {
     // If we didn't already try and read from the object file cache, then try
     // it after failing to read from the process.
-    return ReadMemoryFromFileCache(resolved_addr, dst, dst_len, error);
+    // ReadMemoryFromFileCache() only ever sets "error", so clear it to keep a
+    // failed process read from poisoning a successful read here. Only a full
+    // read counts: ReadSectionData() clamps, leaving the tail of "dst" unset.
----------------
qiyao wrote:

You are right, the error isn't from `ReadMemoryFromFileCache`, it is from 
`Process::ReadMemory` path where `bytes_read == 0`.  I pushed a new commit to 
clear the error before `ReadMemoryFromFileCache` and set error with the right 
message after it.

https://github.com/llvm/llvm-project/pull/213451
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to