blob: 66ba245c9fa882f1d23aecb68f006cf029d64173 [file] [log] [blame]
Adrian McCarthy18a9135d2015-10-28 18:21:45 +00001//===-- ProcessWindowsLog.h -------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Adrian McCarthy18a9135d2015-10-28 18:21:45 +00006//
7//===----------------------------------------------------------------------===//
8
9#ifndef liblldb_ProcessWindowsLog_h_
10#define liblldb_ProcessWindowsLog_h_
11
Zachary Turner6f9e6902017-03-03 20:56:28 +000012#include "lldb/Utility/Log.h"
Adrian McCarthy18a9135d2015-10-28 18:21:45 +000013
Kate Stoneb9c1b512016-09-06 20:57:50 +000014#define WINDOWS_LOG_PROCESS (1u << 1) // Log process operations
15#define WINDOWS_LOG_EXCEPTION (1u << 1) // Log exceptions
16#define WINDOWS_LOG_THREAD (1u << 2) // Log thread operations
17#define WINDOWS_LOG_MEMORY (1u << 3) // Log memory reads/writes calls
18#define WINDOWS_LOG_BREAKPOINTS (1u << 4) // Log breakpoint operations
19#define WINDOWS_LOG_STEP (1u << 5) // Log step operations
20#define WINDOWS_LOG_REGISTERS (1u << 6) // Log register operations
21#define WINDOWS_LOG_EVENT (1u << 7) // Low level debug events
Adrian McCarthy18a9135d2015-10-28 18:21:45 +000022
Pavel Labath3cc0e332017-02-23 13:10:38 +000023namespace lldb_private {
Kate Stoneb9c1b512016-09-06 20:57:50 +000024class ProcessWindowsLog {
Pavel Labath3cc0e332017-02-23 13:10:38 +000025 static Log::Channel g_channel;
Adrian McCarthy18a9135d2015-10-28 18:21:45 +000026
27public:
Kate Stoneb9c1b512016-09-06 20:57:50 +000028 static void Initialize();
Kate Stoneb9c1b512016-09-06 20:57:50 +000029 static void Terminate();
Adrian McCarthy18a9135d2015-10-28 18:21:45 +000030
Pavel Labath3cc0e332017-02-23 13:10:38 +000031 static Log *GetLogIfAny(uint32_t mask) { return g_channel.GetLogIfAny(mask); }
Adrian McCarthy18a9135d2015-10-28 18:21:45 +000032};
Pavel Labath3cc0e332017-02-23 13:10:38 +000033}
Adrian McCarthy18a9135d2015-10-28 18:21:45 +000034
Kate Stoneb9c1b512016-09-06 20:57:50 +000035#endif // liblldb_ProcessWindowsLog_h_