xref: /openbsd-src/gnu/llvm/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp (revision f6aab3d83b51b91c24247ad2c2573574de475a82)
1dda28197Spatrick //===-- ProcessKDPLog.cpp -------------------------------------------------===//
2061da546Spatrick //
3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information.
5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6061da546Spatrick //
7061da546Spatrick //===----------------------------------------------------------------------===//
8061da546Spatrick 
9061da546Spatrick #include "ProcessKDPLog.h"
10061da546Spatrick 
11061da546Spatrick using namespace lldb_private;
12061da546Spatrick 
13061da546Spatrick static constexpr Log::Category g_categories[] = {
14*f6aab3d8Srobert     {{"async"}, {"log asynchronous activity"}, KDPLog::Async},
15*f6aab3d8Srobert     {{"break"}, {"log breakpoints"}, KDPLog::Breakpoints},
16*f6aab3d8Srobert     {{"comm"}, {"log communication activity"}, KDPLog::Comm},
17061da546Spatrick     {{"data-long"},
18061da546Spatrick      {"log memory bytes for memory reads and writes for all transactions"},
19*f6aab3d8Srobert      KDPLog::MemoryDataLong},
20061da546Spatrick     {{"data-short"},
21061da546Spatrick      {"log memory bytes for memory reads and writes for short transactions "
22061da546Spatrick       "only"},
23*f6aab3d8Srobert      KDPLog::MemoryDataShort},
24*f6aab3d8Srobert     {{"memory"}, {"log memory reads and writes"}, KDPLog::Memory},
25*f6aab3d8Srobert     {{"packets"}, {"log gdb remote packets"}, KDPLog::Packets},
26*f6aab3d8Srobert     {{"process"}, {"log process events and activities"}, KDPLog::Process},
27*f6aab3d8Srobert     {{"step"}, {"log step related activities"}, KDPLog::Step},
28*f6aab3d8Srobert     {{"thread"}, {"log thread events and activities"}, KDPLog::Thread},
29*f6aab3d8Srobert     {{"watch"}, {"log watchpoint related activities"}, KDPLog::Watchpoints},
30061da546Spatrick };
31061da546Spatrick 
32*f6aab3d8Srobert static Log::Channel g_channel(g_categories, KDPLog::Packets);
33*f6aab3d8Srobert 
LogChannelFor()34*f6aab3d8Srobert template <> Log::Channel &lldb_private::LogChannelFor<KDPLog>() {
35*f6aab3d8Srobert   return g_channel;
36*f6aab3d8Srobert }
37061da546Spatrick 
Initialize()38061da546Spatrick void ProcessKDPLog::Initialize() { Log::Register("kdp-remote", g_channel); }
39