LLDB  mainline
ProcessGDBRemoteLog.cpp
Go to the documentation of this file.
1 //===-- ProcessGDBRemoteLog.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "ProcessGDBRemoteLog.h"
10 #include "ProcessGDBRemote.h"
11 #include "llvm/Support/Threading.h"
12 
13 using namespace lldb;
14 using namespace lldb_private;
15 using namespace lldb_private::process_gdb_remote;
16 
17 static constexpr Log::Category g_categories[] = {
18  {{"async"}, {"log asynchronous activity"}, GDBR_LOG_ASYNC},
19  {{"break"}, {"log breakpoints"}, GDBR_LOG_BREAKPOINTS},
20  {{"comm"}, {"log communication activity"}, GDBR_LOG_COMM},
21  {{"packets"}, {"log gdb remote packets"}, GDBR_LOG_PACKETS},
22  {{"memory"}, {"log memory reads and writes"}, GDBR_LOG_MEMORY},
23  {{"data-short"},
24  {"log memory bytes for memory reads and writes for short transactions "
25  "only"},
27  {{"data-long"},
28  {"log memory bytes for memory reads and writes for all transactions"},
30  {{"process"}, {"log process events and activities"}, GDBR_LOG_PROCESS},
31  {{"step"}, {"log step related activities"}, GDBR_LOG_STEP},
32  {{"thread"}, {"log thread events and activities"}, GDBR_LOG_THREAD},
33  {{"watch"}, {"log watchpoint related activities"}, GDBR_LOG_WATCHPOINTS},
34 };
35 
36 Log::Channel ProcessGDBRemoteLog::g_channel(g_categories, GDBR_LOG_DEFAULT);
37 
38 void ProcessGDBRemoteLog::Initialize() {
39  static llvm::once_flag g_once_flag;
40  llvm::call_once(g_once_flag, []() {
41  Log::Register("gdb-remote", g_channel);
42  });
43 }
GDBR_LOG_THREAD
#define GDBR_LOG_THREAD
Definition: ProcessGDBRemoteLog.h:15
GDBR_LOG_MEMORY
#define GDBR_LOG_MEMORY
Definition: ProcessGDBRemoteLog.h:17
GDBR_LOG_ASYNC
#define GDBR_LOG_ASYNC
Definition: ProcessGDBRemoteLog.h:25
GDBR_LOG_DEFAULT
#define GDBR_LOG_DEFAULT
Definition: ProcessGDBRemoteLog.h:27
lldb_private::Log::Category
Definition: Log.h:52
ProcessGDBRemote.h
g_categories
static constexpr Log::Category g_categories[]
Definition: ProcessGDBRemoteLog.cpp:17
GDBR_LOG_MEMORY_DATA_LONG
#define GDBR_LOG_MEMORY_DATA_LONG
Definition: ProcessGDBRemoteLog.h:20
GDBR_LOG_WATCHPOINTS
#define GDBR_LOG_WATCHPOINTS
Definition: ProcessGDBRemoteLog.h:22
GDBR_LOG_STEP
#define GDBR_LOG_STEP
Definition: ProcessGDBRemoteLog.h:23
GDBR_LOG_MEMORY_DATA_SHORT
#define GDBR_LOG_MEMORY_DATA_SHORT
Definition: ProcessGDBRemoteLog.h:18
lldb_private::process_gdb_remote
Definition: GDBRemoteClientBase.h:17
GDBR_LOG_PROCESS
#define GDBR_LOG_PROCESS
Definition: ProcessGDBRemoteLog.h:14
lldb_private::Log::Channel
Definition: Log.h:60
ProcessGDBRemoteLog.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
GDBR_LOG_COMM
#define GDBR_LOG_COMM
Definition: ProcessGDBRemoteLog.h:24
GDBR_LOG_PACKETS
#define GDBR_LOG_PACKETS
Definition: ProcessGDBRemoteLog.h:16
lldb
Definition: SBAddress.h:15
GDBR_LOG_BREAKPOINTS
#define GDBR_LOG_BREAKPOINTS
Definition: ProcessGDBRemoteLog.h:21