1 //===-- ProcessPOSIXLog.h -----------------------------------------*- C++
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ProcessPOSIXLog_h_
11 #define liblldb_ProcessPOSIXLog_h_
14 #include "lldb/Utility/Log.h"
16 #define POSIX_LOG_PROCESS (1u << 1)
17 #define POSIX_LOG_THREAD (1u << 2)
18 #define POSIX_LOG_MEMORY (1u << 4) // Log memory reads/writes calls
19 #define POSIX_LOG_PTRACE (1u << 5)
20 #define POSIX_LOG_REGISTERS (1u << 6)
21 #define POSIX_LOG_BREAKPOINTS (1u << 7)
22 #define POSIX_LOG_WATCHPOINTS (1u << 8)
23 #define POSIX_LOG_ALL (UINT32_MAX)
24 #define POSIX_LOG_DEFAULT POSIX_LOG_PROCESS
26 namespace lldb_private {
27 class ProcessPOSIXLog {
28 static Log::Channel g_channel;
31 static void Initialize();
33 static Log *GetLogIfAllCategoriesSet(uint32_t mask) {
34 return g_channel.GetLogIfAll(mask);
39 #endif // liblldb_ProcessPOSIXLog_h_