diff options
5 files changed, 13 insertions, 27 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index e501fca8863..e20994a9a0c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -321,8 +321,7 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, 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::WaitForPacketNoLock(StringExtractorGDBRemote &packet, 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) diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 122cd9f7eb7..c9419f2e577 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1617,9 +1617,7 @@ bool ProcessGDBRemote::UpdateThreadList(ThreadList &old_thread_list, 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(ThreadList &old_thread_list, 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); diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp index 7735cc0ba99..f84ac7996ab 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp @@ -97,8 +97,6 @@ void ProcessGDBRemoteLog::DisableLog(const char **categories, 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(StreamSP &log_stream_sp, 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 { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h index f5e92b45061..ec0d4b035ff 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h @@ -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) diff --git a/lldb/tools/lldb-server/lldb-gdbserver.cpp b/lldb/tools/lldb-server/lldb-gdbserver.cpp index 9606f65f121..59f5a44ce4e 100644 --- a/lldb/tools/lldb-server/lldb-gdbserver.cpp +++ b/lldb/tools/lldb-server/lldb-gdbserver.cpp @@ -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++) { |