[Lldb-commits] [lldb] r146271 - /lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp

Jim Ingham jingham at apple.com
Fri Dec 9 11:48:23 PST 2011


Author: jingham
Date: Fri Dec  9 13:48:22 2011
New Revision: 146271

URL: http://llvm.org/viewvc/llvm-project?rev=146271&view=rev
Log:
Don't spam warnings about not being able to read memory at 0x0.

Modified:
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp?rev=146271&r1=146270&r2=146271&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp Fri Dec  9 13:48:22 2011
@@ -85,7 +85,10 @@
         mach_msg_type_number_t curr_bytes_read = 0;
         vm_offset_t vm_memory = NULL;
         m_err = ::mach_vm_read (task, curr_addr, curr_size, &vm_memory, &curr_bytes_read);
-        if (DNBLogCheckLogBit(LOG_MEMORY) || m_err.Fail())
+        
+        // We end up being asked to read memory at 0x0 a lot without that being a real error, so that ends up just
+        // causing a lot of useless log spam.  Only complain on failing reads if the address is not 0x0.
+        if (DNBLogCheckLogBit(LOG_MEMORY) || (m_err.Fail() && curr_addr != 0))
             m_err.LogThreaded("::mach_vm_read ( task = 0x%4.4x, addr = 0x%8.8llx, size = %llu, data => %8.8p, dataCnt => %i )", task, (uint64_t)curr_addr, (uint64_t)curr_size, vm_memory, curr_bytes_read);
 
         if (m_err.Success())





More information about the lldb-commits mailing list