[Lldb-commits] [lldb] r107352 - /lldb/trunk/source/Target/Target.cpp

Greg Clayton gclayton at apple.com
Wed Jun 30 16:04:24 PDT 2010


Author: gclayton
Date: Wed Jun 30 18:04:24 2010
New Revision: 107352

URL: http://llvm.org/viewvc/llvm-project?rev=107352&view=rev
Log:
Removed a commented out function and did a little reformatting.


Modified:
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=107352&r1=107351&r2=107352&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Wed Jun 30 18:04:24 2010
@@ -507,104 +507,8 @@
     BroadcastEvent (eBroadcastBitModulesUnloaded, NULL);
 }
 
-
-//size_t
-//Target::ReadMemory
-//(
-//    lldb::AddressType addr_type,
-//    lldb::addr_t addr,
-//    void *dst,
-//    size_t dst_len,
-//    Error &error,
-//    ObjectFile* objfile
-//)
-//{
-//    size_t bytes_read = 0;
-//    error.Clear();
-//    switch (addr_type)
-//    {
-//    case eAddressTypeFile:
-//        if (objfile)
-//        {
-//            Address so_addr(addr, objfile->GetSectionList());
-//            if (m_process_sp.get())
-//            {
-//                // If we have an execution context with a process, lets try and
-//                // resolve the file address in "objfile" and read it from the
-//                // process
-//                lldb::addr_t load_addr = so_addr.GetLoadAddress(m_process_sp.get());
-//                if (load_addr == LLDB_INVALID_ADDRESS)
-//                {
-//                    if (objfile->GetFileSpec())
-//                        error.SetErrorStringWithFormat("0x%llx can't be resolved, %s in not currently loaded.\n", addr, objfile->GetFileSpec().GetFilename().AsCString());
-//                    else
-//                        error.SetErrorStringWithFormat("0x%llx can't be resolved.\n", addr, objfile->GetFileSpec().GetFilename().AsCString());
-//                }
-//                else
-//                {
-//                    bytes_read = m_process_sp->ReadMemory(load_addr, dst, dst_len, error);
-//                    if (bytes_read != dst_len)
-//                    {
-//                        if (error.Success())
-//                        {
-//                            if (bytes_read == 0)
-//                                error.SetErrorStringWithFormat("Read memory from 0x%llx failed.\n", load_addr);
-//                            else
-//                                error.SetErrorStringWithFormat("Only %zu of %zu bytes were read from memory at 0x%llx.\n", bytes_read, dst_len, load_addr);
-//                        }
-//                    }
-//                }
-//            }
-//            else
-//            {
-//                // Try and read the file based address from the object file's
-//                // section data.
-//                const Section *section = so_addr.GetSection();
-//                if (section)
-//                    return section->ReadSectionDataFromObjectFile(objfile, so_addr.GetOffset(), dst, dst_len);
-//            }
-//        }
-//        break;
-//
-//    case eAddressTypeLoad:
-//        if (m_process_sp.get())
-//        {
-//            bytes_read = m_process_sp->ReadMemory(addr, dst, dst_len, error);
-//            if (bytes_read != dst_len)
-//            {
-//                if (error.Success())
-//                {
-//                    if (bytes_read == 0)
-//                        error.SetErrorStringWithFormat("Read memory from 0x%llx failed.\n", addr);
-//                    else
-//                        error.SetErrorStringWithFormat("Only %zu of %zu bytes were read from memory at 0x%llx.\n", bytes_read, dst_len, addr);
-//                }
-//            }
-//        }
-//        else
-//            error.SetErrorStringWithFormat("Need valid process to read load address.\n");
-//        break;
-//
-//    case eAddressTypeHost:
-//        // The address is an address in this process, so just copy it
-//        ::memcpy (dst, (uint8_t*)NULL + addr, dst_len);
-//        break;
-//
-//    default:
-//        error.SetErrorStringWithFormat ("Unsupported lldb::AddressType value (%i).\n", addr_type);
-//        break;
-//    }
-//    return bytes_read;
-//}
-
 size_t
-Target::ReadMemory
-(
-    const Address& addr,
-    void *dst,
-    size_t dst_len,
-    Error &error
-)
+Target::ReadMemory (const Address& addr, void *dst, size_t dst_len, Error &error)
 {
     error.Clear();
 





More information about the lldb-commits mailing list