180814287SRaphael Isemann //===-- ProcessKDPLog.cpp -------------------------------------------------===//
2f9765acdSGreg Clayton //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6f9765acdSGreg Clayton //
7f9765acdSGreg Clayton //===----------------------------------------------------------------------===//
8f9765acdSGreg Clayton
9f9765acdSGreg Clayton #include "ProcessKDPLog.h"
10f9765acdSGreg Clayton
11f9765acdSGreg Clayton using namespace lldb_private;
12f9765acdSGreg Clayton
137b35b781SPavel Labath static constexpr Log::Category g_categories[] = {
14*2a1b7aa0SPavel Labath {{"async"}, {"log asynchronous activity"}, KDPLog::Async},
15*2a1b7aa0SPavel Labath {{"break"}, {"log breakpoints"}, KDPLog::Breakpoints},
16*2a1b7aa0SPavel Labath {{"comm"}, {"log communication activity"}, KDPLog::Comm},
177b35b781SPavel Labath {{"data-long"},
187b35b781SPavel Labath {"log memory bytes for memory reads and writes for all transactions"},
19*2a1b7aa0SPavel Labath KDPLog::MemoryDataLong},
207b35b781SPavel Labath {{"data-short"},
217b35b781SPavel Labath {"log memory bytes for memory reads and writes for short transactions "
227b35b781SPavel Labath "only"},
23*2a1b7aa0SPavel Labath KDPLog::MemoryDataShort},
24*2a1b7aa0SPavel Labath {{"memory"}, {"log memory reads and writes"}, KDPLog::Memory},
25*2a1b7aa0SPavel Labath {{"packets"}, {"log gdb remote packets"}, KDPLog::Packets},
26*2a1b7aa0SPavel Labath {{"process"}, {"log process events and activities"}, KDPLog::Process},
27*2a1b7aa0SPavel Labath {{"step"}, {"log step related activities"}, KDPLog::Step},
28*2a1b7aa0SPavel Labath {{"thread"}, {"log thread events and activities"}, KDPLog::Thread},
29*2a1b7aa0SPavel Labath {{"watch"}, {"log watchpoint related activities"}, KDPLog::Watchpoints},
307b35b781SPavel Labath };
31f9765acdSGreg Clayton
32*2a1b7aa0SPavel Labath static Log::Channel g_channel(g_categories, KDPLog::Packets);
33*2a1b7aa0SPavel Labath
LogChannelFor()34*2a1b7aa0SPavel Labath template <> Log::Channel &lldb_private::LogChannelFor<KDPLog>() {
35*2a1b7aa0SPavel Labath return g_channel;
36*2a1b7aa0SPavel Labath }
37f9765acdSGreg Clayton
Initialize()387b35b781SPavel Labath void ProcessKDPLog::Initialize() { Log::Register("kdp-remote", g_channel); }
39