1 //===-- ProcessPOSIXLog.h -----------------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 
11 #ifndef liblldb_ProcessPOSIXLog_h_
12 #define liblldb_ProcessPOSIXLog_h_
13 
14 // C Includes
15 // C++ Includes
16 // Other libraries and framework includes
17 
18 // Project includes
19 #include "lldb/Utility/Log.h"
20 
21 #define POSIX_LOG_PROCESS (1u << 1)
22 #define POSIX_LOG_THREAD (1u << 2)
23 #define POSIX_LOG_MEMORY (1u << 4) // Log memory reads/writes calls
24 #define POSIX_LOG_PTRACE (1u << 5)
25 #define POSIX_LOG_REGISTERS (1u << 6)
26 #define POSIX_LOG_BREAKPOINTS (1u << 7)
27 #define POSIX_LOG_WATCHPOINTS (1u << 8)
28 #define POSIX_LOG_ALL (UINT32_MAX)
29 #define POSIX_LOG_DEFAULT POSIX_LOG_PROCESS
30 
31 namespace lldb_private {
32 class ProcessPOSIXLog {
33   static Log::Channel g_channel;
34 
35 public:
36   static void Initialize();
37 
38   static Log *GetLogIfAllCategoriesSet(uint32_t mask) {
39     return g_channel.GetLogIfAll(mask);
40   }
41 };
42 }
43 
44 #endif // liblldb_ProcessPOSIXLog_h_
45