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