blob: c0147c43410fb48d2807d95d1ef95815e89da6ba [file] [log] [blame]
Kate Stoneb9c1b512016-09-06 20:57:50 +00001//===-- ProcessPOSIXLog.h -----------------------------------------*- C++
2//-*-===//
Johnny Chen9ed5b492012-01-05 21:48:15 +00003//
Chandler Carruth2946cd72019-01-19 08:50:56 +00004// 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 Chen9ed5b492012-01-05 21:48:15 +00007//
8//===----------------------------------------------------------------------===//
9
Ed Maste69b76d52013-06-24 14:51:39 +000010#ifndef liblldb_ProcessPOSIXLog_h_
11#define liblldb_ProcessPOSIXLog_h_
Johnny Chen9ed5b492012-01-05 21:48:15 +000012
Johnny Chen9ed5b492012-01-05 21:48:15 +000013
Zachary Turner6f9e6902017-03-03 20:56:28 +000014#include "lldb/Utility/Log.h"
Johnny Chen9ed5b492012-01-05 21:48:15 +000015
Kate Stoneb9c1b512016-09-06 20:57:50 +000016#define POSIX_LOG_PROCESS (1u << 1)
17#define POSIX_LOG_THREAD (1u << 2)
Kate Stoneb9c1b512016-09-06 20:57:50 +000018#define POSIX_LOG_MEMORY (1u << 4) // Log memory reads/writes calls
Pavel Labathc29f7ff2017-02-23 10:33:16 +000019#define POSIX_LOG_PTRACE (1u << 5)
20#define POSIX_LOG_REGISTERS (1u << 6)
Kate Stoneb9c1b512016-09-06 20:57:50 +000021#define POSIX_LOG_BREAKPOINTS (1u << 7)
22#define POSIX_LOG_WATCHPOINTS (1u << 8)
Kate Stoneb9c1b512016-09-06 20:57:50 +000023#define POSIX_LOG_ALL (UINT32_MAX)
Pavel Labathc29f7ff2017-02-23 10:33:16 +000024#define POSIX_LOG_DEFAULT POSIX_LOG_PROCESS
Johnny Chen9ed5b492012-01-05 21:48:15 +000025
Pavel Labathc29f7ff2017-02-23 10:33:16 +000026namespace lldb_private {
Kate Stoneb9c1b512016-09-06 20:57:50 +000027class ProcessPOSIXLog {
Pavel Labathc29f7ff2017-02-23 10:33:16 +000028 static Log::Channel g_channel;
Johnny Chen9ed5b492012-01-05 21:48:15 +000029
30public:
Pavel Labathc29f7ff2017-02-23 10:33:16 +000031 static void Initialize();
Robert Flack5f4b6c72015-03-11 21:14:22 +000032
Pavel Labathc29f7ff2017-02-23 10:33:16 +000033 static Log *GetLogIfAllCategoriesSet(uint32_t mask) {
34 return g_channel.GetLogIfAll(mask);
Kate Stoneb9c1b512016-09-06 20:57:50 +000035 }
Johnny Chen9ed5b492012-01-05 21:48:15 +000036};
Pavel Labathc29f7ff2017-02-23 10:33:16 +000037}
Johnny Chen9ed5b492012-01-05 21:48:15 +000038
Kate Stoneb9c1b512016-09-06 20:57:50 +000039#endif // liblldb_ProcessPOSIXLog_h_