• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- ProcessGDBRemoteLog.h -----------------------------------*- C++ -*-===//
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 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_PROCESSGDBREMOTELOG_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_PROCESSGDBREMOTELOG_H
11 
12 #include "lldb/Utility/Log.h"
13 
14 #define GDBR_LOG_PROCESS (1u << 1)
15 #define GDBR_LOG_THREAD (1u << 2)
16 #define GDBR_LOG_PACKETS (1u << 3)
17 #define GDBR_LOG_MEMORY (1u << 4) // Log memory reads/writes calls
18 #define GDBR_LOG_MEMORY_DATA_SHORT                                             \
19   (1u << 5) // Log short memory reads/writes bytes
20 #define GDBR_LOG_MEMORY_DATA_LONG (1u << 6) // Log all memory reads/writes bytes
21 #define GDBR_LOG_BREAKPOINTS (1u << 7)
22 #define GDBR_LOG_WATCHPOINTS (1u << 8)
23 #define GDBR_LOG_STEP (1u << 9)
24 #define GDBR_LOG_COMM (1u << 10)
25 #define GDBR_LOG_ASYNC (1u << 11)
26 #define GDBR_LOG_ALL (UINT32_MAX)
27 #define GDBR_LOG_DEFAULT GDBR_LOG_PACKETS
28 
29 namespace lldb_private {
30 namespace process_gdb_remote {
31 
32 class ProcessGDBRemoteLog {
33   static Log::Channel g_channel;
34 
35 public:
36   static void Initialize();
37 
GetLogIfAllCategoriesSet(uint32_t mask)38   static Log *GetLogIfAllCategoriesSet(uint32_t mask) { return g_channel.GetLogIfAll(mask); }
GetLogIfAnyCategoryIsSet(uint32_t mask)39   static Log *GetLogIfAnyCategoryIsSet(uint32_t mask) { return g_channel.GetLogIfAny(mask); }
40 };
41 
42 } // namespace process_gdb_remote
43 } // namespace lldb_private
44 
45 #endif // LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_PROCESSGDBREMOTELOG_H
46