diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-02-05 18:04:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-02-05 18:05:05 +0000 |
commit | ecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (patch) | |
tree | 3a4038f3b7bafaeade9fd6146ea8021237616657 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 6f8fc217eaa12bf657be1c6468ed9938d10168b3 (diff) |
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index f6526d03863b..91b9151328a8 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -399,8 +399,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() { packet_response.GetHexMaxU64(/*little_endian=*/false, UINT64_MAX); if (m_max_packet_size == 0) { m_max_packet_size = UINT64_MAX; // Must have been a garbled response - Log *log( - ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log(GetLog(GDBRLog::Process)); LLDB_LOGF(log, "Garbled PacketSize spec in qSupported response"); } } @@ -485,8 +484,7 @@ GDBRemoteCommunicationClient::SendThreadSpecificPacketAndWaitForResponse( StringExtractorGDBRemote &response) { Lock lock(*this); if (!lock) { - if (Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet( - GDBR_LOG_PROCESS | GDBR_LOG_PACKETS)) + if (Log *log = GetLog(GDBRLog::Process | GDBRLog::Packets)) LLDB_LOGF(log, "GDBRemoteCommunicationClient::%s: Didn't get sequence mutex " "for %s packet.", @@ -622,7 +620,7 @@ DataBufferSP GDBRemoteCommunicationClient::ReadMemoryTags(lldb::addr_t addr, packet.Printf("qMemTags:%" PRIx64 ",%zx:%" PRIx32, addr, len, type); StringExtractorGDBRemote response; - Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_MEMORY); + Log *log = GetLog(GDBRLog::Memory); if (SendPacketAndWaitForResponse(packet.GetString(), response) != PacketResult::Success || @@ -1200,7 +1198,7 @@ static void ParseOSType(llvm::StringRef value, std::string &os_name, } bool GDBRemoteCommunicationClient::GetHostInfo(bool force) { - Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); if (force || m_qHostInfo_is_valid == eLazyBoolCalculate) { // host info computation can require DNS traffic and shelling out to external processes. @@ -2110,8 +2108,7 @@ bool GDBRemoteCommunicationClient::GetProcessInfo( } bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) { - Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS | - GDBR_LOG_PACKETS)); + Log *log(GetLog(GDBRLog::Process | GDBRLog::Packets)); if (allow_lazy) { if (m_qProcessInfo_is_valid == eLazyBoolYes) @@ -2887,8 +2884,7 @@ GDBRemoteCommunicationClient::GetCurrentProcessAndThreadIDs( ids.emplace_back(1, 1); } } else { - Log *log(ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_PROCESS | - GDBR_LOG_PACKETS)); + Log *log(GetLog(GDBRLog::Process | GDBRLog::Packets)); LLDB_LOG(log, "error: failed to get packet sequence mutex, not sending " "packet 'qfThreadInfo'"); sequence_mutex_unavailable = true; @@ -3557,7 +3553,7 @@ bool GDBRemoteCommunicationClient::SyncThreadState(lldb::tid_t tid) { llvm::Expected<TraceSupportedResponse> GDBRemoteCommunicationClient::SendTraceSupported(std::chrono::seconds timeout) { - Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); StreamGDBRemote escaped_packet; escaped_packet.PutCString("jLLDBTraceSupported"); @@ -3583,7 +3579,7 @@ GDBRemoteCommunicationClient::SendTraceSupported(std::chrono::seconds timeout) { llvm::Error GDBRemoteCommunicationClient::SendTraceStop(const TraceStopRequest &request, std::chrono::seconds timeout) { - Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); StreamGDBRemote escaped_packet; escaped_packet.PutCString("jLLDBTraceStop:"); @@ -3618,7 +3614,7 @@ GDBRemoteCommunicationClient::SendTraceStop(const TraceStopRequest &request, llvm::Error GDBRemoteCommunicationClient::SendTraceStart(const llvm::json::Value ¶ms, std::chrono::seconds timeout) { - Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); StreamGDBRemote escaped_packet; escaped_packet.PutCString("jLLDBTraceStart:"); @@ -3653,7 +3649,7 @@ GDBRemoteCommunicationClient::SendTraceStart(const llvm::json::Value ¶ms, llvm::Expected<std::string> GDBRemoteCommunicationClient::SendTraceGetState(llvm::StringRef type, std::chrono::seconds timeout) { - Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); StreamGDBRemote escaped_packet; escaped_packet.PutCString("jLLDBTraceGetState:"); @@ -3687,7 +3683,7 @@ GDBRemoteCommunicationClient::SendTraceGetState(llvm::StringRef type, llvm::Expected<std::vector<uint8_t>> GDBRemoteCommunicationClient::SendTraceGetBinaryData( const TraceGetBinaryDataRequest &request, std::chrono::seconds timeout) { - Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); StreamGDBRemote escaped_packet; escaped_packet.PutCString("jLLDBTraceGetBinaryData:"); @@ -4132,8 +4128,7 @@ void GDBRemoteCommunicationClient::ServeSymbolLookups( // our symbol lookup failed so we must abort return; - } else if (Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet( - GDBR_LOG_PROCESS | GDBR_LOG_PACKETS)) { + } else if (Log *log = GetLog(GDBRLog::Process | GDBRLog::Packets)) { LLDB_LOGF(log, "GDBRemoteCommunicationClient::%s: Didn't get sequence mutex.", __FUNCTION__); @@ -4147,7 +4142,7 @@ GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins() { // Query the server for the array of supported asynchronous JSON packets. m_supported_async_json_packets_is_valid = true; - Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); + Log *log = GetLog(GDBRLog::Process); // Poll it now. StringExtractorGDBRemote response; |