aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-01-28 10:53:49 +0100
committerPavel Labath <pavel@labath.sk>2022-02-01 14:36:29 +0100
commitb1127753b9dd9e76fa89e567345c0be0585b7498 (patch)
treed5c658f63125c320c45854bd2be46b7cf6904469 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
parent8edfc2f814fe107bf31e3470478aa9bcacdf5aed (diff)
downloadllvm-b1127753b9dd9e76fa89e567345c0be0585b7498.zip
llvm-b1127753b9dd9e76fa89e567345c0be0585b7498.tar.gz
llvm-b1127753b9dd9e76fa89e567345c0be0585b7498.tar.bz2
[lldb] Convert ProcessGDBRemoteLog to the new API
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 25ae088..38d9e40 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -93,7 +93,7 @@ char GDBRemoteCommunication::CalculcateChecksum(llvm::StringRef payload) {
}
size_t GDBRemoteCommunication::SendAck() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '+';
const size_t bytes_written = WriteAll(&ch, 1, status, nullptr);
@@ -103,7 +103,7 @@ size_t GDBRemoteCommunication::SendAck() {
}
size_t GDBRemoteCommunication::SendNack() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '-';
const size_t bytes_written = WriteAll(&ch, 1, status, nullptr);
@@ -128,7 +128,7 @@ GDBRemoteCommunication::PacketResult
GDBRemoteCommunication::SendRawPacketNoLock(llvm::StringRef packet,
bool skip_ack) {
if (IsConnected()) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
ConnectionStatus status = eConnectionStatusSuccess;
const char *packet_data = packet.data();
const size_t packet_length = packet.size();
@@ -222,7 +222,7 @@ GDBRemoteCommunication::ReadPacket(StringExtractorGDBRemote &response,
bool sync_on_timeout) {
using ResponseType = StringExtractorGDBRemote::ResponseType;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
for (;;) {
PacketResult result =
WaitForPacketNoLock(response, timeout, sync_on_timeout);
@@ -241,7 +241,7 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
uint8_t buffer[8192];
Status error;
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
// Check for a packet from our cache first without trying any reading...
if (CheckForPacket(nullptr, 0, packet) != PacketType::Invalid)
@@ -382,7 +382,7 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
}
bool GDBRemoteCommunication::DecompressPacket() {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
if (!CompressionIsEnabled())
return true;
@@ -616,7 +616,7 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
// Put the packet data into the buffer in a thread safe fashion
std::lock_guard<std::recursive_mutex> guard(m_bytes_mutex);
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
+ Log *log = GetLog(GDBRLog::Packets);
if (src && src_len > 0) {
if (log && log->GetVerbose()) {
@@ -881,7 +881,7 @@ GDBRemoteCommunication::ListenThread(lldb::thread_arg_t arg) {
Status GDBRemoteCommunication::StartDebugserverProcess(
const char *url, Platform *platform, ProcessLaunchInfo &launch_info,
uint16_t *port, const Args *inferior_args, int pass_comm_fd) {
- Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
+ Log *log = GetLog(GDBRLog::Process);
LLDB_LOGF(log, "GDBRemoteCommunication::%s(url=%s, port=%" PRIu16 ")",
__FUNCTION__, url ? url : "<empty>", port ? *port : uint16_t(0));