[Lldb-commits] [lldb] [lldb/linux] Make truncated reads work (PR #106532)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 2 02:40:40 PDT 2024


================
@@ -2526,28 +2526,16 @@ GDBRemoteCommunicationServerLLGS::Handle_memory_read(
   size_t bytes_read = 0;
   Status error = m_current_process->ReadMemoryWithoutTrap(
       read_addr, &buf[0], byte_count, bytes_read);
-  if (error.Fail()) {
-    LLDB_LOGF(log,
-              "GDBRemoteCommunicationServerLLGS::%s pid %" PRIu64
-              " mem 0x%" PRIx64 ": failed to read. Error: %s",
-              __FUNCTION__, m_current_process->GetID(), read_addr,
-              error.AsCString());
+  LLDB_LOG(log, "ReadMemoryWithoutTrap({0}) read {1}/{2} bytes (error: {3})",
+           read_addr, byte_count, bytes_read, error);
+  if (bytes_read == 0)
----------------
DavidSpickett wrote:

I would update the x/y bit to 1 be clearer which is which like:
```
requested X bytes read Y
```
(or use the phrasing from the log message you are removing below)

Also what is `error` here, `ReadMemoryWithoutTrap` doesn't seem to modify it.

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


More information about the lldb-commits mailing list