1ac7ddfbfSEd Maste //===-- ProcessGDBRemoteLog.cpp ---------------------------------*- C++ -*-===//
2ac7ddfbfSEd Maste //
3ac7ddfbfSEd Maste // The LLVM Compiler Infrastructure
4ac7ddfbfSEd Maste //
5ac7ddfbfSEd Maste // This file is distributed under the University of Illinois Open Source
6ac7ddfbfSEd Maste // License. See LICENSE.TXT for details.
7ac7ddfbfSEd Maste //
8ac7ddfbfSEd Maste //===----------------------------------------------------------------------===//
9ac7ddfbfSEd Maste
10ac7ddfbfSEd Maste #include "ProcessGDBRemoteLog.h"
11ac7ddfbfSEd Maste #include "ProcessGDBRemote.h"
12*f678e45dSDimitry Andric #include "llvm/Support/Threading.h"
13ac7ddfbfSEd Maste
14ac7ddfbfSEd Maste using namespace lldb;
15ac7ddfbfSEd Maste using namespace lldb_private;
161c3bbb01SEd Maste using namespace lldb_private::process_gdb_remote;
17ac7ddfbfSEd Maste
18*f678e45dSDimitry Andric static constexpr Log::Category g_categories[] = {
19*f678e45dSDimitry Andric {{"async"}, {"log asynchronous activity"}, GDBR_LOG_ASYNC},
20*f678e45dSDimitry Andric {{"break"}, {"log breakpoints"}, GDBR_LOG_BREAKPOINTS},
21*f678e45dSDimitry Andric {{"comm"}, {"log communication activity"}, GDBR_LOG_COMM},
22*f678e45dSDimitry Andric {{"packets"}, {"log gdb remote packets"}, GDBR_LOG_PACKETS},
23*f678e45dSDimitry Andric {{"memory"}, {"log memory reads and writes"}, GDBR_LOG_MEMORY},
24*f678e45dSDimitry Andric {{"data-short"},
25*f678e45dSDimitry Andric {"log memory bytes for memory reads and writes for short transactions "
26*f678e45dSDimitry Andric "only"},
27*f678e45dSDimitry Andric GDBR_LOG_MEMORY_DATA_SHORT},
28*f678e45dSDimitry Andric {{"data-long"},
29*f678e45dSDimitry Andric {"log memory bytes for memory reads and writes for all transactions"},
30*f678e45dSDimitry Andric GDBR_LOG_MEMORY_DATA_LONG},
31*f678e45dSDimitry Andric {{"process"}, {"log process events and activities"}, GDBR_LOG_PROCESS},
32*f678e45dSDimitry Andric {{"step"}, {"log step related activities"}, GDBR_LOG_STEP},
33*f678e45dSDimitry Andric {{"thread"}, {"log thread events and activities"}, GDBR_LOG_THREAD},
34*f678e45dSDimitry Andric {{"watch"}, {"log watchpoint related activities"}, GDBR_LOG_WATCHPOINTS},
35*f678e45dSDimitry Andric };
36*f678e45dSDimitry Andric
37*f678e45dSDimitry Andric Log::Channel ProcessGDBRemoteLog::g_channel(g_categories, GDBR_LOG_DEFAULT);
38ac7ddfbfSEd Maste
Initialize()39435933ddSDimitry Andric void ProcessGDBRemoteLog::Initialize() {
40*f678e45dSDimitry Andric static llvm::once_flag g_once_flag;
41*f678e45dSDimitry Andric llvm::call_once(g_once_flag, []() {
42*f678e45dSDimitry Andric Log::Register("gdb-remote", g_channel);
431c3bbb01SEd Maste });
441c3bbb01SEd Maste }
45