• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- lldb-private-log.h --------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_lldb_private_log_h_
11 #define liblldb_lldb_private_log_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/lldb-private.h"
18 
19 //----------------------------------------------------------------------
20 // Log Bits specific to logging in lldb
21 //----------------------------------------------------------------------
22 #define LIBLLDB_LOG_VERBOSE             (1u << 0)
23 #define LIBLLDB_LOG_PROCESS             (1u << 1)
24 #define LIBLLDB_LOG_THREAD              (1u << 2)
25 #define LIBLLDB_LOG_DYNAMIC_LOADER      (1u << 3)
26 #define LIBLLDB_LOG_EVENTS              (1u << 4)
27 #define LIBLLDB_LOG_BREAKPOINTS         (1u << 5)
28 #define LIBLLDB_LOG_WATCHPOINTS         (1u << 6)
29 #define LIBLLDB_LOG_STEP                (1u << 7)
30 #define LIBLLDB_LOG_EXPRESSIONS         (1u << 8)
31 #define LIBLLDB_LOG_TEMPORARY           (1u << 9)
32 #define LIBLLDB_LOG_STATE               (1u << 10)
33 #define LIBLLDB_LOG_OBJECT              (1u << 11)
34 #define LIBLLDB_LOG_COMMUNICATION       (1u << 12)
35 #define LIBLLDB_LOG_CONNECTION          (1u << 13)
36 #define LIBLLDB_LOG_HOST                (1u << 14)
37 #define LIBLLDB_LOG_UNWIND              (1u << 15)
38 #define LIBLLDB_LOG_API                 (1u << 16)
39 #define LIBLLDB_LOG_SCRIPT              (1u << 17)
40 #define LIBLLDB_LOG_COMMANDS            (1U << 18)
41 #define LIBLLDB_LOG_TYPES               (1u << 19)
42 #define LIBLLDB_LOG_SYMBOLS             (1u << 20)
43 #define LIBLLDB_LOG_MODULES             (1u << 21)
44 #define LIBLLDB_LOG_TARGET              (1u << 22)
45 #define LIBLLDB_LOG_MMAP                (1u << 23)
46 #define LIBLLDB_LOG_OS                  (1u << 24)
47 #define LIBLLDB_LOG_ALL                 (UINT32_MAX)
48 #define LIBLLDB_LOG_DEFAULT             (LIBLLDB_LOG_PROCESS              |\
49                                          LIBLLDB_LOG_THREAD               |\
50                                          LIBLLDB_LOG_DYNAMIC_LOADER       |\
51                                          LIBLLDB_LOG_BREAKPOINTS          |\
52                                          LIBLLDB_LOG_WATCHPOINTS          |\
53                                          LIBLLDB_LOG_STEP                 |\
54                                          LIBLLDB_LOG_STATE                |\
55                                          LIBLLDB_LOG_SYMBOLS              |\
56                                          LIBLLDB_LOG_TARGET               |\
57                                          LIBLLDB_LOG_COMMANDS)
58 
59 namespace lldb_private {
60 
61 void
62 LogIfAllCategoriesSet (uint32_t mask, const char *format, ...);
63 
64 void
65 LogIfAnyCategoriesSet (uint32_t mask, const char *format, ...);
66 
67 Log *
68 GetLogIfAllCategoriesSet (uint32_t mask);
69 
70 Log *
71 GetLogIfAnyCategoriesSet (uint32_t mask);
72 
73 uint32_t
74 GetLogMask ();
75 
76 bool
77 IsLogVerbose ();
78 
79 void
80 DisableLog (const char **categories, Stream *feedback_strm);
81 
82 Log *
83 EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm);
84 
85 void
86 ListLogCategories (Stream *strm);
87 
88 } // namespace lldb_private
89 
90 #endif  // liblldb_lldb_private_log_h_
91