diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -1414,35 +1414,6 @@ /// this process. virtual bool WarnBeforeDetach() const { return true; } - /// Actually do the reading of memory from a process. - /// - /// Subclasses must override this function and can return fewer bytes than - /// requested when memory requests are too large. This class will break up - /// the memory requests and keep advancing the arguments along as needed. - /// - /// \param[in] vm_addr - /// A virtual load address that indicates where to start reading - /// memory from. - /// - /// \param[in] size - /// The number of bytes to read. - /// - /// \param[out] buf - /// A byte buffer that is at least \a size bytes long that - /// will receive the memory bytes. - /// - /// \param[out] error - /// An error that indicates the success or failure of this - /// operation. If error indicates success (error.Success()), - /// then the value returned can be trusted, otherwise zero - /// will be returned. - /// - /// \return - /// The number of bytes that were actually read into \a buf. - /// Zero is returned in the case of an error. - virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, - Status &error) = 0; - /// Read of memory from a process. /// /// This function will read memory from the current process's address space @@ -2570,6 +2541,35 @@ bool trap_exceptions = false); protected: + /// Actually do the reading of memory from a process. + /// + /// Subclasses must override this function and can return fewer bytes than + /// requested when memory requests are too large. This class will break up + /// the memory requests and keep advancing the arguments along as needed. + /// + /// \param[in] vm_addr + /// A virtual load address that indicates where to start reading + /// memory from. + /// + /// \param[in] size + /// The number of bytes to read. + /// + /// \param[out] buf + /// A byte buffer that is at least \a size bytes long that + /// will receive the memory bytes. + /// + /// \param[out] error + /// An error that indicates the success or failure of this + /// operation. If error indicates success (error.Success()), + /// then the value returned can be trusted, otherwise zero + /// will be returned. + /// + /// \return + /// The number of bytes that were actually read into \a buf. + /// Zero is returned in the case of an error. + virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, + Status &error) = 0; + void SetState(lldb::EventSP &event_sp); lldb::StateType GetPrivateState(); diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -400,7 +400,7 @@ *read_error = false; // Read the mach header and see whether it looks like a kernel - if (process->DoReadMemory (addr, &header, sizeof(header), error) != + if (process->ReadMemory(addr, &header, sizeof(header), error) != sizeof(header)) { if (read_error) *read_error = true; @@ -790,7 +790,7 @@ // For the kernel, we really do need an on-disk file copy of the binary // to do anything useful. This will force a call to dsymForUUID if it - // exists, instead of depending on the DebugSymbols preferences being + // exists, instead of depending on the DebugSymbols preferences being // set. if (IsKernel()) { if (Symbols::DownloadObjectAndSymbolFile(module_spec, true)) { diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp @@ -246,7 +246,7 @@ return std::string(); for (;;) { - size = m_process->DoReadMemory(addr, &c, 1, error); + size = m_process->ReadMemory(addr, &c, 1, error); if (size != 1 || error.Fail()) return std::string(); if (c == 0) diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -291,8 +291,8 @@ jit_descriptor jit_desc; const size_t jit_desc_size = sizeof(jit_desc); Status error; - size_t bytes_read = m_process->DoReadMemory(m_jit_descriptor_addr, &jit_desc, - jit_desc_size, error); + size_t bytes_read = m_process->ReadMemory(m_jit_descriptor_addr, &jit_desc, + jit_desc_size, error); if (bytes_read != jit_desc_size || !error.Success()) { LLDB_LOGF(log, "JITLoaderGDB::%s failed to read JIT descriptor", __FUNCTION__);