Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
39642 views
//===-- ProcessGDBRemoteLog.cpp -------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "ProcessGDBRemoteLog.h"9#include "ProcessGDBRemote.h"10#include "llvm/Support/Threading.h"1112using namespace lldb;13using namespace lldb_private;14using namespace lldb_private::process_gdb_remote;1516static constexpr Log::Category g_categories[] = {17{{"async"}, {"log asynchronous activity"}, GDBRLog::Async},18{{"break"}, {"log breakpoints"}, GDBRLog::Breakpoints},19{{"comm"}, {"log communication activity"}, GDBRLog::Comm},20{{"packets"}, {"log gdb remote packets"}, GDBRLog::Packets},21{{"memory"}, {"log memory reads and writes"}, GDBRLog::Memory},22{{"data-short"},23{"log memory bytes for memory reads and writes for short transactions "24"only"},25GDBRLog::MemoryDataShort},26{{"data-long"},27{"log memory bytes for memory reads and writes for all transactions"},28GDBRLog::MemoryDataLong},29{{"process"}, {"log process events and activities"}, GDBRLog::Process},30{{"step"}, {"log step related activities"}, GDBRLog::Step},31{{"thread"}, {"log thread events and activities"}, GDBRLog::Thread},32{{"watch"}, {"log watchpoint related activities"}, GDBRLog::Watchpoints},33};3435static Log::Channel g_channel(g_categories, GDBRLog::Packets);3637template <> Log::Channel &lldb_private::LogChannelFor<GDBRLog>() {38return g_channel;39}4041void ProcessGDBRemoteLog::Initialize() {42static llvm::once_flag g_once_flag;43llvm::call_once(g_once_flag, []() {44Log::Register("gdb-remote", g_channel);45});46}474849