[Lldb-commits] [lldb] 9846a1f - [lldb] Remove an outdated comment. NFC.

Martin Storsjö via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 22 06:12:30 PDT 2022


Author: Martin Storsjö
Date: 2022-06-22T16:11:59+03:00
New Revision: 9846a1f2d4723a8c060370638bbd52360638d0fc

URL: https://github.com/llvm/llvm-project/commit/9846a1f2d4723a8c060370638bbd52360638d0fc
DIFF: https://github.com/llvm/llvm-project/commit/9846a1f2d4723a8c060370638bbd52360638d0fc.diff

LOG: [lldb] Remove an outdated comment. NFC.

This comment became outdated in 053eb35651906e693906fad6c695fce11415ade7
(but was moved along); that commit moved the code and the comment
to a separate function, with a separate local variable
`num_of_bytes_read`. On error, the possibly garbage value is never
copied back to the caller's reference, thus the comment is no longer
relevant (and slightly confusing as is).

Differential Revision: https://reviews.llvm.org/D128226

Added: 
    

Modified: 
    lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
index 555c19adcfa9a..59f5f6dfe7716 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessDebugger.cpp
@@ -281,10 +281,6 @@ Status ProcessDebugger::ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
   SIZE_T num_of_bytes_read = 0;
   if (!::ReadProcessMemory(process.GetNativeProcess().GetSystemHandle(), addr,
                            buf, size, &num_of_bytes_read)) {
-    // Reading from the process can fail for a number of reasons - set the
-    // error code and make sure that the number of bytes read is set back to 0
-    // because in some scenarios the value of bytes_read returned from the API
-    // is garbage.
     error.SetError(GetLastError(), eErrorTypeWin32);
     LLDB_LOG(log, "reading failed with error: {0}", error);
   } else {


        


More information about the lldb-commits mailing list