Remove the verbose category in the posix channel

replace by LLDB_LOGV

llvm-svn: 294223
This commit is contained in:
Pavel Labath 2017-02-06 19:31:05 +00:00
parent 2f8d5739b5
commit aafe053c53
5 changed files with 15 additions and 29 deletions

View File

@ -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();

View File

@ -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<std::recursive_mutex> 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<std::recursive_mutex> guard(m_thread_list.GetMutex());
ThreadSP thread_sp = m_thread_list.RemoveThreadByID(tid, false);

View File

@ -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: {}

View File

@ -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;

View File

@ -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)