From aafe053c5311df904a337f8782b6122f052e84d2 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 6 Feb 2017 19:31:05 +0000 Subject: [PATCH] Remove the verbose category in the posix channel replace by LLDB_LOGV llvm-svn: 294223 --- .../Plugins/Process/FreeBSD/FreeBSDThread.cpp | 6 ++---- .../Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | 18 +++++------------- .../Process/Linux/NativeProcessLinux.cpp | 17 ++++++++--------- .../Plugins/Process/POSIX/ProcessPOSIXLog.cpp | 2 -- .../Plugins/Process/POSIX/ProcessPOSIXLog.h | 1 - 5 files changed, 15 insertions(+), 29 deletions(-) diff --git a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp index 0b09296cb7fd..18122c9df892 100644 --- a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp @@ -53,8 +53,7 @@ FreeBSDThread::FreeBSDThread(Process &process, lldb::tid_t tid) : Thread(process, tid), m_frame_ap(), m_breakpoint(), m_thread_name_valid(false), m_thread_name(), m_posix_thread(NULL) { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD)); - if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) - log->Printf("FreeBSDThread::%s (tid = %" PRIi64 ")", __FUNCTION__, tid); + LLDB_LOGV(log, "tid = {0}", tid); // Set the current watchpoints for this thread. Target &target = GetProcess()->GetTarget(); @@ -215,8 +214,7 @@ FreeBSDThread::CreateRegisterContextForFrame(lldb_private::StackFrame *frame) { uint32_t concrete_frame_idx = 0; Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD)); - if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) - log->Printf("FreeBSDThread::%s ()", __FUNCTION__); + LLDB_LOGV(log, "called"); if (frame) concrete_frame_idx = frame->GetConcreteFrameIndex(); diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index 1a3ac23de272..7f250e15e29a 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -290,8 +290,7 @@ Error ProcessFreeBSD::DoAttachToProcessWithID( assert(m_monitor == NULL); Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); - if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) - log->Printf("ProcessFreeBSD::%s(pid = %" PRIi64 ")", __FUNCTION__, GetID()); + LLDB_LOGV(log, "pid = {0}", GetID()); m_monitor = new ProcessMonitor(this, pid, error); @@ -537,9 +536,7 @@ ProcessFreeBSD::CreateNewFreeBSDThread(lldb_private::Process &process, void ProcessFreeBSD::RefreshStateAfterStop() { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); - if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) - log->Printf("ProcessFreeBSD::%s(), message_queue size = %d", __FUNCTION__, - (int)m_message_queue.size()); + LLDB_LOGV(log, "message_queue size = {0}", m_message_queue.size()); std::lock_guard guard(m_message_mutex); @@ -551,10 +548,8 @@ void ProcessFreeBSD::RefreshStateAfterStop() { // Resolve the thread this message corresponds to and pass it along. lldb::tid_t tid = message.GetTID(); - if (log) - log->Printf( - "ProcessFreeBSD::%s(), message_queue size = %d, pid = %" PRIi64, - __FUNCTION__, (int)m_message_queue.size(), tid); + LLDB_LOGV(log, " message_queue size = {0}, pid = {1}", + m_message_queue.size(), tid); m_thread_list.RefreshStateAfterStop(); @@ -566,10 +561,7 @@ void ProcessFreeBSD::RefreshStateAfterStop() { if (message.GetKind() == ProcessMessage::eExitMessage) { // FIXME: We should tell the user about this, but the limbo message is // probably better for that. - if (log) - log->Printf("ProcessFreeBSD::%s() removing thread, tid = %" PRIi64, - __FUNCTION__, tid); - + LLDB_LOG(log, "removing thread, tid = {0}", tid); std::lock_guard guard(m_thread_list.GetMutex()); ThreadSP thread_sp = m_thread_list.RemoveThreadByID(tid, false); diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 4476569c0bce..f7636502604f 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -140,8 +140,7 @@ void DisplayBytes(StreamString &s, void *bytes, uint32_t count) { } void PtraceDisplayBytes(int &req, void *data, size_t data_size) { - Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PTRACE | - POSIX_LOG_VERBOSE)); + Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PTRACE)); if (!log) return; StreamString buf; @@ -149,38 +148,38 @@ void PtraceDisplayBytes(int &req, void *data, size_t data_size) { switch (req) { case PTRACE_POKETEXT: { DisplayBytes(buf, &data, 8); - LLDB_LOG(log, "PTRACE_POKETEXT {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_POKETEXT {0}", buf.GetData()); break; } case PTRACE_POKEDATA: { DisplayBytes(buf, &data, 8); - LLDB_LOG(log, "PTRACE_POKEDATA {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_POKEDATA {0}", buf.GetData()); break; } case PTRACE_POKEUSER: { DisplayBytes(buf, &data, 8); - LLDB_LOG(log, "PTRACE_POKEUSER {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_POKEUSER {0}", buf.GetData()); break; } case PTRACE_SETREGS: { DisplayBytes(buf, data, data_size); - LLDB_LOG(log, "PTRACE_SETREGS {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_SETREGS {0}", buf.GetData()); break; } case PTRACE_SETFPREGS: { DisplayBytes(buf, data, data_size); - LLDB_LOG(log, "PTRACE_SETFPREGS {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_SETFPREGS {0}", buf.GetData()); break; } case PTRACE_SETSIGINFO: { DisplayBytes(buf, data, sizeof(siginfo_t)); - LLDB_LOG(log, "PTRACE_SETSIGINFO {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_SETSIGINFO {0}", buf.GetData()); break; } case PTRACE_SETREGSET: { // Extract iov_base from data, which is a pointer to the struct IOVEC DisplayBytes(buf, *(void **)data, data_size); - LLDB_LOG(log, "PTRACE_SETREGSET {0}", buf.GetData()); + LLDB_LOGV(log, "PTRACE_SETREGSET {0}", buf.GetData()); break; } default: {} diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp index 0c5a518d1c99..f2d4e38033e4 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp @@ -84,8 +84,6 @@ static uint32_t GetFlagBits(const char *arg) { return POSIX_LOG_STEP; else if (::strcasecmp(arg, "thread") == 0) return POSIX_LOG_THREAD; - else if (::strcasecmp(arg, "verbose") == 0) - return POSIX_LOG_VERBOSE; else if (::strncasecmp(arg, "watch", 5) == 0) return POSIX_LOG_WATCHPOINTS; return 0; diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h index 7d187da4e488..00af3dd5081c 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h @@ -18,7 +18,6 @@ // Project includes #include "lldb/Core/Log.h" -#define POSIX_LOG_VERBOSE (1u << 0) #define POSIX_LOG_PROCESS (1u << 1) #define POSIX_LOG_THREAD (1u << 2) #define POSIX_LOG_PACKETS (1u << 3)