blob: 3ac798b3d4b3d9e48643f5d2ebf0fb559349ef09 [file] [log] [blame]
Kate Stoneb9c1b512016-09-06 20:57:50 +00001//===-- ProcessPOSIXLog.h -----------------------------------------*- C++
2//-*-===//
Johnny Chen9ed5b492012-01-05 21:48:15 +00003//
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 Maste69b76d52013-06-24 14:51:39 +000011#ifndef liblldb_ProcessPOSIXLog_h_
12#define liblldb_ProcessPOSIXLog_h_
Johnny Chen9ed5b492012-01-05 21:48:15 +000013
Johnny Chen9ed5b492012-01-05 21:48:15 +000014
Zachary Turner6f9e6902017-03-03 20:56:28 +000015#include "lldb/Utility/Log.h"
Johnny Chen9ed5b492012-01-05 21:48:15 +000016
Kate Stoneb9c1b512016-09-06 20:57:50 +000017#define POSIX_LOG_PROCESS (1u << 1)
18#define POSIX_LOG_THREAD (1u << 2)
Kate Stoneb9c1b512016-09-06 20:57:50 +000019#define POSIX_LOG_MEMORY (1u << 4) // Log memory reads/writes calls
Pavel Labathc29f7ff2017-02-23 10:33:16 +000020#define POSIX_LOG_PTRACE (1u << 5)
21#define POSIX_LOG_REGISTERS (1u << 6)
Kate Stoneb9c1b512016-09-06 20:57:50 +000022#define POSIX_LOG_BREAKPOINTS (1u << 7)
23#define POSIX_LOG_WATCHPOINTS (1u << 8)
Kate Stoneb9c1b512016-09-06 20:57:50 +000024#define POSIX_LOG_ALL (UINT32_MAX)
Pavel Labathc29f7ff2017-02-23 10:33:16 +000025#define POSIX_LOG_DEFAULT POSIX_LOG_PROCESS
Johnny Chen9ed5b492012-01-05 21:48:15 +000026
Pavel Labathc29f7ff2017-02-23 10:33:16 +000027namespace lldb_private {
Kate Stoneb9c1b512016-09-06 20:57:50 +000028class ProcessPOSIXLog {
Pavel Labathc29f7ff2017-02-23 10:33:16 +000029 static Log::Channel g_channel;
Johnny Chen9ed5b492012-01-05 21:48:15 +000030
31public:
Pavel Labathc29f7ff2017-02-23 10:33:16 +000032 static void Initialize();
Robert Flack5f4b6c72015-03-11 21:14:22 +000033
Pavel Labathc29f7ff2017-02-23 10:33:16 +000034 static Log *GetLogIfAllCategoriesSet(uint32_t mask) {
35 return g_channel.GetLogIfAll(mask);
Kate Stoneb9c1b512016-09-06 20:57:50 +000036 }
Johnny Chen9ed5b492012-01-05 21:48:15 +000037};
Pavel Labathc29f7ff2017-02-23 10:33:16 +000038}
Johnny Chen9ed5b492012-01-05 21:48:15 +000039
Kate Stoneb9c1b512016-09-06 20:57:50 +000040#endif // liblldb_ProcessPOSIXLog_h_