Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 1 | //===-- ProcessPOSIXLog.h -----------------------------------------*- C++ |
| 2 | //-*-===// |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 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 | |
Ed Maste | 69b76d5 | 2013-06-24 14:51:39 +0000 | [diff] [blame] | 11 | #ifndef liblldb_ProcessPOSIXLog_h_ |
| 12 | #define liblldb_ProcessPOSIXLog_h_ |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 13 | |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 14 | |
Zachary Turner | 6f9e690 | 2017-03-03 20:56:28 +0000 | [diff] [blame] | 15 | #include "lldb/Utility/Log.h" |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 16 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 17 | #define POSIX_LOG_PROCESS (1u << 1) |
| 18 | #define POSIX_LOG_THREAD (1u << 2) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 19 | #define POSIX_LOG_MEMORY (1u << 4) // Log memory reads/writes calls |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 20 | #define POSIX_LOG_PTRACE (1u << 5) |
| 21 | #define POSIX_LOG_REGISTERS (1u << 6) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 22 | #define POSIX_LOG_BREAKPOINTS (1u << 7) |
| 23 | #define POSIX_LOG_WATCHPOINTS (1u << 8) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 24 | #define POSIX_LOG_ALL (UINT32_MAX) |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 25 | #define POSIX_LOG_DEFAULT POSIX_LOG_PROCESS |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 26 | |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 27 | namespace lldb_private { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 28 | class ProcessPOSIXLog { |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 29 | static Log::Channel g_channel; |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 30 | |
| 31 | public: |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 32 | static void Initialize(); |
Robert Flack | 5f4b6c7 | 2015-03-11 21:14:22 +0000 | [diff] [blame] | 33 | |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 34 | static Log *GetLogIfAllCategoriesSet(uint32_t mask) { |
| 35 | return g_channel.GetLogIfAll(mask); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 36 | } |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 37 | }; |
Pavel Labath | c29f7ff | 2017-02-23 10:33:16 +0000 | [diff] [blame] | 38 | } |
Johnny Chen | 9ed5b49 | 2012-01-05 21:48:15 +0000 | [diff] [blame] | 39 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 40 | #endif // liblldb_ProcessPOSIXLog_h_ |