From 703588540efc17027d6a7df2ea65f338ea367652 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 9 Dec 2011 19:48:22 +0000 Subject: [PATCH] Don't spam warnings about not being able to read memory at 0x0. llvm-svn: 146271 --- lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp b/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp index d0eb3e753685..5a9276dd28a3 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachVMMemory.cpp @@ -85,7 +85,10 @@ MachVMMemory::Read(task_t task, nub_addr_t address, void *data, nub_size_t data_ 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())