[Lldb-commits] [lldb] r294224 - Remove the verbose category in the gdb-remote channel

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 6 11:31:09 PST 2017


Author: labath
Date: Mon Feb  6 13:31:09 2017
New Revision: 294224

URL: http://llvm.org/viewvc/llvm-project?rev=294224&view=rev
Log:
Remove the verbose category in the gdb-remote channel

replace by LLDB_LOGV

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
    lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=294224&r1=294223&r2=294224&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Mon Feb  6 13:31:09 2017
@@ -321,8 +321,7 @@ GDBRemoteCommunication::WaitForPacketNoL
   uint8_t buffer[8192];
   Error error;
 
-  Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS |
-                                                         GDBR_LOG_VERBOSE));
+  Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
 
   // Check for a packet from our cache first without trying any reading...
   if (CheckForPacket(NULL, 0, packet) != PacketType::Invalid)
@@ -334,12 +333,12 @@ GDBRemoteCommunication::WaitForPacketNoL
     lldb::ConnectionStatus status = eConnectionStatusNoConnection;
     size_t bytes_read = Read(buffer, sizeof(buffer), timeout, status, &error);
 
-    if (log)
-      log->Printf("%s: Read (buffer, (sizeof(buffer), timeout = %ld us, "
-                  "status = %s, error = %s) => bytes_read = %" PRIu64,
-                  LLVM_PRETTY_FUNCTION, long(timeout ? timeout->count() : -1),
-                  Communication::ConnectionStatusAsCString(status),
-                  error.AsCString(), (uint64_t)bytes_read);
+    LLDB_LOGV(log,
+              "Read(buffer, sizeof(buffer), timeout = {0} us, "
+              "status = {1}, error = {2}) => bytes_read = {3}",
+              long(timeout ? timeout->count() : -1),
+              Communication::ConnectionStatusAsCString(status), error,
+              bytes_read);
 
     if (bytes_read > 0) {
       if (CheckForPacket(buffer, bytes_read, packet) != PacketType::Invalid)

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=294224&r1=294223&r2=294224&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Feb  6 13:31:09 2017
@@ -1617,9 +1617,7 @@ bool ProcessGDBRemote::UpdateThreadList(
                                         ThreadList &new_thread_list) {
   // locker will keep a mutex locked until it goes out of scope
   Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_THREAD));
-  if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))
-    log->Printf("ProcessGDBRemote::%s (pid = %" PRIu64 ")", __FUNCTION__,
-                GetID());
+  LLDB_LOGV(log, "pid = {0}", GetID());
 
   size_t num_thread_ids = m_thread_ids.size();
   // The "m_thread_ids" thread ID list should always be updated after each stop
@@ -1638,17 +1636,11 @@ bool ProcessGDBRemote::UpdateThreadList(
           old_thread_list_copy.RemoveThreadByProtocolID(tid, false));
       if (!thread_sp) {
         thread_sp.reset(new ThreadGDBRemote(*this, tid));
-        if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))
-          log->Printf("ProcessGDBRemote::%s Making new thread: %p for thread "
-                      "ID: 0x%" PRIx64 ".\n",
-                      __FUNCTION__, static_cast<void *>(thread_sp.get()),
-                      thread_sp->GetID());
+        LLDB_LOGV(log, "Making new thread: {0} for thread ID: {1:x}.",
+                  thread_sp.get(), thread_sp->GetID());
       } else {
-        if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))
-          log->Printf("ProcessGDBRemote::%s Found old thread: %p for thread "
-                      "ID: 0x%" PRIx64 ".\n",
-                      __FUNCTION__, static_cast<void *>(thread_sp.get()),
-                      thread_sp->GetID());
+        LLDB_LOGV(log, "Found old thread: {0} for thread ID: {1:x}.",
+                  thread_sp.get(), thread_sp->GetID());
       }
 
       SetThreadPc(thread_sp, i);

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp?rev=294224&r1=294223&r2=294224&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp Mon Feb  6 13:31:09 2017
@@ -97,8 +97,6 @@ void ProcessGDBRemoteLog::DisableLog(con
           flag_bits &= ~GDBR_LOG_STEP;
         else if (::strcasecmp(arg, "thread") == 0)
           flag_bits &= ~GDBR_LOG_THREAD;
-        else if (::strcasecmp(arg, "verbose") == 0)
-          flag_bits &= ~GDBR_LOG_VERBOSE;
         else if (::strncasecmp(arg, "watch", 5) == 0)
           flag_bits &= ~GDBR_LOG_WATCHPOINTS;
         else {
@@ -165,8 +163,6 @@ Log *ProcessGDBRemoteLog::EnableLog(Stre
         flag_bits |= GDBR_LOG_STEP;
       else if (::strcasecmp(arg, "thread") == 0)
         flag_bits |= GDBR_LOG_THREAD;
-      else if (::strcasecmp(arg, "verbose") == 0)
-        flag_bits |= GDBR_LOG_VERBOSE;
       else if (::strncasecmp(arg, "watch", 5) == 0)
         flag_bits |= GDBR_LOG_WATCHPOINTS;
       else {

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h?rev=294224&r1=294223&r2=294224&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h Mon Feb  6 13:31:09 2017
@@ -17,7 +17,6 @@
 // Project includes
 #include "lldb/Core/Log.h"
 
-#define GDBR_LOG_VERBOSE (1u << 0)
 #define GDBR_LOG_PROCESS (1u << 1)
 #define GDBR_LOG_THREAD (1u << 2)
 #define GDBR_LOG_PACKETS (1u << 3)

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=294224&r1=294223&r2=294224&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Mon Feb  6 13:31:09 2017
@@ -430,7 +430,7 @@ int main_gdbserver(int argc, char *argv[
               LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION))
     return -1;
 
-  Log *log(lldb_private::GetLogIfAnyCategoriesSet(GDBR_LOG_VERBOSE));
+  Log *log(lldb_private::GetLogIfAnyCategoriesSet(GDBR_LOG_PROCESS));
   if (log) {
     log->Printf("lldb-server launch");
     for (int i = 0; i < argc; i++) {




More information about the lldb-commits mailing list